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


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

Re: How to rectify the error for NDSolve ?

From Rahul Chakraborty <rahul.6sept@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: How to rectify the error for NDSolve ?
Date 2012-07-01 06:15 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jsopt4$12c$1@smc.vnet.net> (permalink)

Show all headers | View raw


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

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


Thread

Re: How to rectify the error for NDSolve ? Rahul Chakraborty <rahul.6sept@gmail.com> - 2012-07-01 06:15 +0000

csiph-web