Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Mathematics
General TopicsResearchOperations ResearchStatisticsMathematical LogicNumerical AnalysisUndergraduate MathAlgebra HelpRecreational Math
Math Software
MapleMathematicaMATLABScilabSASSPSS

Math Forum / Math Software / Maple / October 2008



Tip: Looking for answers? Try searching our database.

Evaluating Symbolic Terms in a  Matrix

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joel - 13 Oct 2008 18:49 GMT
Hello,

I have the sequence of commands:

A := matrix(2, 2, [a1, 0, 0, a2]);
B := matrix(2, 1, [exp(a1*t), exp(a2*t)]);
Mc := augment(B, A&*B);

The result is a matrix with terms that are a function of a1, a2, and
t.

I am, however, unable to evaluate these terms for various values of
the stated parameters.

How may I proceed to evaluate terms of the matrix Mc?

Thanks.

-Joel
Robert Israel - 13 Oct 2008 20:27 GMT
> Hello,
>
[quoted text clipped - 11 lines]
>
> How may I proceed to evaluate terms of the matrix Mc?

You could do something like this in Maple 12:

> eval(Mc,{a1=1,a2=2});

But in some older versions of Maple you'd need an extra "eval":

> eval(eval(Mc), {a1=1,a2=2});

BTW, you're using the old (and deprecated) linalg package.  It's probably
better to use the newer LinearAlgebra package.
Signature

Robert Israel              israel@math.MyUniversitysInitials.ca
Department of Mathematics        http://www.math.ubc.ca/~israel
University of British Columbia            Vancouver, BC, Canada

Joel - 13 Oct 2008 21:00 GMT
On Oct 13, 12:27 pm, Robert Israel
<isr...@math.MyUniversitysInitials.ca> wrote:
> > Hello,
>
[quoted text clipped - 26 lines]
> Department of Mathematics        http://www.math.ubc.ca/~israel
> University of British Columbia            Vancouver, BC, Canada

That did it!  Thanks!

-Joel

BTW:  I am using Maple 9.
Ray Vickson - 13 Oct 2008 22:26 GMT
> Hello,
>
[quoted text clipped - 15 lines]
>
> -Joel

In Maple 9.5 (using the old 'linalg' package) you can get it to work
using 'map':

Nc:=map(x->subs({a1=1,a2=2,t=2},x),Mc);

                           [exp(2)     exp(2) ]
                     Nc := [                  ]
                           [exp(4)    2 exp(4)]

R.G. Vickson
Joel - 20 Oct 2008 17:53 GMT
> > Hello,
>
[quoted text clipped - 26 lines]
>
> R.G. Vickson

Thank you for the reply.

I don't have much experience using Maple for linear algebra.  What are
the differences between the 'linalg' and 'LinearAlgebra" packages in
Maple?  More importantly, what are the reasons for defining a system
of equations diffently? This is to say, why would I want to define a
matrix using <<>|<>....<>> or matrix([[], [], ....[]]) or array([[],
[], ....[]]) or any of the other ways it can be done?
Ray Vickson - 22 Oct 2008 07:40 GMT
> > > Hello,
>
[quoted text clipped - 32 lines]
> the differences between the 'linalg' and 'LinearAlgebra" packages in
> Maple?

LInearAlgebra has more functionality than 'linalg', but either serves
well for many of the most common types of computations. I have found,
however, that you cannot easily mix them up; a matrix formed using
'linalg' does not seem to be recognized properly by 'LinearAlgebra'
and vice versa. To see the main differences, try loading them  both,
using with(linalg); (be sure to include the ';'), then try
with(LinearAlgebra);.

R.G. Vickson
> More importantly, what are the reasons for defining a system
> of equations diffently? This is to say, why would I want to define a
> matrix using <<>|<>....<>> or matrix([[], [], ....[]]) or array([[],
> [], ....[]]) or any of the other ways it can be done?
A. van der Meer - 22 Oct 2008 11:29 GMT
>> > > Hello,
>>
[quoted text clipped - 38 lines]
> 'linalg' does not seem to be recognized properly by 'LinearAlgebra'
> and vice versa.

Mixing is rather easy (but nearly never necessary):
If A is a "linalg"-matrix, you can transform it to a "LinearAlgebra"-matrix
by:
B := Matrix(A);
(capital M)
If A is a "LinearAlgebra"-matrix, you can transform it to a "linalg"-matrix
by
B := evalm(A);

> To see the main differences, try loading them  both,
> using with(linalg); (be sure to include the ';'), then try
[quoted text clipped - 5 lines]
>> matrix using <<>|<>....<>> or matrix([[], [], ....[]]) or array([[],
>> [], ....[]]) or any of the other ways it can be done?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.