1 / 8

Ordinary differential equations 1

Ordinary differential equations 1. Single variable systems. Simplest ODE (linear, single variable) is the model for exponential decay :

nieve
Download Presentation

Ordinary differential equations 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Ordinary differential equations 1

  2. Single variable systems Simplest ODE (linear, single variable) is the model for exponential decay: which has an analytical solution x(t) = Ce−kt where C is a constant representing the value of x(0). However, we will be concerned here primarily with numerical solutions using Matlab functions for solving ODEs numerically.

  3. Euler’s method The simplest numerical method is Euler’s method which is highly intuitive. Here we want to approximate the solution of the initial value problem: where Δ is some small constant. This can be implemented in exactly the same way as a discrete dynamical system.

  4. Biochemical reaction networks In biochemical reaction networks, the basic elements are: • The compounds with their concentrations or activities and • The reactions or transport processes changing the concentrations or activities of the compounds. Consider the following simple dimerization reaction in which x1 is monomer and x2 is an x1-x1 homodimer:

  5. Biochemical reaction networks This system can be written as a system of differential equations as follows: To use more sophisticated numerical methods (with lower cumulative error) for solving ODEs in Matlab than the Euler method, we need to implement a callback function which is then passed to the integrating function.

  6. Runge-Kutta method An example of a better numerical method is the Runge-Kutta method. Let an initial value problem be specified as follows. The RK4 method for this problem is given by the following equations:

  7. ODEs and callback functions function singleDimer x0= [100 0]’; t = (0:0.01:2)’; x_out = lsode(@xdot, x0, t); plot(t,x_out); function d= xdot(x,t) p=0.1; m=0.05; f(1)=0.5*p*x(1)*x(1); f(2)=m*x(2); d(1,1)= +(-2)*f(1) +2*f(2); d(2,1)= +f(1) -f(2); return This is a function handle to the xdot function lsode() is an octave function. Matlab users should use functions such as ode45() This is the implementation of the callback function

  8. Exercises • Solve the system dx/dt = -kx with k= 0.067 with x(0) = 8000 and for t=0 → 50. Use Euler’s method, then use the callback method with lsode or ode45 and compare the results on a plot. • Solve the following linear ODE system using matrix multiplication in the callback function: dx1/dt = -4x1 + 2x2 dx2/dt = -2x2 x1(0) = -3, x2(0)=15

More Related