Diferencia entre revisiones de «Logistic equation»
De MateWiki
| Línea 43: | Línea 43: | ||
| [[Archivo:solucion.jpg|thumb|500px|left|Numerical approximation of the solution]] || [[Archivo:error.jpg|thumb|500px|left|Error = abs( exact solution - numerical approximation) |500px]] | | [[Archivo:solucion.jpg|thumb|500px|left|Numerical approximation of the solution]] || [[Archivo:error.jpg|thumb|500px|left|Error = abs( exact solution - numerical approximation) |500px]] | ||
|} | |} | ||
| + | --[[Usuario:Carlos Castro|Carlos Castro]] ([[Usuario discusión:Carlos Castro|discusión]]) 15:09 31 ene 2013 (CET) | ||
Revisión del 16:09 31 ene 2013
Este artículo explica la resolución de la Ecuación logística por el método de Euler.
1 Logistic equation
Logistic equation is used to simulate a number of applications. It was first introduced by P.F. Verhulst to simulate population growth. It reads,
[math]y' = y\cdot (1-y), \quad t\in(t_0,\infty) [/math]
[math]y(t_0) = y_0[/math]
Here, t is the time, [math]y(t)[/math] represents the population size and [math]y_0[/math] the population size at initial time [math]t=t_0[/math].
2 Numerical scheme
We propose an Euler explicit method with time step h,
[math] y_0 = 1/10[/math]
[math]y_{n+1} = y_{n} + h\cdot y_{n}\cdot(1 - y_{n})[/math]
3 MATLAB code
% Euler method to solve the logistic equation y'=y(1-y)
clear all;
t0=0; tN=4; % initial and final time
y0=1/10; % value of y at time t=0
N=40; % Number of intervals
h=(tN-t0)/40; % Time step h
yy=y0; % yy -> variable with the solution at each time step
y(1)=yy; % y -> vector where we store the solution
for n=1:N-1
yy=yy+h*yy*(1-yy); % numerical scheme
y(n+1)=yy; % store the solution
end
x=t0:h:tN; % Draw the solution
plot(x,y,'x');
4 Results
--Carlos Castro (discusión) 15:09 31 ene 2013 (CET)