1 May 04:43 2006

### Re: Maxima for numerical methods (v. Scilab)?

On Sun, Apr 30, 2006 at 08:33:17AM +1000, Alasdair McAndrew wrote:

> I'd be happy if I
> could produce something similar-ish to that, but based on free software.
> Anyone interested in being a co-author?

You tempt me sorely. I have been through both a degree in Mathematics
with an emphasis on numerical and computational topics, as well as a
degree in Civil Engineering, where I was appalled at the lack of
integration of computer methods. In general the students in the CE
program found computers to be essentially a big hammer that they could
pound nails with (primarily via Excel).

I think a CAS like maxima would be a very valuable tool to let
students explore the analytical side of numerical methods without
having to spend terrible amounts of time keeping track of
equations. Combining it with R for statistics, and Octave or SciLab
for numerical linear algebra, root finding, and soforth would give a
very valuable foundation from which students could explore topics in
their major field using computational tools.

I would love to work on a project that integrated these ideas, and at
the same time became a sort of tutorial on Maxima. As always, time is
limited, but I could devote two or three hours a week. I would like to
see such a thing be online, with hypertext links to help students see
the relationships between various topics.

I would be happy to hear suggestions of how such a book project could
be organized, and how best to present it to the student. At first a
wiki seems attractive but I suspect that it would be better to


1 May 07:27 2006

### Re: Maxima for numerical methods (v. Scilab)?

Hi all,

Richard Fateman wrote:

>
> ----- Original Message ----- From: "Nicolas Pettiaux"
> <nicolas.pettiaux <at> ael.be>
> To: "Alasdair McAndrew" <amca01 <at> gmail.com>
> Cc: "maxima list" <maxima <at> math.utexas.edu>
> Sent: Saturday, April 29, 2006 9:36 AM
> Subject: Re: [Maxima] Maxima for numerical methods (v. Scilab)?
>
>
>> 2006/4/29, Alasdair McAndrew <amca01 <at> gmail.com>:
>>
>>> It seems I may be teaching an elementary subject in numerical
>>> computation
>>> next semester.  The usual sorts of things: error analysis, solution of
>>> equations, interpolation, eigenvalues and eigenvectors, quadrature,
>>> differential equations.  I want to base the subject around free
>>> software, so
>>> the students can use it at home.
>>
>
> This doesn't seem like a very good argument -- there are student
> software that are less expensive than textbooks, and you seem to
> be expecting students to have relatively expensive computers at home.



1 May 07:11 2006

### Re: Maxima for numerical methods (v. Scilab)?

Hi all,

Just one pair of small ideas :),

Daniel Lakeland wrote:

>On Sun, Apr 30, 2006 at 08:33:17AM +1000, Alasdair McAndrew wrote:
>
>
>
>>I'd be happy if I
>>could produce something similar-ish to that, but based on free software.
>>Anyone interested in being a co-author?
>>
>>
>
>You tempt me sorely. I have been through both a degree in Mathematics
>with an emphasis on numerical and computational topics, as well as a
>degree in Civil Engineering, where I was appalled at the lack of
>integration of computer methods. In general the students in the CE
>program found computers to be essentially a big hammer that they could
>pound nails with (primarily via Excel).
>
>I think a CAS like maxima would be a very valuable tool to let
>students explore the analytical side of numerical methods without
>having to spend terrible amounts of time keeping track of
>equations. Combining it with R for statistics, and Octave or SciLab
>for numerical linear algebra, root finding, and soforth would give a
>very valuable foundation from which students could explore topics in
>their major field using computational tools.


1 May 15:05 2006

### Re: Determining if n is of the form m^k?

>>>>> "Stavros" == Stavros Macrakis <macrakis <at> gmail.com> writes:

>> I think it would be nice if 6*2^k became 3*2^(k+1), but that would
>> require factoring 6 (easy).  In general, factoring would be hard, and
>> perhaps not worth the effort.

Stavros> Note that you don't need to factor 6, only gcd(6,2).  To handle the case

Stavros>      54*3^n, you do

Stavros> gcd(54,3)=3 so => (54/3) * 3^(n+1) = 18*3^(n+1)
Stavros> gcd(18,3)=3 so => (18/3) * 3^(n+2) ... etc.

Yes, this is probably something that the times simplifier should do.

>> Maybe a separate function could be made available to try much harder
>> to simplify these numerical products.

Stavros> Yes, I think general simplification should not handle

Stavros>     3^n*6^n = 2^n*3^(2*n)
Stavros>     6^n*15^m = 2^n*3^(n+m)*5^m
Stavros>     3^n*9^m = 3^(n+2*m)

