Transforming a transfer function into a differential equation in Matlab

127 visualizzazioni (ultimi 30 giorni)
I have the following code in matlab:
syms s
num = [2.4e8];
den = [1 72 90^2];
hs = poly2sym(num, s)/poly2sym(den, s);
hs
f = ilaplace(hs)
The inverse Laplace transform converts the transfer function in the "s" domain to the time domain.I want to know if there is a way to transform the s-domain equation to a differential equation with derivatives. The following figure is just an example:
I'm trying to implement a dynamic system in an s-function and I need to put it in this format to be able to access the system states. I tried to work with the state space of this system but it's giving an error that I couldn't solve, I even have an unanswered question here "https://www.mathworks.com/matlabcentral/answers/872918-help-s-function-error-message-output-returned-by-s-function-hi_plant_sfcn-in-untitled-s-funct?s_tid=srchtitle", about this. If anyone knows how to do this, I appreciate it.
  2 Commenti
Sean Brennan
Sean Brennan il 9 Lug 2021
A transfer function is the ratio of output in s-domain to input in s-domain. For example
Y(s)/U(s) = (s+1)/(s^2+4s+9)
if we cross-multiply:
(s^2+4s+9)*Y(s)=(s+1)*U(s)
And multiply through the s-terms, then take the inverse Laplace:
y''(t)+4y'(t)+9y(t) = u'(t)+u(t)
If you are trying to put it into state-space, then the command "tf2ss" would work. If you want a specific state, say the y-dot term, then a simple way to do this is to multiply the transfer function by "s" (e.g., the derivative). MATLAB would then give you the solution for the y-dot result (and not y) using the method that you list above. And if you want to plot the results, you can use the "step" command on the transfer function object created by the "tf" command, solve the result numerically using any of the ODE solver tools (ode45) or simulate the transfer function using Simulink in transfer-function, all-integrator block diagram, or state-space forms. In other words, there are LOTS of ways to solve this problem!
Vagner Martinelli
Vagner Martinelli il 9 Lug 2021
Modificato: Vagner Martinelli il 9 Lug 2021
is there a matlab command in symbolic math that does this, or will i always have to do it manually?

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Mathematics in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by