ask intergral and derivate
Afficher commentaires plus anciens
One of the voltage equations in the LCL grid-connected inverter is as follows. This is an equation transformed into the synchronous reference frame.

To summarize this,


I can organize it in these two ways. One is the voltage equation that was first defined, which includes the differential term. The second is the iq2 current, which is integrated on both sides.
I made each equation into a simulated link equation. However, the result is different. Equations with differentials represent the correct values, but equations with integrals represent completely different values.
Please let me know what I need to do to express this
- integral equation block

- Derivative equation

Result :

10 commentaires
Sam Chak
le 18 Fév 2025
Hi @승표
The differential equation appears relatively straightforward. If you can provide the constants in the equation and the initial value of the current, we can assist in simulating it in MATLAB using ode45 and subsequently compare the results with those obtained from Simulink.
승표
le 18 Fév 2025
승표
le 18 Fév 2025
Sam Chak
le 18 Fév 2025
Thank you for your response. However, I am unable to simulate it in MATLAB due to the missing values of
and
. Could you please provide the constants? Additionally, I believe that the d-axis current
should be a time-varying signal and is described by a different ODE,
that is coupled with the q-axis current
.
function diq = ode(t, iq)
% Parameters
L_con = 0.005; % unused
R_con = 0.001; % unused
L2 = 105.56e-6;
R2 = 10e-3;
R_LCL = 1; %1 % unused
C_LCL = 50e-6; % unused
omega = 377;
Vgrid = 220*sqrt(2/3);
Vcap = Vgrid;
% id = ; % unavailable (probaby a state variable)
% Eq = ; % unavailable
% ODE
diq = (Vcap - R2*iq - omega*L2*id - Eq)/L2;
end
승표
le 19 Fév 2025
Sam Chak
le 19 Fév 2025
Hi @승표
Initially, I considered simulating the given 1st-order differential equation in MATLAB without using Simulink and subsequently comparing the results with the plots you obtained from Simulink. Today, I reviewed your Simulink model, and I found that your problem is much more complicated than I had anticipated. Unfortunately, I do not have Simscape Electrical, so some of the blocks will not function properly. Without a complete mathematical model of the LCL grid-connected inverter, I cannot use ode45 to solve the model.
You should always verify that the response from the Simscape model matches the response obtained from simulating the mathematical model using MATLAB's ode45 function.

승표
le 19 Fév 2025
Sam Chak
le 19 Fév 2025
Hi @승표
The differential equation (also known as the state equation, where
is the state variable):
can be rearranged to transform it into an integral equation form:

The Leibniz integral notation ∫ indicates that you should use the continuous-time Integrator block.

The input port is where you should input the 'integrand' mathematical expression, while the output port returns the q-axis current signal
. Note that the 'integrand' includes the state variable
, which implies that the output
should be fed back into the 'integrand' through a feedback loop. However, I do not see any feedback loop in your Simulink model.
Before running the simulation, remember clicking on the Integrator block to enter the initial value of the state variable at time
, denoted as
.

Yifeng Tang
le 19 Fév 2025
Modifié(e) : Yifeng Tang
le 19 Fév 2025
I'm afraid this is beyond my domain knowledge. I'm a mechanical engineer, and know very little about three-phase AC :p
The "example" model has a missing parameter omega, but it looks like whatever value I put there I'm getting a decreasing signal with some oscillation, while the other scope shows just oscillation.

This makes me wonder whether you have a constant somewhere in your integrand that needs to be zero-ed out first.
Sorry, just my random thoughts. I have no intuition which one is correct :(
승표
le 19 Fév 2025
Réponses (1)
Sam Chak
le 20 Fév 2025
0 votes
Hi @승표
I used the ordinary differential equations (ODEs) from this PMSM example because they are similar to your case. Specifying the ODEs using the Fcn block with appropriate labels is much easier to troubleshoot than adding multiple fundamental blocks, which may obscure your ability to trace signal flows in Simulink.
In the block diagram, there is a clear feedback loop that sends the outputs
and
, along with the other defined parameters, back to the ODEs in the Fcn blocks. In this example, the number of pole pairs (P) is assumed to be 1 for simplicity, and I directly specified it in the Fcn blocks without labeling it. The constants are somewhat unrealistic in this example, but you can modify them to suit your LCL grid-connected inverter.
I would also like to thank @Yifeng Tang for his response. I rarely use Simulink nowadays, so any tips or advice to help the OP improve modeling skills in Simulink/Simscape would be appreciated.



1 commentaire
승표
le 20 Fév 2025
Catégories
En savoir plus sur Electrical Sensors dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


