symbolic definite integral using matlab

208 Views Asked by At

I have this function $$ \frac{di}{dt} = - \frac{R}{L} i $$

I know the solution which is $$ i(t) = i_{0} e^{- \frac{R}{L} (t-t_{0})} $$ I would like to get the same solution by using Matlab. How can I do that?

Edit:

The solution is

>> syms L R i
>> dsolve('Di = -R/L*i', 'i(t0) = i0')
1

There are 1 best solutions below

9
On BEST ANSWER

Following codes should work, see

syms R L i(t) i0
dsolve(diff(i) == -R/L*i, i(0) == i0)