Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to rectify the error for NDSolve ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg127128] Re: How to rectify the error for NDSolve ?
  • From: Rahul Chakraborty <rahul.6sept at gmail.com>
  • Date: Sun, 1 Jul 2012 02:11:59 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

Here is my code:


 clear[x, t, \[Tau], Q, Subscript[V, p], Subscript[V, 
  1], \[CapitalGamma], \[Phi]];
Q = 100;
\[CapitalGamma] = 50;
Subscript[\[Omega], 0] = 10;
Subscript[V, p] = 0.5;
Subscript[C, 0] = 4.06 * 10^-4;
t = 5;
\[Tau] = Subscript[\[Omega], 0] t;
\[Phi] = 90;
Subscript[V, 1] = Subscript[C, 0]*Subscript[V, p];
eqn = x'' (\[Tau]) + 
    1/Q x' (\[Tau]) + (1 + 
       Subscript[V, 1] Sqrt[2]
         Sin[2 \[Tau]]) x == \[CapitalGamma] (sin[\[Tau] + \[Phi]]);
sol = NDSolve[{eqn, x[0] == 0.5, x'[0] == 0}, x, {t, 0, 250}, 
   MaxSteps -> 500000, WorkingPrecision -> 25][[1]]
ParametricPlot[Evaluate[{x[t], x'[t]} /. sol], {t, 0, 100}, 
 Frame -> True, PlotRange -> All, 
 AxesLabel -> {"t", "\!\(\*OverscriptBox[\(\[Theta]\), \(.\)]\)"}]


 Output i'm getting is as below:

  NDSolve::dsvar: 5 cannot be used as a variable. >>


  {0.999855 x + Derivative[1][x]/2 + 50 x^\[Prime]\[Prime] == 
  50 sin[140], x[0] == 0.5, Derivative[1][x][0] == 0}


 ReplaceAll::reps: {0.999855 x+x^\[Prime]/2+50 x^\[Prime]\[Prime]==50 sin[140],x[0]==0.5,(x^\[Prime])[0]==0} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing. >>


 ReplaceAll::reps: {0.999855 x+0.5 x^\[Prime]+50. x^\[Prime]\[Prime]==50. sin[140.],x[0.]==0.5,(x^\[Prime])[0.]==0.} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing. >>

 ReplaceAll::reps: {0.999855 x+0.5 x^\[Prime]+50. x^\[Prime]\[Prime]==50. sin[140.],x[0.]==0.5,(x^\[Prime])[0.]==0.} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing. >>

 General::stop: Further output of ReplaceAll::reps will be suppressed during this calculation. >>

 
 Regards,

 rahul



  • Prev by Date: Re: Approximate Zero Times A Symbol
  • Next by Date: Re: Book
  • Previous by thread: Re: How to rectify the error for NDSolve ?
  • Next by thread: Re: How to rectify the error for NDSolve ?