Adept Scientific - English
The world's best software for research, science and engineering.
flag arrow
clearclear
 

 Adept Store | register Join My Adept | Flags  
Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055  
UKusdedksvnofi
Home
Products
Training
Consultancy
 Buy Online
Downloads
Education
Support
My Adept
International |  About Us |  Contact Us |  Press Room |  Jobs


The Next Steps

• Ask us a question
• Maple Product Tour
• Buy Maple Now
• View Maple Pricing
• Find out about Online Training
• Download a Brochure
• Request a Brochure
• Download a Demo
• Request a Demo
• Meet Our Team
• Read our RSS Feeds

Learn More

Maple Home
Maple 11 Professional
Maple 11 Academic
Maple 11 Student Use
Recorded Online Seminars
FREE Training Resources


MapleNet
Maple T.A.
MapleConnect
BlockImporter for Simulink
BlockBuilder for Simulink
Maple Toolboxes
Maple Rave Reviews
Maple Study Guides
Books about Maple
System Requirements

View Maple 10 in Action
Product Comparison Chart

Latest Information

New Features: Professional
New Features: Academic
The Maple Reporter
The Maple Reporter Online
Numerical Algorithms Group
(NAG)


Service & Support

Maple 10 Training Videos
MaplePrimes, blogs, forums
Elite Maintenance Program
Application Centre
Powertools
Maple User Group (MUG)
Join the Maple User Group
(MUG)

Search the Knowledge Base
Technical Support request

List Archives >  Maple User Group List Archive >  Archive by date >  This Month By Date >  This Month By Topic

[MUG] Re: evalm and mapping of function

Search email archive for  

[MUG] Re: evalm and mapping of function
Author: Maple User Group    Posted: Wed, 5 Jun 2002 14:16:12 -0400 (

>> From: Maple User Group "maple_gr"

> >> From: Guy Gendron "ggendron"
> I dont understand why Maple cannot map the "fcncarre" function onto the
> elements of the matrix "mat_a". I am trying to use evalm to square each
> element of the input matrix.
>
> > evalm(fcncarre(mat_a));#I want evalm to map the fonction onto each elem.
> of mat_a
> Error, (in linalg[multiply]) non matching dimensions for vector/matrix product

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Fri, 31 May 2002 17:25:33 +0200
From: Adri van der Meer "A.W.J.vanderMeer"
To: "maple-list"
Subject: evalm and mapping of function


You use the right word: "map":

> map( fcncarre, evalm(mat_a) );


--
A. van der Meer
Dept. Applied Mathematics
University of Twente Phone +31 (53) 4893427
P.O. Box 217 Fax +31 (53) 4894824
7500 AE Enschede




-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Fri, 31 May 2002 09:23:32 -0700
To: "maple-list"
From: David Harrington "dharr"
Subject: evalm and mapping of function

try
> map(fcncarre,eval(a));
or
> map(fcncarre,evalm(a));



-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Fri, 31 May 2002 12:09:46 -0400 (EDT)
From: Denis Sevee "dsevee"
To: "maple-list" "maple-list"
Subject: evalm and mapping of function

You should use
>map(fcncarre, mat_a);

This is how, in general, you should apply any function to the entries of
a matrix.

Denis Sevee




-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

From: Douglas Wilhelm Harder "douglas"
Subject: evalm and mapping of function
To: "maple-list"
Date: Fri, 31 May 2002 13:46:58 -0400 (EDT)

Your function immediately returns something:

> fcncarre:=x->x*x; # I define a new function
2
fcncarre := x -> x
> mat_a := matrix( [[1,2,3],[4,5,6]] ):
> fcncarre( mat_a );
2
mat_a

unlike sin:
> sin( mat_a );
sin(mat_a)

and you cannot square a non-square matrix. Try:

> map( fcncarre, mat_a );
[ 1 4 9]
[ ]
[16 25 36]

Cheers,

Douglas
--
Douglas Wilhelm Harder ||\_ _\ /_/\_ _/\_\ /_ _/|| MM BSc MCpl (Retd)
University of Waterloo ||\ _\ /_/\_\ /_ _/
Waterloo Fractal Compression Project _\ / _/||
"douglas" _/\_\||\_ _/ /_/\_
http://links.uwaterloo.ca/~douglas _/||\_ _/ /_/\


-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Sun, 2 Jun 2002 11:43:09 -0700 (PDT)
From: Robert Israel "israel"
To: "maple-list"
Subject: evalm and mapping of function

If you told it to map, it would map.

> map(fcncarre, mat_a);

If you say fcncarre(mat_a), you are telling Maple to square the matrix.
And since this is a 2 x 3 matrix, that is impossible.

The real question is, why does sin map into the matrix. In my opinion,
that is a bug. A function of a matrix should be defined using the
functional calculus, so that
sin(M) = (exponential(I*M)-exponential(-I*M))/(2*I). Of course this would
only be defined for square matrices.

Robert Israel "israel"
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Sun, 2 Jun 2002 19:42:41 -0400 (EDT)
From: Alain Goupil "goupil"
To: "maple-list"
Subject: evalm and mapping of function


Dear mr Gendron, The command map is the standard command to map a
function on the elements of a matrix as in the following :

> mat_a:=matrix([[1,2,3],[4,5,6]]):
>fcncarre:=x->x*x:
> map(fcncarre,mat_a);

matrix([[1, 4, 9], [16, 25, 36]])

Best regards,

Alain Goupil,
On Thu, 30 May 2002, Guy Gendron wrote:

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Tue, 4 Jun 2002 09:46:57 -0400 (EDT)
From: Carl Devore "devore"
To: "maple-list"
Subject: evalm and mapping of function

map(fcncarre, mat_a);

[View Complete Thread]



Previous by date: [MUG] 4 examples - an explanation?, Vladimir Bondarenko
Next by date: [MUG] LTP - Package for Lie Algebraic Computations,  M Torres-Torriti
Previous thread: [MUG] minimizing functions - question, Alexander Serebrenik
Next thread: [MUG] LTP - Package for Lie Algebraic Computations,  M Torres-Torriti



Ready to buy?

Maple - single user licence
Add to shopping basket
$ 1,895.00
Upgrade to Maple 12 from v11
Add to shopping basket
$ 995.00
Upgrade to Maple 12 from v10 & below
Add to shopping basket
$ 1,395.00

Featured Downloads

Maple White Paper: Technical Knowledge - An Asset You Can Afford to Lose?
Maple in Electronics Application Pack
Maple in Robotics & Aerospace Application Pack
Maple in Finance Application Pack

Product Reviews

"Without the Maple software, we would have to spend weeks generating the equations of motion for every experiment. Then the chances that we did it right would basically be near zero. There would always be a mistake somewhere. It is very difficult to set up a dynamic motion model by hand."
- Jean-Claude PiedBeouf, Ph.D Manager of Robotics, Canadian Space Agency

"Its very good - highly accurate and easy to use. The speed of Maple allows me to change equations and quickly reintegrate them into the application, so more possibilities can be explored to achieve the precise effect desired."
Shawn Neely, Senior R & D Director for PDI/Dreamworks
adept

Top of the Page

Our Privacy and Terms and Conditions Statement
All Trademarks Recognised. Copyright © 2007, Adept Scientific plc.
Site designed and maintained by Adeptise

Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055