Adept Scientific - English
The world's best software and hardware 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  
UKdedksvnofi
Home
Products
Training
Events
 Buy Online
Downloads
Academic Discounts
Support
My Adept
International |  About Us |  Adept Scientific Blog |  Contact Us |  Press Room |  Jobs
Adept Scientific on Twitter Adept Scientific on LinkedIn


The Next Steps

• Ask us a question
• Maple Product Tour
• Buy Maple Now
• View Maple Pricing
• Download a Brochure
• Request a Brochure
• Request an Evaluation
• Meet Our Team
• Read our RSS Feeds

Learn More

Maple Home
Maple 15 Professional
Maple 15 Academic
Maple 15 Student Use
What's New in Maple 15
Maple Features
Maple History
Recorded Online Seminars

MapleSim
MapleNet
Maple T.A.
BlockImporter™
Maple Toolboxes

Maple Rave Reviews
Maple Study Guides
Books about Maple
System Requirements

Maple Home
Maple 15 Professional
Maple 15 Academic
Maple 15 Student Use
What's New in Maple 15
Maple Features
Maple History
Recorded Online Seminars

MapleSim
MapleNet
Maple T.A.
BlockImporter™
Maple Toolboxes and
Connectors


Maple Rave Reviews
Maple Study Guides
Books about Maple
System Requirements

Latest Information

New Features: Professional
New Features: Academic
Maple Features
The Maple Reporter Online

Service & Support

Maple Primes
blogs, forums etc

Elite Maintenance Program
Application Centre
Powertools
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] more about implicitdiff:complexity and recursiveness

Search email archive for  

[MUG] more about implicitdiff:complexity and recursiveness
Author: Charles James Leonardo Quarra Cappiello    Posted: Thu, 21 Nov 2002 12:26:09 -0400

>> From: "Charles James Leonardo Quarra Cappiello" />
Hi,

I've noted that the time of calculation of implicitdiff( eq(z,w) , z , w$n
); grows very quick with n, since in most calculations of the n-th implicit
derivative of z respect of w, one has usually:

n n-1 n-2
d z d z d z dz
--- = f ( ----- , ----- , -- , z , w );
n n-1 n-2
dw dw dw dw

now, in a particular calculation im in need of calculating all k-th implicit
derivatives from 1 to n, but it looks like each timestep, each k=1..n-1
derivatives are recalculated, amounting to an enourmous waste. Any ideas how
could implicitdiff reuse the results of the n-1 previous implicit
derivatives to calculate the n-th one?

Greetings,

Charles Quarra




_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail


[MUG] Re: more about implicitdiff:complexity and recursiveness
Author: Preben Alsholm    Posted: Tue, 26 Nov 2002 10:38:18 +0100

>> From: Preben Alsholm />
Here are two solutions. As they are written the output is a Taylor
polynomial. The last one is by far the fastest. It makes use of
implicitdiff just once and then dsolve/series. The only problem with
that one is that dsolve/series has a bug that makes it unreliable.
The case below is not affected by that bug.

restart;
> implicittaylor1:=proc(eq::equation,L::list(name=algebraic),n::posint)
> local x,y,x0,y0,EQ,ym,k;
> x,y:=op(map(lhs,L));
> x0,y0:=op(map(rhs,L));
> EQ:=subs(y=y(x),eq);
> for k to n do
> EQ:=diff(EQ,x);
>
ym[k]:=eval(solve(EQ,diff(y(x),x$k)),{x=x0,y(x)=y0,seq(diff(y(x),x$i)=ym[i],i=1..k-1)})
> end do;
> y0+add(ym[k]*(x-x0)^k/k!,k=1..n)
> end proc:
> eq1:=x^2*y+x^3+y^4-3*y+2 = 0:
> time(implicittaylor1(eq1,[x=0,y=1],25));

30.754

> implicittaylor2:=proc(eq::equation,L::list(name=algebraic),n::posint)
local x,y,x0,y0,ODE,ym,k;
> x,y:=op(map(lhs,L));
> x0,y0:=op(map(rhs,L));
> ODE:=diff(y(x),x)=subs(y=y(x),implicitdiff(eq,y,x));
> Order:=n+1;
> convert(rhs(dsolve({ODE,y(x0)=y0},y(x),type=series)),polynom)
> end proc:
> time(implicittaylor2(eq1,[x=0,y=1],25));

1.102

The bug in dsolve/series is exhibited here:
> restart;
> Order:=2:
This is fine:
> dsolve({diff(y(x),x)=f(x,y(x)),y(x0)=y0},y(x),type=series);

2
y(x) = y0 + f(x0, y0) (x - x0) + O((x - x0) )

this is not
> dsolve({diff(y(x),x)=f(x+y(x)),y(x0)=y0},y(x),type=series);

2
y(x) = y0 + f(y0) (x - x0) + O((x - x0) )

