请高手指教Matlabfunction dx=c7chua(x,a,b,alpha,beta,gamma)dx=[alpha*(x(2)-x(1)-nlfun(x,a,b));x(1)-x(2)+x(3);-beta*x(2)-gamma*x(3)];function f0=nlfun(x,a,b)f0=b*x+(a-b)*(abs(x+1)-abs(x-1))/2;>>a=-120/7; b=-75/7; alpha=15; beta=20; gamma=0.5;f=ode
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/23 16:30:48
请高手指教Matlabfunction dx=c7chua(x,a,b,alpha,beta,gamma)dx=[alpha*(x(2)-x(1)-nlfun(x,a,b));x(1)-x(2)+x(3);-beta*x(2)-gamma*x(3)];function f0=nlfun(x,a,b)f0=b*x+(a-b)*(abs(x+1)-abs(x-1))/2;>>a=-120/7; b=-75/7; alpha=15; beta=20; gamma=0.5;f=ode
请高手指教Matlab
function dx=c7chua(x,a,b,alpha,beta,gamma)
dx=[alpha*(x(2)-x(1)-nlfun(x,a,b));
x(1)-x(2)+x(3);-beta*x(2)-gamma*x(3)];
function f0=nlfun(x,a,b)
f0=b*x+(a-b)*(abs(x+1)-abs(x-1))/2;
>>a=-120/7; b=-75/7; alpha=15; beta=20; gamma=0.5;
f=odeset; f.RelTol=1e-6;
[t,x]=ode45('c7chua',[0,100],[-2.121304;-0.06617;2.88109],f,a,b,alpha,beta,gamma);
plot3(x(:,1),x(:,2),x(:,3))
grid
Input argument "alpha" is undefined.
Error in ==> c7chua at 2 dx=[alpha*(x(2)-x(1)-nlfun(x,a,b));
请高手指教Matlabfunction dx=c7chua(x,a,b,alpha,beta,gamma)dx=[alpha*(x(2)-x(1)-nlfun(x,a,b));x(1)-x(2)+x(3);-beta*x(2)-gamma*x(3)];function f0=nlfun(x,a,b)f0=b*x+(a-b)*(abs(x+1)-abs(x-1))/2;>>a=-120/7; b=-75/7; alpha=15; beta=20; gamma=0.5;f=ode
这应该是蔡氏电路
定义函数错误,nlfun参数x是个三维向量,而f0仅需要x(1),
可改为如下
function dx=c7chua(t,x,a,b,alpha,beta,gamma)
f0=b*x(1)+(a-b)*(abs(x(1)+1)-abs(x(1)-1))/2;
dx=[alpha*(x(2)-x(1)-f0);
x(1)-x(2)+x(3);-beta*x(2)-gamma*x(3)];
a=-120/7; b=-75/7; alpha=15; beta=20; gamma=0.5;
f=odeset; f.RelTol=1e-6;
[t,x]=ode45(@c7chua,[0,100],[-2.121304;-0.06617;2.88109],f,a,b,alpha,beta,gamma);
plot3(x(:,1),x(:,2),x(:,3))
grid
参数好像有问题
图应是这样的
而你的却得出