Failed to evaluate mask initialization commands. Error using Simulink.S​imulation.​internal.D​esktopSimH​elper. Interpolation requires at least two sample points for each grid dim

56 views (last 30 days)
I'm getting several errors in Simulink when I pass several workspace variables (configuration voltages, capacitance) to the following Simscape- Specialized power sources components:
Supercapacitor.
Fuel cell stack.
"Error in Supercapacitor2': Failed to evaluate mask initialization commands. - Show complete stack trace
Error using Simulink.Simulation.internal.DesktopSimHelper
The sample points must be finite.
Interpolation requires at least two sample points for each grid dimension."
Example Code:
mdl="MyModelFuelCellSupercapacitor.slx";
vars="vars.mat";
save vars;
simIn=Simulink.SimulationInput(mdl);
simIn=loadVariablesFromMATFile(simIn,vars);
out=sim(simIn);
%Process data
Mask menu:
when I write a numeric value directly at the mask menu of the component, the simulation runs, but for me It's impractical as tens of paramatric combinations are needed. I want to avoid downgrading the Matlab local version.
Estatus: Powergui in discrete mode. Matlab 2024b. Simscape used. Specialized power sources. It seems worked in Matlab 2023b.
Thanks in advance for your comments.
  1 Comment
Aravind
Aravind on 20 Nov 2024 at 6:12
Hi @Jorge,
I was able to replicate the error you mentioned, and it appears to be due to incompatible parameter values rather than the use of variables. According to the documentation at https://www.mathworks.com/help/sps/powersys/ref/supercapacitor.html#mw_2f24b197-1e9a-4d9a-8f5a-e59c50bee87a, there have been changes in the internal implementation of the "Supercapacitor" block in MATLAB R2024b.
The error message indicates that the problem originates from the mask initialization code, which calls an internal MATLAB function. With the recent changes in internal implementation, it seems there might be an issue in the function causing invalid or incorrect interpolation, leading to the error you are experiencing.
Through some testing, I discovered that the "Equivalent DC series resistance" parameter often triggers this error, especially when set to a low value. In the image you shared, the "Equivalent DC series resistance" is set to 1e-6, which is quite small. I recommend increasing this value, if possible, as it could prevent the error.

Sign in to comment.

Answers (0)

Categories

Find more on Composite Components in Help Center and File Exchange

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!