Torsten
Posts:
1,631
Registered:
11/8/10


Re: Integration with variable limits
Posted:
Aug 16, 2013 10:26 AM


"Sanaa" wrote in message <kulb7b$qrm$1@newscl01ah.mathworks.com>... > "Torsten" wrote in message <kul93r$t5q$1@newscl01ah.mathworks.com>... > > "Sanaa" wrote in message <kul7kv$a10$1@newscl01ah.mathworks.com>... > > > > > > > > y_(n+1)=x_n; > > > > > x_(n+1)= x_n + integration (f(y_(n+1)(s))) ds. > > > > > > > > So your final aim is to solve the delay differential equation > > > > dx(t)/dt = rho*x(tr)*(1x(tr)) > > > > with x given on an interval of length r at the beginning, r and rho constant over time ? > > > > > > > > Best wishes > > > > Torsten. > > > > > > No. I don't want to solve the original delay differential equations, I wish to solve the discrete system after a certain discretization method applied to it. > > > Thanks a lot in advance. > > > > But if the discretrization method is given, you are also given how the above integral is approximated. > > Or are you _searching_ for an adequate discretization method for the delay differential equation ? > > > > Best wishes > > Torsten. > > Thanks once again for your kind reply. The discretization method here is very simple, the step methods, I am not searching for the method, i just don't know how to approximate the integral. I have read about trapz and cumtrapz but my only problem now is the variable limits of integration. Using trapz or cumptrapz don't allow me to specify the variable limits; I am really confused.
First take care that your step length divides r  otherwise you will have trouble. Say you have the delay differential equation from above dx/dt = rho*x(tr)*(1x(tr)) with x given on the interval [r,0]. Now take a step dt such that dt divides r (say n*dt=r) x(t+dt)x(t) = integral_{t'=t}^{t'=t+dt} (rho*x(t'r)*(1x(t'r)) dt') The integral can be approximated by the trapezoidal rule: integral_{t'=t}^{t'=t+dt} (rho*x(t'r)*(1x(t'r)) dt') ~ dt*(rho*x(t+dtr)*(1x(t+dtr))+rho*x(tr)*(1x(tr)))/2. Thus your recursion reads x(t+dt)=x(t)+dt/2*rho*(x(t+dtr)*(1x(t+dtr))+x(tr)*(1x(tr))) Inserting n*dt=r gives x(t+dt)=x(t)+dt/2*rho*(x(t(n1)*dt)*(1x(t(n1)*dt))+x(tn*dt)*(1x(tn*dt))) or as discrete recursion x_(k+1)=x_k+dt/2*rho*(x_(k(n1))*(1x_(k(n1)))+x_(kn)*(1x_(kn))) for k=0,1,2,... The values x((n1)),x((n2)),...,x(0) are given by the initial condition on the interval [r,0]. Does this help ?
Best wishes Torsten.

