Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #16553

Re: animation of the PDE

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news.linkpendium.com!news.linkpendium.com!newspeer1.nac.net!newspump.sol.net!posts.news.twtelecom.net!nnrp3.twtelecom.net!not-for-mail
From Alexei Boulbitch <Alexei.Boulbitch@iee.lu>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: animation of the PDE
Date Tue, 11 Feb 2014 07:35:20 +0000 (UTC)
Sender steve@smc.vnet.net
Approved Steven M. Christensen <steve@smc.vnet.net>, Moderator
Message-ID <ldcjro$q62$1@smc.vnet.net> (permalink)
Lines 58
Organization Time-Warner Telecom
NNTP-Posting-Date 11 Feb 2014 07:40:45 GMT
NNTP-Posting-Host b48c0d47.news.twtelecom.net
X-Trace DXC=SJfb86oif8L;6T0N`<hDhFC_A=>8kQj6M;[h;PUXBgbDR?JXX0GleiNEFiONJ7[GoFTPI;`:EFW=C
X-Complaints-To abuse@twtelecom.net
Xref csiph.com comp.soft-sys.math.mathematica:16553

Show key headers only | View raw


Hola!

I was using Mathematica to visualise trajectories of x[p],y[p] depending on p.
Is it possible?

Talking about "it's simple
to animate the parametric plot of them by using ParametricPlot inside
Animate."

But I cannot animate the NDSolve using ParametricPlot.
Can you please tell me why I get errors like "NDSolve::dsvar: 1.0011952113073699` cannot be used as a variable. ":

Animate[
   ParametricPlot[
      {Evaluate[{y[p], x[p]} /. sol =
            NDSolve[...some equation type D[f1[x[p],y[p],p] = -D[x[p], p],
               f2[x[p],y[p],p] = -D[y[p], p]
                x[1] == -1, y[1] == -1}, {y[p], x[p]}, {p, 1, Tp}]]},                        
                 {p, 1, Tp}], {Tp, 1, 100}]

Thank you!

Hi, Ljuba,

Your code has nothing wrong in it except that you kept it without a precise equation. Have a look at the code below.
I have only written down a simple equation containing a focus into your code:
x'[p] == -y[p] - x[p]^3,
y'[p] == x[p] - y[p]^3

The animation appears to be rather spectacular:

Animate[
 ParametricPlot[
   Evaluate[{y[p], x[p]} /.
     NDSolve[{x'[p] == -y[p] - x[p]^3, y'[p] == x[p] - y[p]^3,
       x[1] == -1, y[1] == -1}, {y[p], x[p]}, {p, 1, Tp}]], {p, 1,
    Tp}, PlotRange -> {{-2, 2}, {-2, 2}}] /. Line -> Arrow, {Tp, 1,
  30}]

Try it. Have fun.

Alexei


Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone :  +352-2454-2566
Office fax:       +352-2454-3566
mobile phone:  +49 151 52 40 66 44

e-mail: alexei.boulbitch@iee.lu


Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: animation of the PDE Alexei Boulbitch <Alexei.Boulbitch@iee.lu> - 2014-02-11 07:35 +0000

csiph-web