关于在Simulink中绘制等效电路Nyquist图的技术问询
How to Plot a Nyquist Diagram for Your Simulink Equivalent Circuit
Hey there! I’ve got two reliable methods to help you generate the Nyquist plot from your existing Simulink equivalent circuit—since you already have impedance vs frequency data, we can build on that easily:
Method 1: Use Simulink’s Built-In Linear Analysis Tool (Quick & Easy)
If your equivalent circuit is linear (which most impedance models are), this is the fastest way:
- First, add Inport and Outport modules to your model: connect the Inport to your input excitation (e.g., a sinusoidal current source) and the Outport to the voltage response (from which you calculate impedance).
- Open the Linear Analysis Tool via the top menu:
Analysis > Control Design > Linear Analysis Tool. - In the tool’s interface, select your Inport as the input signal and Outport as the output signal. Set the frequency range to match the one you used for your impedance vs frequency curve.
- Run the frequency response estimation. Once complete, look for the Nyquist Plot option in the results viewer—click it, and your Nyquist diagram will generate instantly. You can customize the plot (add grids, labels, or adjust line styles) directly in the viewer.
Method 2: Export Data to MATLAB Workspace for Custom Plotting
If you want full control over the plot’s appearance or have a nonlinear circuit, this method works great:
- Add a To Workspace module to your Simulink model. Configure it to output either:
- Separate signals for the real part and imaginary part of your impedance, or
- The full complex impedance value (set the "Save format" to
ArrayorStructure with time).
- Run your simulation with the same frequency sweep you used for the impedance curve. This will export your impedance data to the MATLAB workspace.
- In the MATLAB command window, use these lines to plot the Nyquist diagram (replace variable names with your actual data):
% Assume Z is your complex impedance array, freq is your frequency vector plot(real(Z), imag(Z), 'r-', 'LineWidth', 1.5); grid on; xlabel('Real Impedance (\Omega)'); ylabel('Imaginary Impedance (\Omega)'); title('Nyquist Diagram of Your Equivalent Circuit'); % Optional: Add frequency markers for key points text(real(Z(10)), imag(Z(10)), ['f = ', num2str(freq(10)), ' Hz'], 'Color', 'blue'); - This plots the imaginary part of impedance against the real part—exactly what a Nyquist diagram shows.
Quick Tips
- Make sure your frequency sweep includes enough points (especially in critical frequency ranges) to keep the Nyquist curve smooth.
- For nonlinear circuits, use a slow frequency sweep in Simulink to ensure each frequency reaches steady state before capturing data—this will make your impedance measurements (and Nyquist plot) more accurate.
内容的提问来源于stack exchange,提问作者C.Flink
相关产品推荐
相关产品推荐

