[問題] 非線性微分方程式

看板Mathematica作者 (Stanage Edge)時間13年前 (2011/12/01 22:15), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
大家好~ 我想解一組非線性微分方程式 未知數有兩個:C0(t), C1(t) 希望能在0 <= t <=1 這範圍內求解 1.DSolve[{4*(1+0.5*t^3)*C1[t]*C1[t]/9 - 2*(t-t^4)*C1[t]*C1'[t]/9 - t^3*C0"[t] == 0, 2*t*C1[t] - 2*(t-t^4)*C1[t]*C0'[t]/3 - t^3*C1"[t] == 0, C0[0] == 0, C1[0] == 0, C0'[1] == 0.5, C1'[1] == 0.75}, {C0[t], C1[t]}, t] 可是Mathematica回傳原方程式,是我哪裡寫錯或者沒有解析解呢? 2.試試看求數值解 NDSolve[{4*(1+0.5*t^3)*C1[t]*C1[t]/9 - 2*(t-t^4)*C1[t]*C1'[t]/9 - t^3*C0"[t] == 0, 2*t*C1[t] - 2*(t-t^4)*C1[t]*C0'[t]/3 - t^3*C1"[t] == 0, C0[0] == 0, C1[0] == 0, C0'[1] == 0.5, C1'[1] == 0.75}, {C0[t], C1[t]}, {t,0,1}] 也是回傳原方程式,而且多了一堆訊息,是說有些點譬如t=0時, 會遇到1/0的情況... 3.設t0=0.0001 在t0 <= t <1-t0 內求解 NDSolve[{4*(1+0.5*t^3)*C1[t]*C1[t]/9 - 2*(t-t^4)*C1[t]*C1'[t]/9 - t^3*C0"[t] == 0, 2*t*C1[t] - 2*(t-t^4)*C1[t]*C0'[t]/3 - t^3*C1"[t] == 0, C0[t0] == 0, C1[t0] == 0, C0'[1-t0] == 0.5, C1'[1-t0] == 0.75}, {C0[t], C1[t]}, {t,t0,1-t0}] {{C0[t]->InterpolatingFunction[{{0.0001,0.9999}},<>][t], C1[t]->InterpolatingFunction[{{0.0001,0.9999}},<>][t]}} 這樣就沒問題 4.當我想做複雜一點的計算 未知數有三個:C0[t], C1[t], C2[t] eqn1=4*(1+0.5*t^3)*C1[t]*C1[t]/9 - 2*(t-t^4)*C1[t]*C1'[t]/9 - t^3*C0"[t] -3*(t^3-t^5)*C2[t]*C2'[t]/5 + 6*t^4*C2[t]*C[2]/5 eqn2=2*t*C1[t] - 2*(t-t^4)*C1[t]*C0'[t]/3 - t^3*C1"[t] - 4*(t-t^4)*C1[t]*C2'[t]/15 -6*(t^3-t^5)*C2[t]*C1'[t]/5 + 4*(1+0.5*t^3)*C1[t]*C2[t]/5 + 6*t^4*C1[t]*C2[t]/5 eqn3=-4*(t-t^4)*C1[t]*C1'[t]/9 - 3*(t^3-t^5)*C2[t]*C0'[t] -6*(t^3-t^5)*C2[t]*C2'[t]/7 - 4*(1+0.5*t^3)*C1[t]*C1[t]/9 +6*t^4*C2[t]*C2[t]/7 - t^3*C2"[t] + 6*t*C2[t] 設t0=0.0001 在t0 <= t <1-t0 內求解 NDSolve[{eqn1== 0, eqn2 == 0, eqn3 == 0, C0[t0] == 0, C1[t0] == 0, C2[t0] == 0, C0'[1-t0] == 0.5, C1'[1-t0] == 0.75, C2'[1-t0] == 0}, {C0[t], C1[t], C2[t]}, {t,t0,1-t0}] 也是有數值解 {{C0[t]->InterpolatingFunction[{{0.0001,0.9999}},<>][t], C1[t]->InterpolatingFunction[{{0.0001,0.9999}},<>][t], C2[t]->InterpolatingFunction[{{0.0001,0.9999}},<>][t]}} 可是有訊息說會遇到singularity NDSolve::ndsz::At t=0.24478, step size is effectively zero........ General::stop :Further output of NDSolve::ndsz w ill be suppressed during this calculation 請問這些訊息會影響結果嗎? 我該如何修正讓錯誤訊息不會出現呢? 非常謝謝囉<(_ _)> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 31.205.2.200
文章代碼(AID): #1ErulaRA (Mathematica)
討論串 (同標題文章)
文章代碼(AID): #1ErulaRA (Mathematica)