I have an .sbml model I want to simulate using ssa. It works for small timespans, and when using ode simulations. However, in this example matlab simply crashes. Why is this? is there a way of preventing this? % Load model. model_egfr_net = sbmlimport('egfr_net.xml'); % Prepare model for SSA simulations. clean_ssa_sbml_model(model_egfr_net) cs = getconfigset(model_egfr_net); cs.SolverType = 'ssa'; cs.StopTime = 100.0; % Simulate model. [t, x, names] = sbiosimulate(model_egfr_net); I have attached the model. Also, per https://uk.mathworks.com/matlabcentral/answers/1582584-simbio-running-stochastic-ssa-simulation-of-sbml-imported-model the model has to be modified to enable ssa simulations. The attached function (used in the script) is provided here: function [] = clean_ssa_sbml_model(model) parameters = sbioselect(model, 'Type', 'parameter'); for paramIndex = 1:numel(parameters) parameter = parameters(paramIndex); [~, usageTable] = findUsages(parameter); % Update any reaction that uses this parameter in its rate. if isempty(usageTable) % if check added by Torkel. continue end reactions = usageTable.Component(usageTable.Property == "ReactionRate"); for reactionIndex = 1:numel(reactions) reaction = reactions(reactionIndex); oldRate = reaction.ReactionRate; kineticLaw = reaction.KineticLaw; if isempty(kineticLaw) % Add a kinetic law kineticLaw = addkineticlaw(reaction, 'MassAction'); else % Update the existing kinetic law to mass action kineticLaw.KineticLawName = 'MassAction'; end kineticLaw.ParameterVariableNames = parameter.Name; newRate = reaction.ReactionRate; if ~strcmp(oldRate, newRate) warning("Reaction rate for reaction %s changed from %s to %s.", ... reaction.Name, oldRate, newRate); end end end end