1
$\begingroup$

I am trying to solve ordinary differential equations with initial conditions using Laplace transform. A simple test setup includes

  • an exponential discharge of RC circuit and

  • an integrator from coil and voltage source.

While the result of the first example is as expected, the second one is not. What am I missing?

Matlab code:

function ilap_test

syms s RC vc vc0 il il0 L vin

% vc_dot = -1/RC * vc      exponential discharge
% il_dot = 1/L * vin       current integrator

% s*vc - vc0 = -1/RC * vc  % transform with initial conditions
% s*il - il0 = 1/L * vin

vc = vc0/(s + 1/RC);
il = vin/L/s + il0/s;

simplify(ilaplace(vc))
% vc0*exp(-t/RC)        (ok)

simplify(ilaplace(il))
% il0 + vin/L           shouldn't this be il0 + vin/L*t ???
$\endgroup$
1
  • 1
    $\begingroup$ I'm voting to close this question as off-topic because it belongs on math.SE. $\endgroup$ Aug 28, 2016 at 3:32

1 Answer 1

1
$\begingroup$

Not all right hand sides are created equal. Arranging by degree of derivative:

x_dot      x             const

vc_dot     + 1/RC*vc     + 0         = 0
il_dot                   - 1/L*vin   = 0 

Laplace transform:

s*vc - vc0     + 1/RC*vc                 = 0
s*il - il0                   -1/L*vin/s  = 0  % const div by s was missing

Solve:

vc = vc0/(s + 1/RC)
il = il0 + vin/L/s^2

Back-transform:

vc = vc0*exp(-t/RC)
il = il0 + t*vin/L
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.