精華區beta NTUNL 關於我們 聯絡資訊
以下是Lorenz:(這個從書上抄下來的 :p 有現成的就懶得自己想..) 在command window裡,用ode45解題器即可: [t,x]=ode45('LorenzNew',[0,100],[0;0;1e-8]); plot(t,x); xlabel('Time(sec)'); ylabel('Output'); legend('x1','x2','x3'); figure(2); plot3(x(:,1),x(:,2),x(:,3)); xmax=max(x(:,1)); xmin=min(x(:,1)); ymax=max(x(:,2)); ymin=min(x(:,2)); zmax=max(x(:,3)); zmin=min(x(:,3)); axis([xmin xmax ymin ymax zmin zmax]); xlabel('x1') ylabel('y1') zlabel('z1') grid m file裡,可自行更改a, b,....等的參數: function dx = LorenzNew (t,x) a=3; b=1; c=10; d=10; e=1; f=30; g=1; dx = [-a*x(1)+b*x(2)*x(3); -c*x(2)+d*x(3); -e*x(1)*x(2)+f*x(2)-g*x(3)]; -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.223.94 ※ 編輯: kaiweiliou 來自: 140.112.223.94 (11/26 00:48)
ANUBISANKH:不知為什麼 matlab 畫出的圖形真的好很多.... 11/26 09:36