Generate BH curve while simulation is running

8 vues (au cours des 30 derniers jours)
Sai Sushma
Sai Sushma le 7 Fév 2025
Commenté : Umar le 8 Fév 2025

I want to observe the magnetisation characteristics of a non linear inductor in matlab. I would like to observe the magnetisation changes in the inductor while the simulation is running. Can anyone help with how to do it or if it is even possible in Matlab or suggest a different software for the same.

Réponses (1)

Umar
Umar le 7 Fév 2025

Hi @Sai Sushma,

Yes, it is indeed possible to observe the magnetisation characteristics of a non-linear inductor in MATLAB. You can achieve this by simulating the inductor's behavior using differential equations that describe its magnetisation dynamics. MATLAB's built-in functions, such as ode45, can be utilized to solve these equations over time. Here’s a simple example to illustrate how you might set up a simulation:

% Parameters
L = 1e-3; % Inductance in Henries
R = 10;   % Resistance in Ohms
V = 5;    % Voltage in Volts
% Non-linear inductance function
L_non_linear = @(I) L * (1 + 0.1 * I^2); % Example non-linearity
% Differential equation
dI = @(t, I) (V - R * I) / L_non_linear(I);
% Time span for simulation
tspan = [0 0.1]; % 0 to 0.1 seconds
I0 = 0; % Initial current
% Solve the differential equation
[t, I] = ode45(dI, tspan, I0);
% Plotting the results
figure;
plot(t, I);
xlabel('Time (s)');
ylabel('Current (A)');
title('Current through Non-Linear Inductor');
grid on;

Please see attached.

This code snippet sets up a basic simulation of a non-linear inductor's current response to a voltage input. You can modify the non-linear function to reflect the specific characteristics of your inductor.

Please click the link below for more information that you are seeking pertaining to your comments.

https://www.mathworks.com/help/sps/ref/nonlinearinductor.html

Hope this helps.

  2 commentaires
Sai Sushma
Sai Sushma le 8 Fév 2025
Hi @Umar,
Thank you for your response. Yes, I have already implemented the desired non-linear inductor where I obtained the desired BH curve using Hysteresis Designer in MATLAB Simulink. However, I want to observe the BH curve while the simulation is running, to observe its magnetization and demagnetization behavior. I hope you got my question.
Best Regards,
Sai Sushma
Umar
Umar le 8 Fév 2025

Hi @Sai Sushma,

I did understand your question and it’s quite possible to observe the BH curve in real-time during your simulation in MATLAB Simulink, you can utilize a combination of scopes and data logging. Here’s a step-by-step approach:

Add a Scope Block: Insert a Scope block into your Simulink model. This will allow you to visualize the magnetic field strength (H) and magnetic flux density (B) in real-time.

Create Data Logging: Use the "To Workspace" block to log the H and B values. Connect this block to the outputs of your non-linear inductor model.

https://www.mathworks.com/help/simulink/slref/toworkspace.html

Configure the Scope: Set the Scope to display multiple signals. You can plot H on one axis and B on another to visualize the BH curve dynamically.

Run the Simulation: Start the simulation. As the simulation progresses, the Scope will update in real-time, allowing you to observe the magnetization and demagnetization behavior of your inductor.

Unfortunately I don’t have Simulink installed so you have to experiment with Somulink blocks to get desired results, it should be very easy to accomplish this task. Hope this helps.

Connectez-vous pour commenter.

Produits


Version

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by