How to plot bode (Vout/Vin) of a circuit model in simulink?

I have designed an isolated boost converter in simulink and the model is attached herewith. To design the closed loop controller of the model, I wanted to plot the bode of circuit using 'linearization' option in simulink. To plot the bode, I used the following steps:
  1. Used a controlled voltage source for the input.
  2. Added a 'Sum' block to the input voltage block to add an input perturbation.
  3. Selected the perturbation signal as 'input perturbation' in 'linearization' tab.
  4. Selected the measured output voltage signal as 'open loop output' in 'linearization' tab.
  1. Clicked on 'Model Linearizer'
  2. Clicked on 'Bode' in the pop-up window.
  3. I got a bode plot
But the obtained bode plot is incorrect and the gain is completly in the negative direction. What step I can change to obtain the correct bode plot? Also how can I generate the corresponding transfer function?

댓글 수: 8

hello
are you able to share the input / ouput data ? (mat file)
Hi @Peter,
Have you resolved the issue? Actually, there is a "Bode Plot" block, but the block doesn't require port connections to the time-domain signals generated by the dynamic system.
@Mathieu NOE.. You mean the input and output voltage?
@Sam Chak.. I haven't resolved yet. How to choose the input and output signals in the 'bode block'?
@Peter, You can follow the steps outlined in this documentation and let us know if it works for you:
@Sam Chak.. I was able to plot the bode correctly. But I was getting a negative gain instead of 0 during the lower frequency. What might be the reason?
Hi Peter,
What did you do differently to generate the correct plot as compared to the original plot in the original question?
I used the "Bode Plot" block as Sam mentioned in the previous comment and specified the steady state time while plotting.

댓글을 달려면 로그인하십시오.

답변 (1개)

S@m
S@m 2025년 8월 6일
편집: S@m 2025년 8월 6일

1 개 추천

Hi Peter,
The 'Model Linearizer' in the Simulink linearizes the system about an operating point. By default, the initial condition at t = 0 sec is considered as the operating point. When designing the closed loop controller, the model must be linearized about a suitable operating point such as the desired steady state at t = 0.01 sec in this case (check the output response in the scope for steady state - shown in the below figure).
To set the operating point at the steady state, proceed with the below steps.
Step 1: Click on the ‘Operating Point’ drop down menu and select ‘Linearize At…’ option.
Step 2: Enter Simulation snapshot time as 0.01 s and apply. This would pick the state at simulation time 0.01s and set it as the operating point.
Step 3: Click on Bode to generate the bode plot for the linearized model. Observe that the bode plot in below figure now has positive gain over certain frequency range. For transfer function, right click on ‘linsys1’ in Linear Analysis Workspace and choose ‘Open selection’ option.
Step 4: A window as shown below would open up. Select ‘Transfer Function’ in ‘Display linearization result as’ drop down menu.
For more details on setting operating point in Model Linearizer, refer to the examples in the below link:

댓글 수: 1

Peter
Peter 2025년 8월 14일
편집: Peter 2025년 8월 14일
@S@m.. Thank you for your answer. It was really helpful. I followed the steps and I was able to plot the bode. But I have two questions:
Q1: For the bode wrt input voltage, what might be the reason for getting negative gain for the lower frequency sweep? I was expecting a 0 gain.
Q2: I wanted to plot the bode wrt the input duty. I followed the same steps and as you can see, the plot is not correct. It seems like the perturbation has no effect. How can I solve it?

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Linearization에 대해 자세히 알아보기

제품

릴리스

R2023b

질문:

2025년 7월 23일

댓글:

2025년 8월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by