MathGroup Archive 2005

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

Search the Archive

Re: Yukawa


dumb_founded wrote:
> I was using Mathematica to solve simultaneously the x and y equations
> of motion for a particle subjected to a Yukawa potential.  NDSolve
> predictably gave an interpolating function.  However, when I tried to
> plot this function, I got the error message that it is not real valued
> at certain pairs of points.  What is going on?  Can I do anything to
> remedy the situation?  
> 
> 
> Thanks.
> 

Try
{solx,soly}={x,y}/.First[NDSolve[...,{x,y},t]];

numx[t_?NumericQ]:=solx[t]; numy[t_?NumericQ]:=soly[t];
       ^^^^^^^^^                   ^^^^^^^^^
ParametricPlot[{numx[t],numy[t]},{t,t0,t1}]

-- 
Peter Pein
Berlin


  • Prev by Date: About printing a Notebook
  • Next by Date: Re: New in 5.1.1?
  • Previous by thread: Re: Yukawa
  • Next by thread: Re: Yukawa