Back from transfer function (s-domain) to differential equation (in t-domain)

I’ve got the following transfer function (in the s-domain):

H(s)=CsRCs+1\text{H}(s)=\frac{\text{C}s}{\text{RC}s+1}

Is there a function in Mathematica 10 that I can go back to the differential equation (in the t-domain), I’ve looked for it but I’m not be able to find it?

Thanks in advance

=================

  

 

This would benefit from addition of Mathematica code at least for the definition of the function in question.
– Daniel Lichtblau
Nov 29 ’15 at 20:13

=================

2 Answers
2

=================

You can use the definition of Laplace. Assuming zero initial conditions, replace ss with dydt\frac{dy}{dt} and s2s^2 with d2ydt2\frac{d^2y}{dt^2} and so on.

tfToDiff[tf_, s_, t_, y_, u_] := Module[{rhs, lhs, n, m},
rhs = Numerator[tf];
lhs = Denominator[tf];
rhs = rhs /. m_. s^n_. -> m D[u[t], {t, n}];
lhs = lhs /. m_. s^n_. -> m D[y[t], {t, n}];
lhs == rhs
]

Now call it

tf = C0 s/(R0 C0 s + 1);
eq=tfToDiff[tf, s, t, y, u]

y(t)y(t) is your output, and u(t)u(t) is the input. (these are what go in the transfer function when you write Y(s)U(s)=…\frac{Y(s)}{U(s)}=\dots. You’d have to replace this when the actual u(t)u(t) to solve the differential equation. For step input, (i.e. u(t)=unit stepu(t)=\text{unit step})

eq = eq /. u'[t] -> UnitStep'[t];
DSolve[{eq, y[0] == 0}, y[t], t]

Another Example

tf = (5 s)/(s^2 + 4 s + 25);
tfToDiff[tf, s, t, y, u]

  

 

Your last Example gives me nothing, how can I make it work? I jsut copied your code
– Jan Eerland
Nov 29 ’15 at 21:09

  

 

@JanEerland You need to have the function tfToDiff defined first.
– Nasser
Nov 29 ’15 at 21:10

  

 

How can I do that?
– Jan Eerland
Nov 29 ’15 at 21:10

  

 

Yes, of course I got it, thanks a lot!
– Jan Eerland
Nov 29 ’15 at 21:13

Depending on what you want to do with it, you might use the built-in InverseLaplaceTransform:

InverseLaplaceTransform[c s/(1 + r c s), s, t]

c (-(E^(-(t/(c r)))/(c^2 r^2)) + DiracDelta[t]/(c r))