97-2 數值方法期中考

 

一、使用步幅固定的 R-K 方法,於範圍 x = [0.0, 1.0] 求解常微分方程式 y'(x) = 2x,並將數值解畫出,初始條件 y(0.0) = 0.0。

 

二、使用有步幅調適控制的 R-K 方法,於範圍 x = [-6.0, 6.0] 求解常微分方程式 y''(x) + y(x) = 0,並將數值解畫出,初始條件 y(-6.0) = 3.0、y'(-6.0) = 1.0。

 

 

參考資料:rkdumbodeint 的副程式課文內容說明,以及 PGPLOT 基本語法

 


 

integer pgopen

if (pgopen('/xwin').le.0) stop
call pgpap(6.0,0.75)
call pgenv (x1,x2,y_min,y_max,0,0)
call pgline(kount,xp,yy)
call pgsci(2)
call pgpt(kount,xp,yy,9)
call pgclos