Re: [問題] 關於ODE45解二階常微已回收

看板MATLAB作者 (MATLAB程式編輯員)時間16年前 (2010/06/12 18:02), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《mama1985le (Rush)》之銘言: : 小弟不才 : 想請問板上各位鄉民 : 要如何用ODE45解以下方程式? : y''(x)-4y'(x)+3y(x)=10exp(-2x) : with conditions y(0)=1 and y'(9)=-3 : 感謝... 邊界值問題. --------------------程式----------------- function pttex139 clc t = 0:9; solinit = bvpinit(t,[1 -3]); sol = bvp4c(@pttode,@pttodebc,solinit); y = deval(sol,t); plot(t,y(1,:)); function f = pttode(t,y) f = zeros(2,1); f(1) = y(2); f(2) = 10.*exp(-2.*t)+4.*y(2)-3.*y(1); function f = pttodebc(ya,yb) f = zeros(2,1); f(1) = ya(1) - 1; f(2) = yb(1) + 3; ------------------------------------------ -- 1.MATLAB programming 2.ASPEN process simulation package 3.FORTRN programming 4.Advance Engineering Mathematics 5.Process Control Theory 6.Chemical Engineering Basic Theory(Kinetic.thermodynamics.transport) 7.Numerical Method and Analysis 8.MATLAB Toolbox.Simulink system basic design -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 113.160.148.219
文章代碼(AID): #1C4riOKj (MATLAB)
文章代碼(AID): #1C4riOKj (MATLAB)