Im trying to solve a differential equation that i did on paper with the solve function but it gives me a huge exact answer all i want is an approximation how do i do that. heres my code.p = 161/880 Vo = 0 g = 32.2 Vt = g/p yo = 1200 syms t eq = ((-1/

3 ビュー (過去 30 日間)
how do i do that. heres my code.
p = 161/880
Vo = 0
g = 32.2
Vt = g/p
yo = 1200
syms t
eq = ((-1/p)*(Vo-Vt)*exp(-p*t))+(Vt*t)+yo+(1/p)*(Vo-Vt)
t = solve(eq,t)
heres what it returns
t =
(880*lambertw(0, -(340584721819893789*exp(84266571152752611/340584721819893760))/340584721819893760))/161 - 523394851880451/387028092977152
i just need an answer in seconds that would be nice

採用された回答

Star Strider
Star Strider 2016 年 9 月 14 日
Use the vpa or double function to get an understandable result:
p = 161/880
Vo = 0
g = 32.2
Vt = g/p
yo = 1200
syms t
eq = ((-1/p)*(Vo-Vt)*exp(-p*t))+(Vt*t)+yo+(1/p)*(Vo-Vt);
t = solve(eq,t)
t_vpa = vpa(t)
t_double = double(t)
t_vpa =
- 2.1428498167327182026809021208394 + 8.0507403552584882828906649509827i
t_double =
-2.1428e+000 + 8.0507e+000i
  5 件のコメント
Cam
Cam 2016 年 9 月 14 日
編集済み: Cam 2016 年 9 月 14 日
Thanks a ton yeah star strider is right time shouldn't be complex something is wrong with how i integrated the ode originally any way it does model someone falling from 1200 feet with a certain air resistance. Ill have to work with it till i get a better answer i didn't realize that it was giving me a complex answer.
Star Strider
Star Strider 2016 年 9 月 14 日
@Cam — My pleasure. Unless you are not supposed to use the dsolve function, using it could help you find the error in your solution.
@Walter — The problem with having an engineering background that is almost entirely in electrical engineering is that ‘V’ means voltage, and late at night I look no further!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by