Is there a zpk block in simscape (like the Transfer fcn block)? Would be useful since it is more general than the Transfer fcn.

 Réponse acceptée

Paul
Paul le 19 Nov 2022

1 vote

Zero-pole-gain block in Simulink, don't know if there is a specialized or alternate version in Simscape.

6 commentaires

Walter Roberson
Walter Roberson le 19 Nov 2022
There are interface blocks that allow communication between simscape and Simulink. It would not surprise me if the interface is a bit slow, though.
Frank
Frank le 21 Nov 2022
Thanks for the answers. A Simulink block of course would also be fine; I need however one that allows a higher power of s in the nominator than in the denominator.
An improper transfer function can be represented in the Control System Toolbox with a descriptor, state-space model
h = zpk([-1 -2],[-3],2)
h = 2 (s+1) (s+2) ------------- (s+3) Continuous-time zero/pole/gain model.
sys = ss(h)
sys = A = x1 x2 x3 x1 -3 1.414 0 x2 0 1 -2 x3 0 0 1 B = u1 x1 0 x2 0 x3 -2 C = x1 x2 x3 y1 -1.414 1 0 D = u1 y1 0 E = x1 x2 x3 x1 1 0 0 x2 0 0 1 x3 0 0 0 Continuous-time state-space model.
Simulink does include a Descriptor State Space block, however, I don't think it's intended for this use case. Try it anyway, maybe it will work.
If it doesn't, then the best approach, if possible, is to refactor the model.
For example, can the TF in question be combined with another downstream or upstream such that their product is proper or strictly proper? If so, implement the product.
Or maybe the derivatives of the input to the TF in question are (or can be) explicitly computed upstream. If so, the TF can be expressed as the sum of a proper transfer function and scaled derivatives, and implemented that way. For example
[num,den] = tfdata(h)
num = 1×1 cell array
{[2 6 4]}
den = 1×1 cell array
{[0 1 3]}
[r,p,k] = residue(num{:},den{:})
r = 4
p = -3
k = 1×2
2 0
This result shows that h can also be implemented as h = 4/(s+3) + 2*s
h1 = zpk(tf(4,[1 3]) + tf(2*[1 0],1))
h1 = 2 (s+2) (s+1) ------------- (s+3) Continuous-time zero/pole/gain model.
So, if the derivative of the input (u) to h is (or can be) explicitly computed in the block diagram (for example, if the preceding block is an integrator), then the diagram can implement 4/(s+3)*u + 2*udot.
Frank
Frank le 21 Nov 2022
Thank you very much! The Descriptor State Space block seems to be what I am looking for; hope that I will get this running...
Paul
Paul le 21 Nov 2022
Would you mind reporting back here as to whether or not the Descriptor State Space block solves the problem? I'm asking because I don't think it's going to work for the problem as you've described, so will be very interested if it does.
Frank
Frank le 22 Nov 2022
Probably you are right. Using the Descriptor State Space block gives an error message:
Error using linearize (line 355)
A system of differential-algebraic equations with a high index was detected in block 'simple_circuit_demo/Descriptor State-Space3'. Simulink does not support such system.
I will try to understand and use your second approach (once I find the time...). Thanks a lot!

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by