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 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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
0 Commenti
Risposta accettata
Star Strider
il 14 Set 2016
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 Commenti
Star Strider
il 14 Set 2016
@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!
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!