?? 新建 文本文檔.txt
字號:
x[0]={0.4,0,0}
h=500
figure(1);
plot(a(:,1),a(:,2));grid on;
xlabel('time/s');
ylabel('Response');
legend('歐拉法');
title('步距h=0.0001');
figure(2);
plot(b(:,1),b(:,2));grid on;
xlabel('time/s');
ylabel('Response');
legend('二階龍格庫塔');
title('步距h=0.005');
figure(3)
plot(c(:,1),c(:,2));grid on;
xlabel('time/s');
ylabel('Response');
legend('四階龍格庫塔');
title('步距h=0.05');
figure(4)
plot(a(:,1),(a(:,2)-1)*100/1,'-r',b(:,1),(b(:,2)-1)*100/1,'.b',c(:,1),(c(:,2)-1)*100/1,'-+g');grid on;
xlabel('time/s');
ylabel('err%');
legend('歐拉偏差','二階龍格庫塔偏差','四階龍格庫塔偏差');
title('數(shù)值積分誤差分析圖');
figure(4)
plot(a(:,1),(a(:,2)-1)*100/1,'-r',b(:,1),(b(:,2)-1)*100/1,'.b');grid on;
xlabel('time/s');
ylabel('err%');
legend('二階龍格庫塔偏差','四階龍格庫塔偏差');
title('數(shù)值積分誤差分析圖');
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -