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 Facebook Adept Scientific on Twitter Adept Scientific on YouBube Adept Scientific on LinkedIn


The Next Steps

• Ask us a question
• Watch Maple Video Demonstrations
• 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 16 Overview
Maple 16 Professional
Maple 16 Academic
Maple 16 Student Use
What's New in Maple 16
Maple New Features
Datasheet

Maple History
Recorded Online Seminars

MapleSim
MapleNet
Maple T.A.
BlockImporter™
Maple Toolboxes

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] Re: System of second order nonlinear ODEs?

Search email archive for  

[MUG] Re: System of second order nonlinear ODEs?
Author: Maple Group    Posted: 21/02/2000 16:56:17 GMT
>> From: Maple Group

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

Date: Sun, 20 Feb 2000 00:29:22 -0800 (PST)
From: Robert Israel
To:
Subject: System of second order nonlinear ODEs?

Mehmet Ali Suzen wrote:

|> restart:with(DEtools):with(plots):#see help on dsolve,numeric
|> for phi in [-Pi,Pi] do
|> de1[phi] := (D@@2)(x)(t)=y(t)^2-x(t)^2, (D@@2)(y)(t)=2*x(t)*y(t){}:
|> init1 := x(0)=(cos(phi))^2, D(x)(0)=0, y(0)=(sin(phi))^2, D(y)(0)=0{}:

|> F := dsolve(de1[phi] union init1, x(t),y(t){},type=numeric): od:
|> #NULL RESULT#

No, it isn't a null result. You don't see a result because you're
ending the commands with colons rather than semicolons. But you have
actually defined F twice here, first with phi = -Pi and second with
phi = Pi. So for example:

> F(2);

d
[t = 2, y(t) = 0, -- y(t) = 0, x(t) = -.2311661300856104,
dt

d
-- x(t) = -.8215242100525825]
dt

| for specific one curve

|> restart:with(DEtools):with(plots):#see help on dsolve,numeric
|> de1 := (D@@2)(x)(t)=y(t)^2-x(t)^2, (D@@2)(y)(t)=2*x(t)*y(t){}:
|> init1 := x(0)=0, D(x)(0)=0, y(0)=1, D(y)(0)=0{}:
|> F := dsolve(de1 union init1, x(t),y(t){},type=numeric);

|> F := proc(rkf45_x) ... end


|> odeplot(F,[y(t),x(t)],-1..1);
|>#ONE CURVE but seems wrong for me????#

I don't know, it looks quite correct to me. Perhaps you meant to have
[x(t),y(t)] instead of [y(t),x(t)]? Note also that the solution
has the symmetry t -> -t, x -> x, y -> y, i.e. the path for t in [0,1]
is the same as the path for t in [-1,0], in the opposite direction.

I wonder if your differential equation is really what you want.
This one has some solutions of the form
x = 3 (t-t0)^(-2)
y = 3^(3/2) (t-t0)^(-2)
and it appears that the solution for your initial condition
approaches this one with t0 approximately 3.25.

| Q2) Are there any more efficient ways to visualize system of second
| order nonlinear ODEs as family of curves on one graphic?

If you want to see solutions with several initial conditions, you
can produce the plots separately and combine them using "display".
Thus:

> for k from 0 to 15 do
init[k]:= x(0) = cos(k*2*Pi/16), y(0) = sin(k*2*Pi/16), D(x)(0)=0,
D(y)(0) = 0{};
F[k]:= dsolve(de1 union init[k], x(t),y(t){},type=numeric);
P[k]:= odeplot(F[k],[x(t),y(t)],0..3);
od:
display(seq(P[k],k=0..15){},view=[-5..5,-5..5]);

It appears that these solutions either go off to infinity like
x = 3 (t-t0)^(-2), y = 3^(3/2) (t-t0)^(-2)
or
x = 3 (t-t0)^(-2), y = -3^(3/2) (t-t0)^(-2)
or
x = -6 (t-t0)^(-2), y = 0. Two of the solutions in this picture (k=5
and k=11) haven't done so yet, but if you follow them for a longer t
interval they will make sharp turns and go off to infinity along the
negative x axis.


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




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

Date: Mon, 21 Feb 2000 11:39:29 +0100
From: Preben Alsholm
To:
Subject: System of second order nonlinear ODEs?

