How to solve an inequality?
Subject: How to solve an inequality?
Newsgroups: gmane.comp.mathematics.maxima.general
Date: 2008-05-17 18:08:42 GMT
How can I solve an inequality in Maxima?
How can I solve an inequality in Maxima?
I have the following maxima file
------ test.max -------------------
output_integer(z) := block(
[tmp],
tmp : file_output_append,
file_output_append : true,
stringout( "output.txt", "/* integer */" ),
stringout( "output.txt", z ),
file_output_append : tmp,
return(z)
);
output_integer(1);
------ test.max -------------------
using my NEW Maxima installation (maxima -b test.max), I have
------------------------------------------------
Maxima 5.15.0 http://maxima.sourceforge.net
Using Lisp CLISP 2.45 (2008-05-15)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(Continue reading)
Dear all,
I have a very simple question. If you can answer, I really appreciate. How can I build a matrix with all its elements zero with a simple command?
In example I want to build a matrix like
A=matrix(
[0,0,0],
[0,0,0],
[0,0,0]
);
but it is very hard to make it if you define all the elements and if you have say a 100*100 matrix.
There should be a simple command but I cannot find it in the manual. Also its elements are not forced to be zero. I want to make A a matrix with 100*100 elements in example. Then I will define myself its elements with a for next like loop...
Best Regards
Ahmet Alper Parker
_______________________________________________ Maxima mailing list Maxima <at> math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima
Using Maxima 5.15.0, compiled on Debian Lenny AMD64 using CLISP. kill(all); (%o0) done (%i1) load (tex2ooo); (%o1) /usr/local/share/maxima/5.15.0/share/contrib/tex2ooo.lisp (%i2) 'integrate(x^2*exp(-%i), x); (%o2) %e^(-%i)*integrate(x^2,x) (%i3) tex(%); Maxima encountered a Lisp error: APPEND: A proper list must not end with " cdot " Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. (%i2) (s+1)/(s^4+3*s^3+4*s^2-2*s-3); (%o2) (s+1)/(s^4+3*s^3+4*s^2-2*s-3) (%i3) tex(%); Maxima encountered a Lisp error: APPEND: A proper list must not end with " cdot " Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. BTW: "cdot" is multiplication "." in OOoMath. Thanks Ismael
I would really like it if wxMaxima had the 4 most recent files opened listed in the File menu (or a configurable number if not 4). That is all. Rich
Dear all,
I am not very familiar with maxima and I am willing to write a function to perform a static condensation wherever I call it from maxima. I don't know very well how to write it. I have just written a similar function. How should I convert it to make maxima understand what I want? (Also if I write this function, where will I save it and how will I call it?)
Best Regards
Ahmet Alper Parker
function(x,mat)
r=dim mat
for i=1 to r
for j=1 to r
t[i,j]:mat[i,j]-mat[i,x]*mat[x,j]/mat[x,x]
end for
end for
t:submatrix(t,x);
t:submatrix(x,t);
return t
(Note: x is the row or column number of the martix mat to be condensed. t will be the matrix condensed from matrix mat in its xth row and/or column.)
_______________________________________________ Maxima mailing list Maxima <at> math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima
Dear All, Browsing through the Maxima manual a couple of weeks ago, I thought I saw a function for finding Taylor-series solutions to systems of non-linear ODEs. Only now I can't find it. Can anyone suggest search terms that might get me back to this, please? -- -- Thanks, Dan Hatton
Because I have only time in the evening hours and I use the time to look at the code, I can not answer so fast. I will open a bug report at the weekend. Perhaps further results I have got are interessting for you: 1. I have found a bug in the routine lt-exp and f35p147. This bug prevents the calculation of integrals with e.g. sin(2*sqrt(a*t)). SPECINT gives the result 0. Here the output of Maxima after correction: (%i6) radcan(specint(%e^(-s*t)*sin(2*sqrt(a*t)),t)); (%o6) sqrt(%pi)*sqrt(a)*%e^-(a/s)/s^(3/2) That is perfectly the tabulated expression and SPECINT now works for a lot of other integrals too. 2. To show how we can extend the algorithm of SPECINT to calculate further integrals, I have added code to calculate integrals of the form t^-1*(%e^(-a*t)-%e^(-b*t)). The code works also for integrals like t^-1*sin(a*t). Here an example (%i4) specint(%e^(-s*t)*t^-1*sin(a*t),t); (%o4) %i*(log(s-%i*a)-log(s+%i*a))/2 That's equivalent with the tabulated answer: atan(a/s) Dieter Kaiser
First of all i want to say hello, as i am new to this mailing list,
and new to maxima.
I have defined a (programming) function, which take a mathematical
function as an argument, and should give me a new (mathematical)
function:
-8<-------------------------------------
/* the error is defined as
| df | | df |
error(f(x,y, ...)) = | -- | * delta_x + | -- | * delta_y + ...
| dx | | dy |
and is a function of all arguments to f() plus all deltas of its arguments:
df(x, y, ...., dx, dy, ...) */
error(fun, ret) :=
block(
[
dep:dependencies,
N:length(dependencies),
vars:[],
all_vars:[],
dvars:[],
num_vars,
reservoir: [d1, d2, d3, d4, d5, d6, d7, d8, d9, d10]
],
/* find out what arguments fun() takes via dependencies */
(for i:1 step 1 while i<=N
do if (part(dep[i], 0) = fun) then
(for j:1 thru length(dep[i])
do (vars: cons(part(dep[i], j), vars)))),
vars: reverse(vars),
num_vars:length(vars),
/* define delta-parameter list */
(for i:1 thru num_vars
do dvars: cons(reservoir[i], dvars)),
dvars: reverse(dvars),
/* argument list for the error function contains
all of the arguments of the original function
plus all the deltas of those arguments */
all_vars: append(vars, dvars),
ret_f: funmake(ret, all_vars),
temp_f: funmake(tempfunc, all_vars),
fun_f: funmake(fun, vars),
pt_f: funmake(pt, vars),
/* initialize ret(...) */
define(''ret_f, 0),
/* main stuff, construct error function */
(for i:1 thru num_vars
do (
define(''pt_f, ''diff(''fun_f, vars[i])),
define(''temp_f, ''ret_f), /* save current return function */
define(''ret_f, abs( ''pt_f)*dvars[i] + ''temp_f))), /* add the new partdiff */
''ret_f);
-8<------------------------------------
I hope, with the comments, you understand what i am trying to do.
It is (at least for me :) ) not a simple task, as it should work with
any function (of any argument count, with my "reservoir" it is limited
to 10 args...).
The behaviour of the code above is as follows (i have it in a file,
partdiff.max):
(%i1) batchload("partdiff.max");
(%o1) /home/pixelbrei/projects/maxima/partdiff.max
/* first definition of the function */
(%i2) v(x):=x^2;
2
(%o2) v(x) := x
(%i3) depends(v, x);
(%o3) [v(x)]
/* define a trivial example function, and inform maxima of the
dependencies */
(%i4) error(v, dv);
Improper function definition:
ret_f
#0: error(fun=v,ret=dv)
-- an error. To debug this try debugmode(true);
/* this is the error message it throws. */
(%i5) batchload("partdiff.max");
(%o5) /home/pixelbrei/projects/maxima/partdiff.max
/* i define the function a second time */
(%i6) error(v, dv);
(%o6) 2 d1 abs(x)
/* now it works */
The second definition of the function only works, if i try to execute
my "error" function between the two batchloads.
As you see, i pass the name for the function i want to build as a
second argument.
So, can anyone explain why this code behaves like it does?
And/or point me to some changes i can do to make it work the first
time?
Thanks in advance,
Christoph
All,
Could someone explain the concept of the ‘main polynomial variable’ for the Maxima function divide. I do not understand it’s purpose.
Function: divide (p_1, p_2, x_1, ..., x_n)
computes the quotient and remainder of the polynomial p_1 divided by the polynomial p_2, in a main polynomial variable, x_n…
Ron
_______________________________________________ Maxima mailing list Maxima <at> math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima
> Yeah --- Python has a lot going for it, but it lacks the code=data > principle, which Maxima inherits from Lisp, and which is the most > important feature of Lisp for Maxima. What exactly do you mean by code=data? (Python does have "lambda" and "eval".) What would be the advantage of using CLPython? > I suspect it would be > necessary to modify Python to make it a suitable user language > for Maxima, but I am hoping that we can get most of the way there > by using a Python implementation in Lisp, the sole example of > which seems to be CLPython. A port of CLPython to SBCL is in > progress; I'll give it a try when it's done.
RSS Feed20775 |
|---|