马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
在下不才,想用matcont做一个双点脉冲的常微分方程的分支分析,但是在用matcont建立系统的时候总是出现问题,下面是我的代码,请各位赐教。
I use x,y and z as the coordinate, RHO, A, MU, L, T, ZETA are parameters, T is the period of the pulses, 1-5th orders are all numerically, the codes are the following:
function dydt = fun_eval(t,kmrgd,RHO,A,MU,L,T,ZETA)
function dxda = difeqs(a, x)
dxda = [ RHO*x(1) - A*x(1)*x(2) ; MU*x(2) ; (A-RHO)*x(1)];
end
odesolver = @ode45;
optode = [];
optode = odeset(optode, 'RelTol', 1.0E-6);
optode = odeset(optode, 'AbsTol', 1.0E-9);
y1s = [kmrgd(1); kmrgd(2); 0.0];
[t, y1e] = odesolver(@difeqs, [0 L*T], y1s, optode);
y2s = y1e(length(y1e),:);
y2s(1) = y2s(1)+RHO*T;
[t, y2e] = odesolver(@difeqs, [L*T T], y2s, optode);
y3 = y2e(length(y2e),:);
dydt=[y3(1); ZETA*y3(3)*y3(2)];
end
But there is an error: Equations are in the wrong order, compared to the coordinates. Please help me to solve this, thanks very much!!! |