Transforming a transfer function into a differential equation in Matlab
127 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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
il 9 Lug 2021
A transfer function is the ratio of output in s-domain to input in s-domain. For example
if we cross-multiply:
And multiply through the s-terms, then take the inverse Laplace:
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!
Risposte (0)
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!