Solving for c in v(t,g,m,c) given intial v,g,m,t

So I was given the initial equation
m(Dv/dt) = m*g-c*v ; v(0) = 0; [from textbook]
so I solved for v using
v = dsolve('Dv=(m*g-c*v)/m', 'v(0)=0')
and got
v =
(g*m - (g*m)/exp((c*t)/m))/c
now I am given
v = 28, g = 9.81, m =90, t =4
and I am supposed to find c
so I used
f =subs( v, {g,m,t}, {9.81,90,4)}
then solve(f-28, c)
however, I keep getting a lambertw function in my value for c or some expression including k,pi and i, so I think I must be doing something wrong.
Suggestions?

 Accepted Answer

Are you looking for a symbolic solution? If you want a numerical one, you can use fzero
v = 28, g = 9.81, m =90, t =4;
fzero(@(c) (g*m - (g*m)/exp((c*t)/m))/c-v, -1)

2 Comments

I am looking for a numerical answer for c.
That worked!
Thank you very much :D

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!