I am trying to simulate a model in SystemModeler from Mathematica 11.3. I wish to simulate this model for various parameter values and make a table of the output data. To attempt this I do the following:

model = SystemModel["rectifier_circuit"]
simulations = 
    SystemModelSimulate[model, 0.025, Method -> {"Heun", "StepSize" -> i}], 
    {i, {PowerRange[0.0001, 0.1]}}]

When evaluating the above, I get the following error:

SystemModelSimulate::smss: Value of suboption "StepSize" should be a non-negative number.

Is there a way to accomplish this task?


closed as off-topic by Chris K, Henrik Schumacher, m_goldberg, KraZug, b.gates.you.know.what Nov 20 '18 at 17:27

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Chris K, Henrik Schumacher, m_goldberg, KraZug, b.gates.you.know.what
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    $\begingroup$ Try removing the extra set of {} around PowerRange. $\endgroup$ – b.gates.you.know.what Oct 17 '18 at 8:27

User b.gatessucks's comment about removing the extra {} surrounding the PowerRange fixes the issue.

Code is now:

simulations = 
 Table[SystemModelSimulate[model, 0.025, 
   Method -> {"Heun", "StepSize" -> i}], {i, PowerRange[0.0001, 0.1]}]

and the output is a table of SystemModelSimulationData as desired.


Not the answer you're looking for? Browse other questions tagged or ask your own question.