Pancy Lwin in MATLAB Answers
Last activity on 5 Apr 2024

Hello All, I am having this error in my code. --> Error reported from ODE Compilation: Initial assignment rules and repeated assignment rules cannot create explicit or implicit algebraic loops (for example, 'x = y' and 'y = x'). Implicit references to compartments occur when referencing a species in concentration. The following rules introduce algebraic loops into the model: The equation is to calculate the mitocondria voltage based on the chemical pumps and electrodefusion. however, the reaction rates for these pumps depend on the miltocondria voltage. As a result, my code has algebraic loop problem. How should I work around this issue?
emjey in MATLAB Answers
Last activity on 2 Mar 2020

I run many simulations in a loop (global sensitivity analysis) and would like to terminate stuck simulations by setting 'MaximumWallClock' (there parameter sets which make a model stiff and difficult to solve). Is there a build in way to flag simulations terminated in such way? The reason for this is that I need to discard those results because it would falsify the analysis outcome.
emjey in MATLAB Answers
Last activity on 3 Sep 2019

To perform a sensitivity analysis I am running *.sbproj coded models using 'biosimulate' in a for-loop and see for some parameter combinations the following warning: Warning: The right-hand side of the system of SimBiology ODEs results in complex numbers. The imaginary part of the result will be ignored. > In sbioodeflux_298d036b_ba03_4469_9210_25b32c7bbb2b (line 44) In sbiosimulate (line 140) In GSA (line 107) Can I trust the solutions? If not, how can I exclude the solutiuons which resulted in the warning above, i.e. is there a way to find programatically if a warning was produced? Update I added assignment of NaN's in case of fatal errors but still don't know how to handle the warnings. try ... [t,y] = sbiosimulate(m1); f1(i,j) = trapz(t,y(:,varNo)); % f1 AUC f2(i,j) = y(end,varNo); % f2 endPoint catch me disp( getReport( me, 'extended', 'hyperlinks', 'on' ) ) f1(i,j) = NaN; f2(i,j) = NaN; disp('Found an error-----------------------') end
Kevin Rodden in MATLAB Answers
Last activity on 9 Jun 2016

As per my question, I would like to be able to set up an output function to use with sbiosimulate. I couldn't find anything from my bit of online searching nor from the sbiosimulate documentation. If anyone who is more familiar with SimBiology could send an example I would appreciate it. For some reference, I am trying to set up a code to sample a parameter space and evaluate if a given position is viable (as in doesn't fail to evaluate or take too long to solve). The latter point is where I am having my issue as I don't know how to set up a timeout function without using the method from this post: How can I set a timeout for slow executing codes?. Also, the model I am using is rather large (~40 species, 150 parameters) so I would prefer to not have to convert it for use with the ODE solver suite. Thanks for any help or pointers you can give!
Scott Daniel in MATLAB Answers
Last activity on 31 Oct 2012

I know that I can set the MaxStep in the simulation settings for a sbiomodel: as in: set(cs1.SolverOptions, 'MaxStep', 0.1); % Initialize configset for analysis run. cs = getconfigset(m1, 'default'); % RUNSIMULATION simulate SimBiology model, m1. % Run simulation. data = sbiosimulate(m1, cs, [], []); How can I set the step size to a constant number instead of just a maximum?