The following may be what you want. I have made a few changes in your code.

restart: with(DEtools):with(plots):
> de:=(D@@2)(x)(t)=y(t)^2-x(t)^2, (D@@2)(y)(t)=2*x(t)*y(t){}:
> for k from 0 to 8 do
phi:=-Pi+k*Pi/4;
init:= x(0)=cos(phi), D(x)(0)=0, y(0)=sin(phi), D(y)(0)=0{};
F[k] := dsolve(de union init, x(t),y(t){},type=numeric) od:
> for k from 0 to 8 do
p.k:=odeplot(F[k],[x(t),y(t)],-1..1)
od:
> pc:=plot([cos(t),sin(t),t=-Pi..Pi],color=blue):
> display(seq(p.k,k=0..8),pc,axes=none,scaling=constrained);


Preben Alsholm
IFAK, Technical University of Denmark

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

Date: Mon, 21 Feb 2000 09:36:20 -0500
From: "Douglas B. Meade"
To:
Subject: System of second order nonlinear ODEs?

MUG and Mehmet,

There are a number of fundamental errors with your attempt to create a
phase portrait for the system of 2nd order ODEs listed in your original
posting.

Instead of trying to outline each problem, I will simply give the way in
which I would approach this problem (with a few comments as needed in
the code).

> restart; with(DEtools): with(plots):
# The ODE does not depend on phi; only the IC does.
> de := (D@@2)(x)(t)=y(t)^2-x(t)^2, (D@@2)(y)(t)=2*x(t)*y(t){};
> ic := phi -> x(0)=(cos(phi))^2, D(x)(0)=0, y(0)=(sin(phi))^2, D(y)(0)=0{};

# Let's define the solution as a procedure that takes phi as an argument.

> F := phi -> dsolve(de union ic(phi), x(t),y(t){},type=numeric):
# Now, to draw the one curve in your message:
> odeplot( F(0), [x(t),y(t)], 0..1 );

# Note that I have reversed x and y to produce a more typical phase portrait.
# The solution look reasonable to me -- it moves along the x-axis towards
# origin (it move beyond the origin if you extend the time interval).
# Note also that I have changed the initial time to t=0 to better illustrate
# the initial condition.

# To create an animation of solutions we first create a list of phi values:
> philist := [ Pi*i/8, $ i=-8..8 ];
# The following seq command replaces the for ... do ... od command.

> Fplot := [ seq( odeplot( F(phi), [x(t),y(t)], 0..1, phi=philist ) ]:

# An animated sequence of solution curves can be
> display( [Fplot], insequence=true );

# And, to see all plots simultaneously:
> display( [Fplot] );
# Note that there are not 17 curves; this is due to the symmetry of the
# original IVP.

I hope this has been helpful for you,

Doug
-----------------------------------------------------------------------
Douglas B. Meade Phone: (803) 777-6183 FAX: (803) 777-6527
Department of Mathematics URL: http://www.math.sc.edu/~meade/
USC, Columbia, SC 29208 E-mail:


[View Complete Thread]



Previous by date: [MUG] Re: problem with fsolve/piecewise, Maple Group
Next by date: [MUG] nonlinear programming, Roman Dawid
Previous thread: [MUG] multivariable chain rule,  Bruno Guerrieri
Next thread: [MUG] nonlinear programming, Roman Dawid



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 16 & MapleSim 5 Professional Brochure
Maple 16 Academic Datasheet
Maple 16 & MapleSim 5 Academic Brochure
Maple 16 What is New datasheet
Maple 16 Professional Datasheet
Maple Whitepaper: Driving Innovation - How mathematical modeling and optimisation increase efficiency and productivity in vehicle design.
MapleSim Whitepaper - Technological Superiority in Multi-Domain Physical Modelling and Simulation

Latest Downloads

Maple 16 Programming Guide
Maple 16 User Manual
Maple 16 Academic Datasheet
Maple 16 Professional Datasheet
Maple 16 & MapleSim 5 Academic Brochure

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

Connectivity to major CAD systems extended in Maple 16
MapleSim Breaks New Ground in Hardware-in-the-Loop real-time simulation for planetary rovers
MapleSim Breaks New Ground in Hardware-in-the-Loop real-time simulation for planetary rovers
Maths software usability reaches new heights with Maple 16
"MapleSim was an eye-opener for us.
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