I agree.  Although it would be nice if we could do this.  I think some
of the limit bugs happen because maxima thinks 4^n grows much faster
than 2^(2*n).  (Or vice versa.  I can't remember.)

Ray


1 May 15:50 2006

### applying function identities (proposal)


Maxima doesn't have a uniform method for applying function
identities. Some identities are controlled by switches
(for example, triginverses), while others have not-so-easy
to remember (or guess) names (such as makegamma).

Neither of these methods allow for a user to apply an
identity in a controlled fashion. You could define a defrule
for f(x) --> 2 * f(1-x), provided x > 1, but you'd need to
build another (similar) rule if you later needed to do
f(x) --> 2 * f(1-x), provided imagpart(x) > 1.

It seems to me that there should be a database of function
identities that could be searched and extended. The database
would have names for collections of identities -- say all
identities that convert something to the gamma function or
all that identities that convert to a 1F1 function.

There would be a function, say 'applyident' that works
something like this fake session:

(%i1) applyident(pochhammer_reflect, 42 + pochhammer(-x,n));
(%o1) 42 + pochhammer((-1)^n * pochhammer(x-n+1,n))

An optional predicate would determine whether to apply
the identity. For example, to apply the identity only
if the negation of the first argument to pochhammer is
a mapatom, use

(%i1) applyident(pochhammer_reflect, pochhammer(x,n) * pochhammer(-x,n),


1 May 16:32 2006

### Re: applying function identities (proposal)

look at Maple;  there is a function called  convert  with umpteen flags,
some of which are  like
the ones you suggest.

I find the design to be unintuitive. But maybe that's inevitable.

If you define rulesets, like rules1: {pochr1,pochr2, ...}

and then   applyruleset (expression, rules1),  then maybe you have
the same situation.  applyruleset could be a trivial modification of
apply1 or apply2.

RJF

----- Original Message -----
From: "Barton Willis" <willisb <at> unk.edu>
To: <maxima <at> math.utexas.edu>
Sent: Monday, May 01, 2006 6:50 AM
Subject: [Maxima] applying function identities (proposal)

1 May 15:06 2006

### Matrix multiplication expansion

Dear All,
my question is probably naive but I am just starting with Maxima and I
have not been able to found a solution to my problem. I use Maxima
5.9.2. Notice, that I didn't observe the behaviour I mention (in the
following) with the previous version of Maxima (5.9.1).

I use Maxima for Linear Algebra and performing matrix multiplication, I
cannot obtain the result of the product as a single matrix whom the
elements are evaluated.

As a simple example :

(%i1) A1:Matrix([a,b,c],[d,e,f],[g,h,i]);

(%o1)               Matrix([a, b, c], [d, e, f], [g, h, i])

(%i2) A2:Matrix([j,k,l],[m,n,o],[p,q,r]);

(%o2)               Matrix([j, k, l], [m, n, o], [p, q, r])

(%i3) A1.A2;

(%o3) Matrix([a, b, c], [d, e, f], [g, h, i])

. Matrix([j, k, l], [m, n, o], [p, q, r])

(%i4) expand(%);

(%o4) Matrix([a, b, c], [d, e, f], [g, h, i])



1 May 20:19 2006

### Re: applying function identities (proposal)

Hi Barton,

> Maxima doesn't have a uniform method for applying function
> identities. Some identities are controlled by switches
> (for example, triginverses), while others have not-so-easy
> to remember (or guess) names (such as makegamma).

I agree that we can probably make the means of applying
built-in rules more consistent. Of the various mechanisms
you mentioned, I'm not sure what's preferable.

> It seems to me that there should be a database of function
> identities that could be searched and extended. The database
> would have names for collections of identities -- say all
> identities that convert something to the gamma function or
> all that identities that convert to a 1F1 function.

Well, the database might be something as simple as a list ....

> There would be a function, say 'applyident' that works
> something like this fake session:
>
> (%i1) applyident(pochhammer_reflect, 42 + pochhammer(-x,n));
> (%o1) 42 + pochhammer((-1)^n * pochhammer(x-n+1,n))

Isn't that just what apply1 attempts to do?

I guess apply1 at present doesn't know what to do with a list of rules.
But apply1 (expr, my_list) could just be apply (apply1, cons (expr, my_list))
or something like that.


1 May 20:22 2006

### Re: applying function identities (proposal)

On 5/1/06, Richard Fateman <fateman <at> cs.berkeley.edu> wrote:

> look at Maple;  there is a function called  convert  with umpteen flags,
> some of which are  like the ones you suggest.
>
> I find the design to be unintuitive. But maybe that's inevitable.

It's not inevitable. It's a mess, and we should avoid it.

> If you define rulesets, like rules1: {pochr1,pochr2, ...}
>
> and then   applyruleset (expression, rules1),  then maybe you have
> the same situation.  applyruleset could be a trivial modification of
> apply1 or apply2.

Agreed, except that since the ordering of rules makes a difference,
rules should be kept in a list instead of a set.

best,
Robert

1 May 20:32 2006

### Re: Matrix multiplication expansion

Hello Frédéric,

> (%i1) A1:Matrix([a,b,c],[d,e,f],[g,h,i]);
>
> (%o1)               Matrix([a, b, c], [d, e, f], [g, h, i])

Maxima is now (since 5.9.2) case sensitive.
That is, Matrix, MATRIX, and matrix are all different symbols.
You want matrix (minuscule letters) here.

Hope this helps,
Robert Dodier


Gmane