Hi Guys,
I met a question when built the simulink model.
I wanna change the munerator coefficients parameter of Transfer Fcn dynamiclly,but pop up an error,i don't know how to deal with it .
the modle is below:
pop up the error:
The attachment is the model.
Original Attachment has been moved to: Model_1.slx.zip
已解决! 转到解答。
Hi Eden Li,
This has nothing to do with the modelling - it is pure math, especially control system theory :-) What are you trying to do is not accurate - you can't swap the coefficient from Laplace domain to Z-domain
First of all the H(s) is a continuous function and before calculating the Z-transform of H(s) you need to sample . What you want is to convert the H(s) -> H(z) by calculating the Z-transform of h(t) sampled of different intervals T and is know as inverse Laplace transform of H(s)
My recommendation is to read these Mathworks articles about continuous2discrete and discrete2continuous transformations.
After that you should get similar waveforms.
Hope this helps!
Best regards,
Daniel
Hi Eden Li,
That is a Matlab limitation for standard transfer function block that can be easily workaround via:
#1: mathematical approach, to create the transfer function representation via Simulink basic ADD/MULTIPLY/INTEGRATOR/DERIVATIVE blocks in which we can add DATA STORE READ inputs.
#2: mimic - reuse other blocks that allows DATA READ to mimic the functionality of standard transfer function block. One example might be PID controller block that can be easily transformed in a 1st or 2nd order transfer function, depending on the options highlighted below.
Note that these 2 approaches works for both S and Z domains
Perhaps others might know better ways. Please leave a comment below for any other approach.
Best regards,
Daniel
For digital transfer function we can add the DATA READ directly because it is supported in the UI
And you'll have something like this:
For the suggestion with "mimic" you need to play a bit with the maths - since it is not straightforward like using a single block.
Here is a glace of what you can do:
Hope this helps!
Daniel
Hi Daniel,
The two ways above to solve the theme is valid,but i come across another question,the constant 8 inputs the Discrete Transfer Fcn and the continuous Transfer Fcn at same time,but the result is great defference.i changed a lot of parameter about the Discrete Transfer Fcn ,but result is not improment.
Hi Eden Li,
This has nothing to do with the modelling - it is pure math, especially control system theory :-) What are you trying to do is not accurate - you can't swap the coefficient from Laplace domain to Z-domain
First of all the H(s) is a continuous function and before calculating the Z-transform of H(s) you need to sample . What you want is to convert the H(s) -> H(z) by calculating the Z-transform of h(t) sampled of different intervals T and is know as inverse Laplace transform of H(s)
My recommendation is to read these Mathworks articles about continuous2discrete and discrete2continuous transformations.
After that you should get similar waveforms.
Hope this helps!
Best regards,
Daniel