Matlab code and Strogatz histeresis example
3 次查看(过去 30 天)
显示 更早的评论
Hi,
Iam trying to replicate Strogatz example for histeresis (figure3.4.5, page 59), but I couldnt plot the same bifurcation...
The code I did was the following
clear all;
global r;
ci=[1 ];
tspan=[0 6500];
for r=-3:0.1:2
[t,y] = ode113('histeresis', tspan, ci);
l=length(y)
a=l*0.45;
plot(r,((max(y(l-a:l,1)))),'.','Color','blue','Markersize',11);hold on;
plot(r,((min(y(l-a:l,1)))),'.','Color','blue','Markersize',11);hold on;
end
Where 'histeresis' is a separated function m file, as following:
function dydt = histeresis(t,y)
global r
dydt(1,1) = r*y(1)+y(1)^3-y(1)^5;
_____
Possible there some flaw in the code, or even some wrong interpretation by me of the histeresis simulation.
Please help!
Thank you alot.
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!