MathGroup Archive 1997

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

Search the Archive

solving simple ODE using NDSolve

  • To: mathgroup at smc.vnet.net
  • Subject: [mg6498] solving simple ODE using NDSolve
  • From: Zahir Bishnani <z.bishnani at damtp.cam.ac.uk>
  • Date: Thu, 27 Mar 1997 02:42:33 -0500 (EST)
  • Organization: DAMTP, University of Cambridge, UK.
  • Sender: owner-wri-mathgroup at wolfram.com

I am trying to solve a scalar ODE numerically but since evaluating the
derivative involves a FindRoot operation, I get error messages.

Example:

Given the derivative function

FFunc1[y_]:= theta /. FindRoot[Cos[y*theta]==0.0, {theta,2,5}];

which is pretty much equivalent to

FFunc2[y_]:= N[ArcCos[0]/y];

Trying NDSolve as follows just spouts out errors

NDSolve[{y'[x]==FFunc1[y[x]], y[0]==1.}, {y}, {x,0,1}]

FindRoot::precw: Warning: The precision of the argument function 
	(Cos[y[x] theta] - 0.) is less than WorkingPrecision (16).
FindRoot::frnum: Function {Cos[2. y[x]]} is not a length 1 list 
	of numbers at theta = 2..
ReplaceAll::reps: {FindRoot[Cos[y[x] theta] == 0., {theta, 2, 5}]}
	is neither a list of replacement rules nor a valid dispatch
	table, and so cannot be used for replacing.

Does anyone know how I could get around this problem?

Cheers,

Zahir


  • Prev by Date: Mathematica EmPOWERment Tour
  • Next by Date: Re: trouble integrating Bessel Functions
  • Previous by thread: Re: Mathematica EmPOWERment Tour
  • Next by thread: Symbols, names, objects