An error in my model Simulink model

22 views (last 30 days)
David
David on 10 Dec 2024
Commented: David on 12 Dec 2024
=== Simulation (Elapsed: 3 sec) ===
pulse =
1
Error:An error occurred while running the simulation and the simulation was terminated
Caused by:
Derivative of state '1' in block 'chargecontrol/PV Array/Diode Rsh/Transfer Fcn' at time 0.0 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances) I am getting the following error while running the above model with a PV array and I see no error if I put a constant DC source what is this eeror and how to solve it
  5 Comments
David
David on 10 Dec 2024
I did made changes in the function of PV model but it is not working but what could be another way to do a charge controller with PV?
JinWook Park
JinWook Park on 12 Dec 2024
I think the problem is caused by the fact that the solver is Discrete and the powergui is Continuous.
Set the two types to the same

Sign in to comment.

Answers (1)

Yukthi S
Yukthi S on 12 Dec 2024
Hi @David,
I figured out that the Simulink model you have shared has a singularity condition. To know that, navigate to Configuration parameters>Diagnostics>Data Validity and set Inf or NaN block output to error and run the model step by step. I got the below error message at time T=0:
An error occurred while stepping through the simulation and the simulation was terminated
Caused by: Block 'chargecontrolpvarray/PV Array/Diode Rsh/Math Function' outputs 'Inf' for element 1 of output port 1 at major time step 0
To check why this is happening, I displayed the values of in-ports and out-ports of Math Function as shown below:
It is found that the value of {V_diode} being too high is responsible for high value input to the Math Function block. That is likely the reason for singularity error in the model. To fix this, adjust the model to reduce the {V_diode} value. This should help resolve the error.
  1 Comment
David
David on 12 Dec 2024
Thanks @Yukthi S I understood the problem thanks to your explanation. But as I was using an inbuilt pv array I could not change the value of {V diode} and I tried to adjust the temperature and irradiance to see if it makes any difference but nope. I think I will have to build a PV array manually in order this to work. Thanks anyway.

Sign in to comment.

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!