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: problems with subs()

Search email archive for  

[MUG] Re: problems with subs()
Author: Robert Israel    Posted: Tue, 26 Nov 2002 15:55:22 -0800

>> From: Robert Israel "israel"

I don't think you included enough of your procedure to allow us to guess
what's causing your problem. The subs function works exactly the same
inside a procedure as outside. If I put your code fragment into a
procedure, that substitution will occur perfectly well.

One possibility is that your problem is related to the distinction between
global and local variables. If, say, w is a local variable of the
procedure, and z(w) is part of the code of the procedure, then the w
there is the local variable w. But if the w in L[k] comes from outside
the procedure, then that's the global variable w. Maple will not
recognize these as the same variable, even though they look the same to
us.

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

On Thu, 21 Nov 2002, Charles James Leonardo Quarra Cappiello wrote:

> Hi,
>
> Im having problems with subs(), esentially, its behaviour inside a procedure
> is different from direct execution:
>
> lets suppose i have this list:
>
> >L;
>
> [ -1/f(z(w)) , (6*f(z(w))-3*D(f)(z(w))*z(w))/f(z(w))^3 , ...(other items) ]
>
> in normal execution, i can eliminate z(w) with subs in the following way:
>
> >subs( z(w)=u , L[2] );
>
> (6*f(u)-3*D(f)(u)*u)/f(u)^3
>
> then i want to make this a function:
>
> >unapply( % , f , u);
>
> (f,u)->(6*f(u)-3*D(f)(u)*u)/f(u)^3
>
> but inside a proc im doing: (P is a function, ord is an integer)
>
> ...
> func:=0;
> for k from 1 to ord do;
> temp:=subs( z(w)=u , L[k] );
> temp:=unapply(temp ,f ,u);
> func:=unapply( apply(func,t)+apply(temp,P,0)*t^k/k! , t);
> end do;
> ...
>
> the weird thing is that when im executing this procedure, the resulting
> function 'func' keeps z(w) terms, why subs isnt working properly inside the
> procedure?
>
> Greetings,
>
> Charles Quarra
>
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>

[View Complete Thread]



Previous by date: [MUG] Re: why the plot is not consistent with evaluated value?, Maple User Group
Next by date: [MUG] Re: isqrt command, Maple User Group
Previous thread: [MUG] convolution operator,  MTK-Adem Kilicman Dr
Next thread: [MUG] isqrt command, Adalberto Ayjara Dornelles Filho



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