HUYNH
Posts:
1
Registered:
3/12/08
|
|
Driven van der Pol oscillator (n = 2)
Posted:
Mar 12, 2008 10:11 AM
|
|
How can I solve 2 equations :
dz1/dt = z2 dz2/dt = 5*(1-z1^2)*z2-z1+5*cos(2.47*t)
I can't find any example to solve differential equations with expression of t ( par example +5*cos(2.47*t) ). My problem is similar with this Driven van der Pol oscillator (n=2).
------------------------------------------------------------
My problems is 3 differential equations :
Dy1*c1=k01*(yext-y1)+k12*(y2-y1) Dy2*c2=k12*(y1-y2)+k23*(y3-y2) Dy3*c3=k03*(yext-y3)+k23*(y2-y3)
with y1(0)=300,y2(0)=300,y3(0)=300 k01=10, k12=11, k23=12, k30=13 yext=300*sin(2*pi*f*t) f=1/24
-----------------------------------------------------------
My m-file for the function is :
function [t,y] = m(k01,k12,k23,k30,c1,c2,c3,yext) tspan = [0 200]; y0 = [0; 3]; [t,y] = ode15s(@v,tspan,y0);
function dydt = v(t,y) dydt = [ (k01*(yext-y(1))+k12*(y(2)-y(1)))/c1; (k12*(y(1)-y(2))+k23*(y(3)-y(2)))/c2; (k23*(y(2)-y(3))+k30*(yext-y(3)))/c3 ] end
end
-----------------------------------------------------------
My run m-file is :
clear all; clc;
% les coefficients c1=2.5e6; c2=2.5e6; c3=2.5e6; k01=10; k12=11; k23=12; k30=13;
% temperature ext f=1/24; yext=300*sin(2*pi*f*t);
% solve [t,y] = m(k01,k12,k23,k30,c1,c2,c3,yext); plot(t,y(:,1),'-',t,y(:,2),'--',t,y(:,3),'o') title('Solution of 3 DE'); xlabel('time t'); ylabel('solution y'); legend('y_1','y_2','y_3');
----------------------------------------------------------
Thanks a lots.
|
|