0

I have a system of differential equations. I solve it with numerical dsolve:

sol := dsolve({First, Fourth, Second, Third, iA(0) = 0, iB(0) = 0, theta(0) = 0, (D(theta))(0) = 0}, numeric, vars,maxfun=100000):

First, Second, Third, Fourth --- are differential equations, then there are initail conditions, vars --- is a set of variables (in respect of time) I want to get. maxfun - is maximum number of evaluations made by dsolve to calculate derivatives.

So, I need to retrieve maximum time value, where vars are calculated. I tried setting range parameter but it takes too long to solve (and I need to call dsolve for a hundred or even more times). With maxfun=1e5 I get result in three or four seconds.

Any tricks can be done here? Maybe there is a way to set timestep between evaluations of derivatives?

Thanks in advance and sorry for my broken English.

Sergey Kanaev
  • 570
  • 5
  • 18
  • Are you trying to discover an evaluation count, or some `t` value, or how long it takes your computer, or something else? I find the question very unclear, as posed. – acer Jun 01 '13 at 17:10
  • @acer, sorry if it sounds unclearly. I want to get maximum `t` value for which I can get solutions after dsolve with some given maxfun value (or example 100000). – Sergey Kanaev Jun 01 '13 at 17:25
  • Sergy, Is t the independent variable in your system of equations? Then I think that you may be able to do something with the 'event' option of dsolve. – Carl Love Jun 04 '13 at 00:43
  • There is also the 'event_maxiter' option. See ?dsolve,numeric,IVP – Carl Love Jun 04 '13 at 00:52
  • And by "timestep" do you mean the stepsize of the independent variable? You can control that with the 'minstep', 'maxstep', and 'initstep' options. See the same help page. – Carl Love Jun 04 '13 at 00:54

0 Answers0