How to measure the transfer function in Simulink?

Click For Summary

Discussion Overview

The discussion revolves around measuring the transfer function of a filter simulated in Simulink, specifically focusing on how to obtain the Bode plot representing the system's frequency response. Participants explore various methods and tools available within Simulink for this analysis.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes their attempt to use the "PS Divide" block to obtain the transfer function by dividing output voltage by input voltage but reports that it did not work as expected.
  • Another participant suggests checking the oscilloscope settings and warns that the current setup does not produce a true Bode plot, as it only captures one frequency rather than the frequency response.
  • Further advice includes ensuring that the input and output are compared correctly to account for potential phase shifts, which could affect the perceived attenuation.
  • A participant raises a concern about not obtaining a sinusoidal output signal in a more complex circuit and speculates that the issue may relate to the Refine factor used in the simulation.
  • Another suggestion is to change the solver from ODE45 to potentially more suitable options for the system of equations being simulated.
  • One participant recommends using the "Linear Analysis Tool" from the Control System Toolbox for a more accurate analysis of the transfer function and Bode plot, as well as the "Bode Plot" block for direct plotting.

Areas of Agreement / Disagreement

Participants express differing views on the effectiveness of the "PS Divide" block for measuring transfer functions, with some suggesting alternative methods and tools. The discussion remains unresolved regarding the best approach to accurately obtain the transfer function and Bode plot.

Contextual Notes

Participants mention potential limitations related to oscilloscope settings, solver choices, and the specific configurations of the Simulink models, which may affect the results and accuracy of the transfer function measurements.

jean28
Messages
83
Reaction score
0
Let's say I simulate a simple filter in simulink and I want to see the transfer function graph (bode plot) of it. What do I do to get Vout/ Vin? I tried using the "PS Divide" Block and divide the output voltage and the input voltage, but that didn't work. Could anyone help me out here?

This is what I tried:

http://i1226.photobucket.com/albums/ee410/jean28x/bode1.jpg

This is the graph I got:

http://i1226.photobucket.com/albums/ee410/jean28x/bode2.jpg

Thank you all very much.
 
Engineering news on Phys.org
The scale on your scope is way of. Hit the button next to the printer and uncheck the box saying something like "save only last 1000 data points". Simulate again and hit the button with the binoculars. Does the result seem to be correct now? Check with your analytical answer!

If no results appear, check the Matlab command window for warnings and errors. A divide block can cause problems for certain inputs.

Also this setup does not create the bode plot of the system. A bode plot is the frequency response, here you got only one frequency.

Further hints: A system can create a phase shift between the input and output. Comparing the input and output at the same instant of time gives no true information about the attenuation. How is this done in your model...
 
SirAskalot said:
The scale on your scope is way of. Hit the button next to the printer and uncheck the box saying something like "save only last 1000 data points". Simulate again and hit the button with the binoculars. Does the result seem to be correct now? Check with your analytical answer!

If no results appear, check the Matlab command window for warnings and errors. A divide block can cause problems for certain inputs.

Also this setup does not create the bode plot of the system. A bode plot is the frequency response, here you got only one frequency.

Further hints: A system can create a phase shift between the input and output. Comparing the input and output at the same instant of time gives no true information about the attenuation. How is this done in your model...

Ok thanks a lot! One more quick question. I am trying to simulate this circuit (quite complicated) and I can't seem to get an output signal that seems sinusoidal. I think it has something to do with the Refine factor, because when I simulate simpler circuits I DO get a good sine wave. Do you have any idea why this would act this way?

Circuit:

http://i1226.photobucket.com/albums/ee410/jean28x/finalproyect.jpg

Graph I get (instead of Sine Wave):

http://i1226.photobucket.com/albums/ee410/jean28x/simulinkpic3.jpg
 
Try changing solver. Now you are using ODE45, but other might be better for this system of equations.

http://www.mathworks.se/help/simulink/ug/choosing-a-solver.html
 


To measure the transfer function in Simulink, you can use the "Linear Analysis Tool" which is part of the Control System Toolbox. This tool allows you to analyze the linear characteristics of your system, including the transfer function. To use this tool, you need to first create a Simulink model of your system and then open the Linear Analysis Tool from the "Apps" tab in the Simulink window. From there, you can specify the inputs and outputs of your system and run the analysis. The tool will then display the transfer function, Bode plot, and other relevant information for your system. You can also use the "Bode Plot" block from the Simulink library to directly plot the transfer function of your system. This block takes in the input and output signals and automatically calculates the transfer function and plots the Bode plot. I would recommend using these tools instead of the "PS Divide" block, as they are specifically designed for this purpose and will provide more accurate results.
 

Similar threads

Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
36K
  • · Replies 18 ·
Replies
18
Views
36K
  • · Replies 4 ·
Replies
4
Views
10K
  • · Replies 8 ·
Replies
8
Views
16K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 30 ·
2
Replies
30
Views
6K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K