声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1884|回复: 0

[工具箱] Matcont如何做脉冲微分方程的分支分析

[复制链接]
发表于 2012-6-1 23:40 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

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!!!
回复
分享到:

使用道具 举报

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-19 11:58 , Processed in 0.133527 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表