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 views (last 30 days)
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

Accepted Answer

Star Strider
Star Strider on 14 Sep 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 Comments
Cam
Cam on 14 Sep 2016
Edited: Cam on 14 Sep 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 on 14 Sep 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!

Sign in to comment.

More Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!