Edwin Woollett | 10 Feb 18:16
Favicon

Re: display patch, was: get name of variable as string in function?

On Feb. 6, 2012, Robert Dodier wrote:
-----------------------
>Well, OK. No need to invent a work-around, it's easier to fix the bug.
>Here is a patch. Can someone commit this? My git sandbox
>is messed up (OH WONDERS OF GIT WILL YOU NEVER CEASE)
>and I can't take the time to straighten it out right now.
[snip]

>diff --git a/src/comm.lisp b/src/comm.lisp
>index 1282784..94c3823 100644
>--- a/src/comm.lisp
>+++ b/src/comm.lisp
>@@ -753,7 +753,9 @@
>        (setq ans (list '(mequal simp) (disp2 l) ans)))
>     (if lablist (nconc lablist (cons (elabel ans) nil)))
>     (setq tim (get-internal-run-time))
>-    (displa (list '(mlable) (if lablist linelable) ans))
>+    (let ((*display-labels-p* nil))
>+      (declare (special *display-labels-p*))
>+      (displa (list '(mlable) (if lablist linelable) ans)))
>     (mterpri)
>     (timeorg tim)))

----------------------------------------
I am using the new version of comm.lisp downloaded from
git, and find a peculiar interaction with integrate
resulting in a lisp error:

------------------------------------

(Continue reading)

Edd Barrett | 7 Feb 17:38
Picon
Gravatar

"guarded" fetch from hashed array

Hi again,

I wish to use a hash table to store a mapping from a variable name to a
list of coefficients. This is accomplished easily enough in maxima,
however, is there a way of throwing an error if the key accessed is not
a key in the hash table?

Why? Because if the key does not exist, the expression is interpreted as
a symbolic expression, eg:

hash[a] : "aaa"$

So, `hash[a]` would return "aaa", but `hash[b]` is a non-existing key
and thus the expression evaluates symbolically to "hash_{b}" (subscript
b).

The question arises, "Did the hash[b] map to hash_{b} or was the key
non-existent"?

My current solution is silly:

pget(x, hash) := (
	info : arrayinfo(hash),

	/* strip non-keys */
	for i:1 thru 2 do (
		info : delete(first(info), info, 1)
	),
	if member(x, info) then hash[x] else (
		error("ERROR: Unknown variable", x),
(Continue reading)

Edd Barrett | 7 Feb 17:25
Picon
Gravatar

Checking equivilence of equalities

Hi,

First of all, I am new on this list -- thanks for your CAS system, I
use it a lot for my studies.

I have a couple of questions regarding maxima that I will ask in
separate threads to avoid confusion.

Is there a way of checking equivalence of two equalities in maxima. Eg:

a = 1 and a - 1 = 0 are equivalent.

Looking at the manual, equal() looks like a goo bet, however:
`is(equal(a=1, a-1=0)` is false.

It looks like equal() deals only with expressions and not equalities?

I could make the equalities of the form `0 = <expr>` and then perform
`equal(rhs(e), rhs(e2))` ?

Cheers

--

-- 
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk
Olive | 7 Feb 09:17
Favicon

numeric approximation

My experiment:

(%i1) f(t):=''(integrate(1/(sin(x)^2+log(x)),x,1,t));
                                 t
                                /
                                [         1
(%o1)                   f(t) := I  ---------------- dx
                                ]     2
                                /  sin (x) + log(x)
                                 1
(%i2) f(5), numer;
                             5
                            /
                            [         1
(%o2)                       I  ---------------- dx
                            ]     2
                            /  sin (x) + log(x)
                             1
It seems that (%i1) correctly define a function f(t) and maxima is
indeed able to derive it. Why (%o2) does not give a numeric
approximation of f(5)? What I have to do to get it? How can I plot f?

Olive
Robert Dodier | 6 Feb 21:17
Picon

display patch, was: get name of variable as string in function?

On 2/5/12, Edwin Woollett <woollett <at> charter.net> wrote:
> On Feb. 4, 2012, Robert Dodier wrote:
> ----------------------------------
>>> I would like to define mprint(var) such that
>>> mprint(a) would give
>>>    a  =  (value of a)
>>>
>>Isn't that exactly what display(a) does?
> ---------------------------------------------
> See bug item #3484414 and recent mailing list about display.
> You are correct that this is what display used to do, but
> with ver. 5.26.0,  (false) precedes the display output
> if display2d is set to false.

Well, OK. No need to invent a work-around, it's easier to fix the bug.
Here is a patch. Can someone commit this? My git sandbox
is messed up (OH WONDERS OF GIT WILL YOU NEVER CEASE)
and I can't take the time to straighten it out right now.

best

Robert Dodier

PS.

diff --git a/src/comm.lisp b/src/comm.lisp
index 1282784..94c3823 100644
--- a/src/comm.lisp
+++ b/src/comm.lisp
@@ -753,7 +753,9 @@
(Continue reading)

John Lapeyre | 5 Feb 18:28
Picon

experiments with maxima

Greetings, Here are some experiments that may be interesting. The
code is at:
https://sourceforge.net/projects/ribot/files/

These are the same thing:
  maxima-expt.zip
  maxima-expt.tar.gz

This is a 3.2MB data file for one function
  prime_pi_tables.lisp

1) Documentation: Modified the command-line interface to the maxima
manual to allow other documents to be displayed with ? and ??  and to
allow other systems to make queries. The documentation system is
divided into three parts: a) databases.  b) querying and organizing
component. c) front ends.  Databases are registered with the querying
component by sending a struct. The original describe command line
interface calls the querying component. Not much was done here, just
separating the code. There are four examples of
databases:

 a) the maxima info database.

 b) simple-doc. This is available immediately. (I later saw this is
    similar to L. Butler's code.)

   (%i3) simple_doc_add("new_function", "The new description.");

   (%o3) "new_function"
   (%i4) ? new_function
(Continue reading)

Alasdair McAndrew | 5 Feb 05:08
Picon
Gravatar

A series question

What is the canonical Maxima way of obtaining the series form


f(x) + hf'(x) + h^2f''(x)/2 + h^3f'''(x)/6 + ...

for f(x+h)?

Thanks,
Alasdair
--
Blog: http://amca01.wordpress.com
Web:  http://sites.google.com/site/amca01/
Facebook: http://www.facebook.com/alasdair.mcandrew
_______________________________________________
Maxima mailing list
Maxima <at> math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima
zxl | 4 Feb 16:41
Picon
Gravatar

How can I convert 5^(3/2) to 5* 5^(1/2)

hello:


I hope expand (a+b sqrt(5))^n  to the form  A+B sqrt(5), but expand ((1+sqrt(5))) give me 5^(3/2)+ 3 sqrt(5) + 16. How can I convert 5^(3/2) to 5 5^(1/2) ?

thanks 

z.x.l
_______________________________________________
Maxima mailing list
Maxima <at> math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima
Pierpaolo Garofalo | 3 Feb 12:47
Picon
Favicon
Gravatar

plot array of functions


Hi everybody in the list,
I am a new maxima user so if my question has been already answered elsewhere, please bear with me. I would be
grateful if someone could provide 

a link to some explanation...  I googled around for hours before posting here.

I am trying to plot a star of lines and for this purpose I am trying to rely on a vector of functions. So far I have
made my way to this point:

array(Y,9);

for i:0 thru 9 do block(Y[i](x):=i*x, display(Y[i]));

plot2d([Y(x)],[x,-5,5]);

plot2d: expression evaluates to non-numeric value everywhere in plotting range.
plot2d: nothing to plot.
(%o103) false

I have tried to alter in quite a few different way the Y expression in the plot2d string but with no success.

Any hint would be greatly appreciated,

Pier
Edwin Woollett | 2 Feb 22:02
Favicon

get name of variable as string in function?

I would like to define mprint(var) such that
mprint(a) would give
   a  =  (value of a)
so far I have tried:
--------------------------------

(%i1) a:2;
(%o1) 2

(%i2) mprint(zz) := print(sconcat(string(zz)," = "),zz)$

(%i3) mprint(a);
2 =  2 
(%o3) 2

(%i4) mprint(zz) := print(sconcat(string('zz)," = "),zz)$

(%i5) mprint(a);
zz =  2 
(%o5) 2
-------------------

Ted Woollett
gwpublic | 2 Feb 12:16
Picon
Favicon
Gravatar

References to papers about Maxima

Hello,

I'd like to use Maxima in my Thesis. (To be more specific: lquares method).

Could you recommend some references (papers, books) I might like reference to?

Best,
Greg (gwpl)

Gmane