nor is this
> dsolve({diff(y(x),x)=x*f(x+y(x)),y(x0)=y0},y(x),type=series);

2
y(x) = y0 + x0 f(y0) (x - x0) + O((x - x0) )

Preben Alsholm
Department of Mathematics
Technical University of Denmark

Charles James Leonardo Quarra Cappiello wrote:
>>>From: "Charles James Leonardo Quarra Cappiello" /> >>
>
> Hi,
>
> I've noted that the time of calculation of implicitdiff( eq(z,w) , z , w$n
> ); grows very quick with n, since in most calculations of the n-th implicit
> derivative of z respect of w, one has usually:
>
> n n-1 n-2
> d z d z d z dz
> --- = f ( ----- , ----- , -- , z , w );
> n n-1 n-2
> dw dw dw dw
>
> now, in a particular calculation im in need of calculating all k-th implicit
> derivatives from 1 to n, but it looks like each timestep, each k=1..n-1
> derivatives are recalculated, amounting to an enourmous waste. Any ideas how
> could implicitdiff reuse the results of the n-1 previous implicit
> derivatives to calculate the n-th one?
>
> Greetings,
>
> Charles Quarra
>
>
>
>
> _________________________________________________________________
> The new MSN 8: smart spam protection and 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>
>



[MUG] Re: more about implicitdiff:complexity and recursiveness
Author: Charles James Leonardo Quarra Cappiello    Posted: Thu, 28 Nov 2002 12:33:48 -0400

>> From: "Charles James Leonardo Quarra Cappiello" />
Thanks Preben,

I come out with a solution in the meantime (this mailing list is SLOOOW)

EfficientImplicitDiff:=proc( Limplicitderivatives::name , f::name ,
z::name , w::name , ord::integer )
local j,k,temp1,temp2;
Limplicitderivatives:=[
diff(z(w),w)=-1/f(z(w)) ]; for
k from 2 to ord do;
temp1:=diff( f(z(w))*diff(z(w),w) , w$(k-1) );
temp2:=isolate( temp1 , diff(z(w),w$k ) );
for j from 1 to k-1 do;

temp2:=op(1,temp2)=subs( Limplicitderivatives[k-j] , op(2,temp2) );
end do;
temp2:=op(1,temp2)=normal(op(2,temp2));
Limplicitderivatives:=[
op(op(Limplicitderivatives)) , temp2 ];
end do;
end proc;

The idea is that it uses L as a list where it puts the implicit derivatives
of z respect to w of increasing order, and f ,z ,w as names for f(z(w)). In
this examples, i assume that f(z(w))*diff(z(w),w) + 1 = 0; and i put that
assumption in the first entry of the list, but it could be generalized for
the case where the dependence on w is a function g(z(w))

Greetings,

Charles Quarra


_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus


Previous by date: [MUG] graphing parametric equations in 3d, Han Wesseling
Next by date: [MUG] Numerical error, Madham53
Previous thread: [MUG] problems with subs(),  Charles James Leonardo Quarra Cappiello
Next thread: [MUG] Numerical error, Madham53



Ready to buy?

For more pricing information:
Visit our webstore, call us on +1 800 724 8380 or email us at info@adeptscience.com

Featured Downloads

Maple 15 & MapleSim 5 Professional Brochure
Maple 15 Academic Datasheet
Maple 15 & MapleSim 5 Brochure - Academic Brochure
Maple 15 New Features data sheet
Maple 15 New Features - Flyer
Maple Whitepaper: Driving Innovation - How mathematical modeling and optimisation increase efficiency and productivity in vehicle design.
MapleSim Whitepaper: Technological Superiority in Multi-Domain Physical Modeling and Simulation

Latest Downloads

Maple Case Study: The Changing Face of Robotics
Maple Application Brief - Analyse the Path of a Liquid-Handling Robot
Maple Player for iPad - App
Maple Player for iPad - Datasheet
Case Study - Multi-Domain Modelling Critical to Unmanned Vehicle Designs

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

Latest News

NASA’s Jet Propulsion Laboratory begins widespread adoption of Maplesoft technology
NASA’s Jet Propulsion Laboratory begins widespread adoption of Maplesoft technology
Latest release marks the 10th anniversary of Maple T.A.
Maple Case Study: The Changing Face of Robotics
Maple Application Brief - Analyse the Path of a Liquid-Handling Robot
adept

Top of the Page

Popular Links: ChemDraw | ChemOffice | Data Acquisition | Data Analysis | EndNote | Maple | MapleSim | Mathcad | MathType | Quality Analyst | Reference Manager | VisSim

EU ePrivacy Directive | Our Privacy and Terms and Conditions Statement
All Trademarks Recognised. Copyright © 2012, Adept Scientific plc.
Site designed and maintained by Lyndon Ash

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