How to implement a transfer function in Simulink with variable coefficients?

In summary: The implementations for the two filters in simulink are as follow:For the first filter:For the second one:The obtained results have values of 10^-12, while the expected results should be between 10^-3 - 10.Since it's the first time when I try t implement a tf with variable coefficients I am not sure the implementations are correct.I don't understand how the block scheme should be made such that I would obtain sqrt(5d)/b+s.I have worked with Tustin transformations whose parameters changed. I had to make my own blocks that had inputs for a reset flag, a flag to initialize with steady-state values, and the parameters (and
  • #1
MoonDiver
6
0
Homework Statement
Implement in Simulink two filters using transfer functions with variable coefficients and passing a gaussian noise. The two filters are:
Relevant Equations
F(s) = ((5d)^(1/2))/(b+s);
F1(s) = (((5d)^(1/2))*((b/sqrt(3))+s)) / (b+s)^2;
The implementations for the two filters in simulink are as follow:

For the first filter:
img1.png

For the second one:

img2.png

The obtained results have values of 10^-12, while the expected results should be between 10^-3 - 10.
Since it's the first time when I try t implement a tf with variable coefficients I am not sure the implementations are correct.

I don't understand how the block scheme should be made such that I would obtain sqrt(5d)/b+s.
 
Physics news on Phys.org
  • #2
I have worked with Tustin transformations whose parameters changed. I had to make my own blocks that had inputs for a reset flag, a flag to initialize with steady-state values, and the parameters (and of course, the input signal). The reset flag would recalculate the Tustin coefficients, the initialization flag would be set if the Tustin should be initialized in a steady state, and the parameters could be changed according to schedules. If the initialization flag is set, the behavior of the transformation is momentarily just a pass-through of the input signal. If the initialization flag is not set, the output would simply be calculated as though the transformation was active, regardless of whether the parameters had changed or not.
 
  • #3
FactChecker said:
I have worked with Tustin transformations whose parameters changed. I had to make my own blocks that had inputs for a reset flag, a flag to initialize with steady-state values, and the parameters (and of course, the input signal). The reset flag would recalculate the Tustin coefficients, the initialization flag would be set if the Tustin should be initialized in a steady state, and the parameters could be changed according to schedules. If the initialization flag is set, the behavior of the transformation is momentarily just a pass-through of the input signal. If the initialization flag is not set, the output would simply be calculated as though the transformation was active, regardless of whether the parameters had changed or not.
Thank you for the response!

What I don't understand is how should the block scheme look like in order to achieve the b + s part of the function.

F(s) = 5d^(1/2)/(b + s)
 

FAQ: How to implement a transfer function in Simulink with variable coefficients?

How can I implement a transfer function with variable coefficients in Simulink?

You can implement a transfer function with variable coefficients in Simulink by using the "Transfer Fcn" block in combination with a "MATLAB Function" block or "Workspace" variables. The "MATLAB Function" block allows you to define the coefficients as variables that can change during simulation.

How do I update the transfer function coefficients during simulation?

To update the transfer function coefficients during simulation, you can use a "MATLAB Function" block or a "MATLAB Script" that runs at each time step. This script can read the current values of the coefficients from the workspace or compute them based on other signals in the model.

Can I use Simulink blocks to create a transfer function with time-varying coefficients?

Yes, you can use Simulink blocks such as "Gain", "Sum", and "Product" blocks to manually construct the transfer function. By connecting these blocks appropriately and using variable inputs, you can create a transfer function with time-varying coefficients.

What are some common issues when implementing variable coefficient transfer functions in Simulink?

Common issues include ensuring that the coefficients are updated correctly at each time step, maintaining numerical stability, and avoiding algebraic loops. It is also important to manage the initialization of variables and ensure that the simulation time step is appropriate for the dynamics of the system.

How can I test and validate my variable coefficient transfer function in Simulink?

You can test and validate your variable coefficient transfer function by creating test cases with known inputs and expected outputs. Use scopes and data logging to monitor the behavior of the system. Additionally, you can compare the Simulink results with analytical solutions or results from other simulation tools to ensure accuracy.

Similar threads

Replies
0
Views
1K
Replies
5
Views
2K
Replies
3
Views
2K
Replies
9
Views
3K
Replies
2
Views
1K
Replies
7
Views
3K
Replies
6
Views
4K
Back
Top