看板 Mathematica 關於我們 聯絡資訊
f = 0.005 g[t_] := 2 UnitStep[t] - 4 UnitStep[t - f] + 4 UnitStep[t - 2 f] - 4 UnitStep[t - 3 f] + 4 UnitStep[t - 4 f] - 4 UnitStep[t - 5 f] + 4 UnitStep[t - 6 f] sol = DSolve[{v'[t] + v[t]/(50*10^-9*7000) == (g[t])/(50*10^-9*7000), v[0] == 0}, v, t] 可是當我跑完上面那一行時,他就會出現Reduce::ratnz: Reduce was unable to solve the system with inexact coefficients. The answer was obtained by solving a corresponding exact system and numericizing the result. >> 我要做的事情大概就是個RC電路用方波時的圖形,可是當我打出v[0]=0的時候他就會跑出 上面那一行,請問我應該怎麼辦? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.113.66.77
LPH66:把 f = 0.005 改成 f = 1/200 10/23 22:36
LPH66:這是因為 Mathematica 在看到有浮點數時會用浮點數計算 10/23 22:36
LPH66:於是對稍微複雜一點的式子可能會達不到所要求的精準度 10/23 22:37
LPH66:不過基本上不是什麼大問題就是了... 10/23 22:38
bjiyxo:謝謝回答:) 10/25 00:32