- If you are using 'Variable Step Solver' which does not have a fixed step-size, then ensure that the minimum step size and maximum step size are defined appropriately with respect to simulation stop time. Because if maximum step size is too small compared to the stop time of model, then too many values are computed for each signal being logged.
- Either you can reduce the stop time to a similar order of magnitude as of maximum step-size or you can change the solver type to 'Fixed-step' and set the fixed-step size manually.
Error Using OptimizationObjects.ProjectionBasedOptimizer/projection (line 6) - Memory Error
4 views (last 30 days)
Show older comments
The Situation:
When trimming and linearizing a large Simulink model, we are consistantly running into memory problems with MATLAB that is causing it to crash.
Couple of notes:
- It is a large simulink model with a lot of unit delay, delay, rate transition blocks
- I have already went through the entire simulink sim and removed all data logging but I am still getting an error about "Data logging exceeded available memory" and "Cannot allocate sufficient memory for logging. Consider disabling logging or reducing the length of the simulation"
- We are using two optimization algorithms with fmincon, 1. interior-point and 2. SQP, and trying multiple attempts to trim the model for one flight condition
- We have a few sfunctions within the simulink model, two are large, the addition of one of the two large models to the simulink model that is being trimmed and linearized has made this issue worse
- We are using fastRestartForLinearAnalysis
- Reference the picture below for the error that I was able to catch
Now the questions:
- Is there something with fastRestartForLinearAnalysis that is causing memory to be used up that we cannot see? (using the task manager on the pc, it doesnt appear that the full memory is being used/allocated)
- Could this be caused by our choice of optimization algorithm? I have already read the "Choose the Algorithm" page which suggests that using SQP with this large scale optimization could cause issues
- What else could it be?

0 Comments
Answers (1)
Divyanshu
on 23 Jan 2025
Although you have removed the data logging from entire model, the another cause of the error can be the stop time and step size defined for the model. Check for the solver type defined in the configuration parameters at the following path:
'Configuration Parameters > Solver > Solver selection > Type'.
For more information about solvers, you can refer the following documentation links:
0 Comments
See Also
Categories
Find more on Manual Performance Optimization 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!