Hey Alper,
I understand that you are facing an issue when you model a compressor with a published compressor performance map using Grabit code and the MATLAB compressor map module.
The error is saying that Simscape is incapable of solving your system. This can occur for a variety of reasons; however, most often it is caused by a sudden transition within the model. To troubleshoot the issue, you can try the following:
3) Use the Solver Profiler to determine what the solver is doing just before you receive the error. In the step size tab, you should see a graph showing the step spike down as it approaches the time of the error occurring. If you zoom in on that spike there should be more information, such as an indication that there is a zero crossing. The following link contains more information on the Solver Profiler: https://www.mathworks.com/help/releases/R2020b/simulink/slref/solverprofiler.html Please note that this error is very generic and that these steps are only a starting point to help find the cause of the error.
However if you are not using such type of components and are mainly using switches and parasitic components like resistors and capacitors you could find the fillowing information useful:
1.Rapid switching behavior could be the cause of the transient initialization failures. The general ways that you want to approach this type of problem is include smoothing the dynamics, simplifying the equations, and adjusting the solver settings. For e.g. Using a variable resistor and transfer function would smooth the dynamics.
2.Simplify the model: This includes removing unnecessary sensors since these add extra equations, and you can get the plots after running the simulation for e.g using the MATLAB file exchange command ‘ssc_explore’ and combining components. To get more information on this submission please refer to the following link on MATLAB central:
(If you have specific questions about SSC_EXPLORE please contact the author of the submission directly for more information on that file.)
3.Simplifying resistor and capacitor networks: There were instances of five resistors in series could be combined into one, etc. A large bank of capacitors could be next.
4.Tightening solver tolerances: One obstacle in this was that the initial conditions were not quite right. For a capacitor the initial voltage was set to 70,000 kV, and the parallel voltage source was set to 70,000 V. This huge difference only allowed loose solver settings to converge on the first time step. Fixing this issue helped a bit. There are likely other similar issues in this model that might need fixing. Running for a short time and using SSC_EXPLORE to look for any jumping states will give you a clue.
5.Lastly, incremental building and testing: We encourage you to start with a simpler version and gradually build up before it gets to this level. After confirming that it gives expected results at smaller levels (including looking for correct initial states like I mentioned above), you could then start to combine the pieces. This is because debugging small models is always easier.
I hope this helps!