error in modeling pv array block
26 views (last 30 days)
Show older comments
hello,
i design a pv array block and for input i use signal editor for irradiance and temperature from excel with 8760 data for one year. and i get this error. anyone can help me?
0 Comments
Answers (1)
akshatsood
on 10 Dec 2023
Edited: akshatsood
on 10 Dec 2023
I understand that you are encountering an error while running the simulation with the "PV Array" block. The "Derivative state for 1" errors occur when signals in the model cannot be accurately calculated due to the adjusted step size. For instance, when a signal sees a rapid rise, it becomes challenging to capture the signal, despite attempts to increase the step size. As a result, the model provides diagnostics to bring the issue to light and requires user intervention for resolution. I would like to recommend the following two methods to debug and address the issue.
First Method: Inf or NaN output produced at a block
Open your Simulink model and execute the following commaind in the MATLAB command window.
>> get_param(bdroot, 'SignalInfNanChecking')
If the output of the above command is "none," then you should use "set_param" to set the value of this parameter to "error," which can be done through the following command
>> set_param(bdroot, 'SignalInfNanChecking', 'error')
This is done to check for the presence of "Inf" or "NaN" values being produced at the output. If this is the reason behind the error you are encountering, Simulink will generate the following error message.
An error occurred while running the simulation and the simulation was terminated
Caused by:
Block 'BlockName' outputs 'NaN' for element x of output port x at major time step 0
The above message lists the Block Name which outputs 'NaN' or 'Inf' during simultaion. From here, you can debug your model to bypass NaN or Inf values (for instance using a "Switch" block) and address the issue.
Second Method: Modifying the Solver Settings
Open the Model Configuration Parameters by pressing Ctrl+E and then navigate to Solver > Solver selection. From here, update the following fields as given below. A stiff solver is designed to handle differential equations where the solution contains both rapidly changing and slowly changing components.
Type: Variable-step
Solver: ode15s (stiff/NDF)
I hope this helps.
1 Comment
See Also
Categories
Find more on Sources in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!