Presentation is loading. Please wait.

Presentation is loading. Please wait.

Continous system: differential equations Deterministic models derivatives instead of n(t+1)-n(t)

Similar presentations


Presentation on theme: "Continous system: differential equations Deterministic models derivatives instead of n(t+1)-n(t)"— Presentation transcript:

1 Continous system: differential equations Deterministic models derivatives instead of n(t+1)-n(t)

2 Determine the equation n Decide what have an effect on the system n Determine whether the parameters are positive or negative, i. e. give growth or reduction n Determine whether the parameter is linear or nonlinear in relation to your entity (often population density or amount of a compound) Population x rx growth Population x bx birth -dx deaths i immigration

3 Determine the equation n What act on the system, entity: sign, constant or linear/nonlinear relation: rx is positive, linear n What act on the system, entity: sign, constant or linear/nonlinear relation: bx, positive, linear dx, negative, linear i, positive, constant Population x rx tillväxt Population x bx birth -dx deaths i immigration

4 differential equations, part 1 n Linear differential equations n Separable equations n System of linear differential equationer chap 5.1-2 n Using numerical methods chap 5.4

5 What is differential equations? n Derivatives in an equation, i e both y and y’ in the very same equation n Example: Both concentration and change of concentration n To solve this one how to maken some kind of integration, that is make y’ to y. n Note: most of the differential equations is not possible to solve analytically, one is referred to numerical solutions

6 Separable equations n Separate variables to respective right and left handside RHS resp LHS n Thereafter integrate each side:

7 Solution, general

8 Solution, general and particular Has the general solution: If we know that, for example, x(0)=4 then we can find C’ i e the particular solutionen

9 Separable equations, summarizing n Separate variables to RHS resp LHS n Integrate each side

10 Interprete differential equation n How will the solution, solution function, look like? n When the derivative is u negative the function decrease u positive the function increase u zero the function is constant, at equilibrium n study

11 Linear differential equation: integrating factor n Linear regarding n(t), (regarding the solution function we try to determine) n These linear equations can hence be written as: The Integrating factor is used to solve these kind of equations. Integrating factor:

12 solution by integrating factor integrating factor: Ifexists (solvable) you can determine a solution for n(t)

13 Example: integrating factor integrating factor: Example: solution:

14 Maple: program that finds analytical solutions int(exp((1/3)*(t^3))*(2*t^2),t); Uses the same tehnique as us, that is a database. But its in the computer instead of in our heads.

15 Example: integrating factor integrating factor: Example: solution: Partial integration: derivating one term, integrating the other

16 Example: integrating factor Example: general solution: int(exp(t)*(0.2*t-0.3),t);Maple: n(0)=0.1 och 0.1=-0.3+C C=0.4 Particular solution:

17 Homogenous linear differential equation with constant coefficients n Same kind of problem as in linear recursive equations, chapter 1. n Find the eigenvalues. Or rather the roots of a polynom. Example:Both the first and second derivative in the eq.

18 Eigenvalues and the character of the solution n Solution is achieved by assuming that the solutions is: n Put in the equation and determine

19 Eigenvalues and the character of the solution This is a polynom, find the roots! Example: Initial values: x(0)=2, x’(1)=3

20 Eigenvalues and the character of the solution Particular solution: Initial values: x(0)=2, x’(1)=3 For large t If Im( )=0 Re( )>0, exponential growth Re( )<0, exponential decrease Re( )=0, constant If Im( )  0 Re( )>0, increasing oscillations Re( )<0, decreasing oscillations Re( )=0, oscillation solution character

21 System of first order homogenous linjear differential equations with constant coefficients n Couple a set of linear equations, for example two or more populations or ageclasses or. The populations have effect on each others growth, a linear effect. n Almost like ageclasses but the solutions is of e t instead of R t

22 Eigenvalues and character of the solution Determine eigenvalues, 1 and 2 as well as eigenvectors, v 1 and v 2 You must have an initial value (x,y) to calculate C 1 och C 2

23 Eigenvalues and the character of the solution Calculate eigenvalues, 1 and 2 If the dominating eigenvalueis positive both x and y increase regardless of initial value The eqilibrium, which is (0,0), is then a source If both eigenvalues are negative both x and y decrease regardless of initial value. The equlibrium, (0,0), is then a sink See page 260 for further definition to make from the eigenvalues (if complex etc)

24 The character of the solution Generallly: for linear systems all variables either increase or decrease exponentially except in few exceptionally cases. Hence, a model that deals with a system that is robust and stable ought to be expressed as a nonlinear system

25 Most equations can be approximated with linear functions over a short interval n equations that are possible to derivate, that is continous over an interval, can be approximated with a Taylor expansion. Using the derivatives n The first tem of the Taylor expansion is a linear term and hence it possible to approximate n The interval is smaller the larger derivative

26 numerical solutions n Most differential equations is not possible to solve analytically. n One have to solve it by numerical methods n Euler method is a way to make a diff ekv to a difference equation with appropriate step-length n With more refined methods, like Runge Kutta, uses a set of derivatives at each point. In this way the direction of the solution is improved for each step,

27 Matlab: numerical solutions n [t,y] =ode45(’function',timeinterval,initialvalues); Create a m-fil rigid.m function dy = rigid(t,y) dy = zeros(3,1); % a column vector dy(1) = y(2) * y(3); dy(2) = -y(1) * y(3); dy(3) = -0.51 * y(1) * y(2); Solve the equation on the interval 0-12 n [t,y] = ode45('rigid',[0 12],[0 1 1])

28 Matlab: numerical solutions n [t,y] = ode45('rigid',[0 12],[0 1 1]) n plot(t,y(:,1),'-',t,y(:,2),'-.',t,y(:,3),'.') n Remake rigid.m and test different equations n Some kinds of diff equations, so called stiff equations, should be solved by ode15s(…) n stiff diff equations


Download ppt "Continous system: differential equations Deterministic models derivatives instead of n(t+1)-n(t)"

Similar presentations


Ads by Google