MathGroup Archive 2008

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

Search the Archive

Re: Problem involving NDSolve

  • To: mathgroup at smc.vnet.net
  • Subject: [mg86851] Re: Problem involving NDSolve
  • From: "David Park" <djmpark at comcast.net>
  • Date: Sun, 23 Mar 2008 01:03:28 -0500 (EST)
  • References: <fs26qf$9l$1@smc.vnet.net>

I posted a solution to this problem on 12 March 08.

-- 
David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/


"Grandpa" <acloninger at wustl.edu> wrote in message 
news:fs26qf$9l$1 at smc.vnet.net...
> So here's my dilemma.  I am trying to solve a differential equation with 
> complex roots.  Mathematica is taking the incorrect root at certain points 
> when the function crosses over itself.  I generated a set of all points at 
> which this occurs.  The set is
>
> ProblemList={2.8, 5.599, 8.398}
>
> I now want to use these points in a function.  My function is
>
> ComplexRoot[t_]:= If[Abs[t - ProblemList[[1]]] > .01 && Abs[t - 
> ProblemList[[2]]] > .01 && Abs[t - ProblemList[[        3]]] > .01, 
> Evaluate[I*(2 + 1/2)(I*x[t])^(1 + 1/2)],   Evaluate[p'[t - .01]]]
>
> The goal here is to have Mathematica take the correct root for all t other 
> than the problem t values, and at those t values simply continue in the 
> direction it was heading previously.  So I want to then plug into the 
> differential equation
>
> solution=NDSolve[{x'[t] == 2p[t], x[0] == 0, p'[t]==ComplexRoot[t], p[0] 
> == 1},
> {x, p}, {t,0,10}, WorkingPrecision -> 30, MaxSteps -> Infinity][[1]];
>
> and not get an error.  Right now it gives me an error saying that I 
> haven't "literally matched the independent variables."
>
> If it works, the following graph should have two loops and look like an 
> infinity sign with one of the loops being smaller than the other.
>
> ParametricPlot[{Re[p[t]] /. solution, Im[p[t]] /. solution}, 
> Evaluate[{t,0,10}],PlotRange -> {{-2, 2}, {-2, 2}}]
>
> What can I do to fix this issue?  Any and all help is greatly appreciated.
>
> Thanks,
> Alex
> 



  • Prev by Date: Packages without packages
  • Next by Date: Mathlink: How do I pass arbitrary data from Mathematica to C?
  • Previous by thread: Problem involving NDSolve
  • Next by thread: Which function can do this?