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)
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

Risposta accettata

Star Strider
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
Cam
Cam il 14 Set 2016
Modificato: Cam il 14 Set 2016
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 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!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Mathematics in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by