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)
 

1. How do I define the transfer function in Simulink?

To define a transfer function in Simulink, you can use the Transfer Fcn block. This block allows you to specify the numerator and denominator coefficients of the transfer function. You can also specify the initial conditions if needed.

2. Can I use variable coefficients in a transfer function in Simulink?

Yes, you can use variable coefficients in a transfer function in Simulink. To do so, you can use the Transfer Fcn block and specify the coefficients as variables in the MATLAB workspace. You can then use these variables in the numerator and denominator fields of the block.

3. How do I change the coefficients of a transfer function during simulation?

To change the coefficients of a transfer function during simulation, you can use the MATLAB Function block. This block allows you to write custom MATLAB code to update the coefficients based on any desired conditions or inputs. You can then connect the output of this block to the Transfer Fcn block to update the coefficients during simulation.

4. Can I use a transfer function with variable coefficients in a feedback loop?

Yes, you can use a transfer function with variable coefficients in a feedback loop in Simulink. To do so, you can use the Transfer Fcn block and specify the coefficients as variables in the MATLAB workspace. You can then use these variables in the numerator and denominator fields of the block. You can also use the MATLAB Function block to update the coefficients during simulation if needed.

5. Are there any limitations to using variable coefficients in a transfer function in Simulink?

There are a few limitations to using variable coefficients in a transfer function in Simulink. Firstly, the variables used for the coefficients must be defined in the MATLAB workspace. Additionally, the variables must be scalar values, as the Transfer Fcn block does not support vector or matrix coefficients. Finally, the variables must be real numbers, as the Transfer Fcn block does not support complex coefficients.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
827
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
9
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
3K
  • Differential Equations
Replies
1
Views
2K
  • Differential Equations
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
Back
Top