1. Purpose of the experiment: Understand and master the use of MATLAB to draw solution curves in biomathematics-related equations. |
2. Experimental content For example, the state equation of the well-known Lorenz model is expressed as follows
Among them, set . If its initial value is a small constant that can be recognized on the machine, for example, choose a small positive number and try to solve it by drawing a graph. Practice (choose two) 1. The limit cycle is a common phenomenon in second-order nonlinear ordinary differential equations. For some nonlinear differential equations, no matter what the initial state is, the phase trajectory of the differential equation will be stable on a closed curve. The curve is called the limit cycle of the differential equation. Try to get the initial value and draw the differential equation
The limit cycle, and replace the plot function with the comet function, and observe the process of drawing the animated trajectory. 2. The Lotka-Volterra predation model equation is
The initial value is to draw the corresponding curve. 3. Draw two situations in Figure 3.2.5 on page 50 of "Principles of Biomathematics". 4. Draw the three diagrams on pages 54 and 55 of "Principles of Biomathematics" (verify according to the given parameters) . |
code: Example 1 f=@(t,x)[-8/3*x(1)+x(2)*x(3);-10*x(2)+10*x(3);-x(1)*x(2)+28*x(2)-x(3)]; t_final=100;x0=[0;0;1e-10]; [t,x]=ode45(f,[0,t_final],x0);plot(t,x),figure; plot3(x(:,1),x(:,2),x(:,3)); axis([1 60 -20 20 -20 25]); 练习1. f=@(t,x)[x(2)+x(1)*(1-x(1)^2-x(2)^2);-x(1)+x(2)*(1-x(1)^2-x(2)^2)]; t_final=100;x0=[0;1e-10]; [t,x]=ode45(f,[0,t_final],x0);plot(t,x),figure; plot(x(:,1),x(:,2)); axis([-1 1 -1 1]) 练习3. a=1 b=0.3 d=0.1 f=@(t,x)[x(1)*(1-x(1))-a*x(1)*x(2)/(x(1)+d);b*x(2)*(1-x(2)/x(1))] t_final=100;x0=[3,3]; [t,x]=ode45(f,[0,t_final],x0);plot(t,x),figure; plot(x(:,1),x(:,2)); axis([0 1 0 1]) clear;clc a=1 b=0.2 d=0.1 f=@(t,x)[x(1)*(1-x(1))-a*x(1)*x(2)/(x(1)+d);b*x(2)*(1-x(2)/x(1))] t_final=100;x0=[3,3]; [t,x]=ode45(f,[0,t_final],x0);plot(t,x),figure; plot(x(:,1),x(:,2)); axis([0 1 0 1]) |
例1. |
练习1.
|
练习3. a = 1 b = 0.300000000000000 d = 0.100000000000000 f = 包含以下值的 function_handle: @(t,x)[x(1)*(1-x(1))-a*x(1)*x(2)/(x(1)+d);b*x(2)*(1-x(2)/x(1))]
a = 1 b = 0.200000000000000 d = 0.100000000000000 f = 包含以下值的 function_handle: @(t,x)[x(1)*(1-x(1))-a*x(1)*x(2)/(x(1)+d);b*x(2)*(1-x(2)/x(1))] |
分析与讨论:
|