Christopher Nogiec in MATLAB Answers
最後のアクティビティ: 2023 年 10 月 20 日

The ultimate goal is to make a hybrid dynamic model and a steady-state model. So, at each step, the model runs, one of the species will be the input to the steady-state model that runs using LP, but doesn't affect I have a species that calls a repeated assignmet and I made a custom MATLAB function that uses linear programming (glpk). I even set it so that the actual function doesn't affect the model. However, I think the glpk is messing up with the ODE solver. When I don't call the LP solver, the model runs as expected. Are there setting that I can adjust to limit this? I already tried disabling absolute tolerance scaling. Would there be another LP solver that wouldn't interfere? Does MATLAB have a built in LP solver? I'm using Matlab and Simbiology 2020b on Windows 10
Silvia Casillas in MATLAB Answers
最後のアクティビティ: 2021 年 11 月 24 日

I don't know if my question is a bit silly but, I have a model of a biological system and I have already all the ODEs of the system, but I want to use Simbiology to simulate them to get also an sensibility analysis, the problem is that I don't know if there is a way to work with these ODEs directly in Simbiology or how I have to process the model to get another representation. As an example I have the equations: dCd/dt = a1*GF-sd*CD dR/dt= -k1*R*E+k-1*RE-piu*CD*R ...
Tessa Warmink in MATLAB Answers
最後のアクティビティ: 2021 年 10 月 3 日

Hi there! I am building a model in SimBiology where I want to model the production gas vesicle proteins and subsequent formation of gas vesicles. Ideally, I want to model this such that there is a boundary condition where an X amount of gas vesicle proteins (or above the essential concentration) will lead to an assembly reaction. I tried this by adding the chemical reaction: X [Gas vesicle protein] -> [Gas vesicle] However, this leads to a negative values for the gas vesicle species. Is there a way in which I can set a condition for this reaction to occur (for example require that enough gas vesicle proteins are present in order for the reaction to be active)? Or could there maybe be a better way to solve this? The model I'm building is a stiff model, and I am using the sundials solver. Thank you in advance!
Brandon Johnson in MATLAB Answers
最後のアクティビティ: 2021 年 7 月 23 日

Hi, I am learning to use SimBiology to streamline generating model equations for my metabolic network. I have 13C and 14C metabolite labeling data obtained from pulse chase labeling of tobacco plants and am just not sure which toolboxes will be useful for analyzing the pathways within the network. I'm pretty sure I should install the optimization toolbox and ODE/PDE toolboxes but what else should I begin learning how to use within SimBiology? I will use the SimBiology interface to generate the pathways/compartments etc. and then I will convert to MatLab code to populate a script with the model equations. Where do I find guidance on these very tedious tasks to gain a more complete understanding of the Simbiology to MatLab integration? I'm doing my PhD in my 4th year and really want to understand the computational techniques I need to generate useful models to fully utilize all the bench time I've spent gathering data through experimentation. Will someone point me in a direction that I can integrate my knowledge of metabolism with the power of computation in Matlab?!??! Thank you all and have a great day/night!
Leo Garaffa in MATLAB Answers
最後のアクティビティ: 2021 年 6 月 7 日

I'm building a mathematical model for a biological process. I have a set of ODE's ready for analysis, but I can't find a way to give these equations straight to the Simbiology analyser withouth first creating a diagram in the Simbiology model builder and hoping the ODE it spits out is the same as the one I already have. Is there a way to do this?
Ben in MATLAB Answers
最後のアクティビティ: 2021 年 3 月 15 日

Hello, I have a question regarding the regression tools in SimBiology. I have an ODE model which I would like to fit for a given dataset using sbiofit or sbiofitmixed. When i want to find some parameter set using sbiofitmixed, the ODE model can return with invalid values (e.g. complex, NaN or Inf) which completely halts the search process. My experience with sbiofit is that the algorithms can recover from these values (as opposed to sbiofitmixed) for the vast majority of cases, but in some occasion the procedure still halts. Even if I set bounds on my parameters, there could be a (hidden) nonlinear relationship which makes the ODE invalid for a specific combination of the fitted parameter values. The following error message can occur using sbiofitmixed: Error using sbiofitmixed (line 249) A simulation errored or returned NaN, Inf, or complex values during parameter estimation. This typically indicates that the estimated parameter values converged to values that are invalid for the model. My question is if there is any way to recover sbiofitmixed from these parameter values? For example defining an event during the ODE simulation which stops the integration. It would be nice, if there was a way to find a different trial point for the current iteration in such cases for the algorithm. Bonus question: Is there any 'best practice' in the literature to handle these situations? For example if I code the algorithm by hand, I could just stop the integration if some state variable exceeds some given value. At these instances I could just set the cost function to some high value (for example 1e5), however I have a gut feeling that this is not the best solution for this issue. Thank you in advance, Ben
Ben in MATLAB Answers
最後のアクティビティ: 2021 年 2 月 16 日

Hello, I have a question concerning of the use of simbiology adddose (or sbiodose) commands. I have defined a compartment, and four species (that will be my state variables in the model). I have also defined a bunch of parameters and added to the model. After this step, I have explicitly defined four differential equations that describe my model. (I did it in this way since I have no proper background in reactons and stuff). My goal was to simulate the system with a prespecified dosing scheulde that came from an experiment. When i create my dose and want to specify the target name as 'x3', matlab throws an error: 'Invalid dose target 'x3' in dose 'd'. This object cannot be the Rule variable of any rule'. I checked the documentation and forums but I haven't found anything related to my issue. Any help much appreciated, code supplemented below. [a1,b1,c1,ED501,k11,k21,n1,w1,x10] = getParams(1); %This get some exact values %This part of the code gets the injection times and amounts from the experiment load('measurements.mat'); measurement = measurement{1}; mouseID = measurement.vMouseID{1}; tInjections = measurement.tMeasurement{1}; vMeasuredVolumes = measurement.vVolumePhysCon{1}; vInjectionDose = measurement.vDose{1}; doseIdx = find(vInjectionDose ~= 0); m = sbiomodel('m'); comp = addcompartment(m,'comp'); %State variables, input, output x1 = addspecies(m,'x1','InitialAmount',x10); %Living x2 = addspecies(m,'x2','InitialAmount',0); %Dead x3 = addspecies(m,'x3','InitialAmount',0); %Conc x4 = addspecies(m,'x4','InitialAmount',0); %Periph Conc u = addspecies(m,'u','InitialAmount',0); y = addspecies(m,'y','InitialAmount',x10); %Model parameters a = addparameter(m,'a','Value',a1); b = addparameter(m,'b','Value',b1); n = addparameter(m,'n','Value',n1); w = addparameter(m,'w','Value',w1); ED50 = addparameter(m,'ED50','Value',ED501); c = addparameter(m,'c','Value',c1); k1 = addparameter(m,'k1','Value',k11); k2 = addparameter(m,'k2','Value',k21); %Differential equations dxdt1 = addrule(m,'x1 = (a-n) * x1 - b * ((x1*x3)/(ED50 + x3))','RuleType','rate'); dxdt2 = addrule(m,'x2 = n * x1 + b*((x1*x3)/(ED50 + x3)) - w*x2','RuleType','rate'); dxdt3 = addrule(m,'x3 = -(c + k1)*x3 + k2*x4','RuleType','rate'); dxdt4 = addrule(m,'x4 = k1 * x3 - k2*x4','RuleType','rate'); y = addrule(m,'y = x1 + x2','RuleType','repeatedAssignment'); %Add dose - this is where things go south for me d = sbiodose('d','schedule'); d.Amount = vInjectionDose(doseIdx); d.Time = tInjections(doseIdx); d.TargetName = 'comp.x3'; d.Active = 1; [t,x,names] = sbiosimulate(m,d); plot(t,x(:,1:4)) Best regards, Bence EDIT: I forgot to mention, that my goal was to direcly inject the drug into species 'x3' with an impulsive action (bolus administration), but the ode solver does not permit such, since 'x3' is a rate variable. My guess is that this can be possible somehow by defining it as a reaction, but dxdt3 and dxdt4 is the clearence equations that I want x3 to satisfy.
Tiziano in MATLAB Answers
最後のアクティビティ: 2020 年 11 月 4 日

Hello! I'm a PhD student from EPFL, I'm currently working with Matlab to try to model a simple double feedback loop in order to observe bistability, for this purpose I've built this set of ODEs: function dy = model_equation(t,y) dy = zeros(4,1); sCDC2i=1.0; dCDC2i=1.0; sWEE1i=1.0; dWEE1i=1.0; a1=1.0; a2=1.0; b1=200.0; b2=10.0; v=1.0; g1=4.0; g2=4.0; k1=30.0; k2=1.0; CDC2a=y(1); CDC2i=y(2); WEE1a=y(3); WEE1i=y(4); dy(1)=a1*CDC2i-b1*CDC2a*(v*WEE1a)^g1/(k1+(v*WEE1a)^g1); dy(2)=sCDC2i-dCDC2i*CDC2i-a1*CDC2i+b1*CDC2a*(v*WEE1a)^g1/(k1+(v*WEE1a)^g1); dy(3)=a2*WEE1i-b2*WEE1a*CDC2a^g2/(k2+CDC2a^g2); dy(4)=sWEE1i-dWEE1i*WEE1i-a2*WEE1i+b2*WEE1a*CDC2a^g2/(k2+CDC2a^g2); this set of ODEs is solved and plotted with the following commands: function A = modelSim(time) [T,Y]=ode15s(@model_equation,[0 time],[0 1.0 0 1.0]); plot(T,Y(:,1),T,Y(:,2),T,Y(:,3),T,Y(:,4));hold on; hleg1=legend('CDC2a','CDC2i','WEE1a','WEE1i'); set(hleg1,'Location','NorthEastOutside'); hold off; A=[T,Y]; Now the problem is that the system is not bistable, but I've a species (CDC2a) that tends to accumulate and never reaches steady state. I was thinking that I had made some mistake while I was writing the model, but after several controls, I found that there aren't mistakes in the model. So I've tried to use simbiology, I copied and pasted the ODEs from the .m file to Simbiology, set all the parameters as in the ODEs file, and the model started to work correctly, I got exactly the results I wanted! So I started to check for difference between the Simbiology model and the .m file, this is what I've found: * ODEs are exactly the same * parameters and costants are exactly the same * ode solver and its options are equal * the ODEs system in the .m file is solved trough "[T,Y]=ode15s(@model_equation,[0 time],[0 1.0 0 1.0],options);" while in simbiology the given command is "data = sbiosimulate(m2, cs, [], []);" (where m2 is the model and cs the options for the solver) Now I can't figure out what is happening, I've tried in many different ways to get those results to be the same but I wasn't able to do it. In order to continue my project I need to know at least why I obtain different results, and which one to trust. Any help will be much appreciated because at this point I'm running out of ideas! thank you very much in advance!
Jeremy Huard in File Exchange
最後のアクティビティ: 2019 年 4 月 25 日

Imports ODE models in the BerkeleyMadonna(TM) format into a SimBiology(R) model
mary in MATLAB Answers
最後のアクティビティ: 2019 年 4 月 15 日

Hi, Could someone explain me how I can use the sundials solver (CVODE), through my use of simBiology toolbox ? I know ODE solvers of Matlab and I used to use ODE15s. However, the latter fails in integration of stiff problems. So, I tried to use CVODE solver. The same issue occurs (if you are interested to know more about that please see my post on sundials forum : http://sundials.2283335.n4.nabble.com/force-the-CVODE-solver-to-continue-despite-the-error-test-failed-repeatedly-or-with-h-hmin-td4655576.html ). So, I ended up with the following troubleshooting solution being suggested for the very same solver included in SimBiology package ( https://nl.mathworks.com/help/simbio/ug/troubleshooting-simulation-errors.html ). Here you can see that they talk about two options of MaximumNumberOfLogs and MaximumWallClock, the use of which can help to avoid this problem. So, as I can not find these two options in CVODE directly downloaded from https://computation.llnl.gov/projects/sundials/sundials-software , I thought maybe these two options are only available in the SimBiology. Now, the problem is the following : there is no enough information/tutorial on this tool. How I can chage the following line to make use of SimBiology ? [T,Y]=ode15s(@source_terms,[0 tend],yinitial,options); I appreciate a lot your help, Best regards, Mary
Alexander in MATLAB Answers
最後のアクティビティ: 2019 年 4 月 1 日

I would like to define a custom ode stopping event for the solver of a SimBiology model. How to achieve that? Say, I want to write some event function, like described in https://de.mathworks.com/help/matlab/math/ode-event-location.html and set isterminal conditioned at specific values of my concentrations, the model of which is defined by the SimBiology toolbox. Where is the option located (or, how to export the code in the needed granularity) where I can provide my event function?
MathWorks SimBiology Team in File Exchange
最後のアクティビティ: 2017 年 11 月 21 日

SimBiology model and code to perform CI and NCA analyses, and optimization using parallel computing.
Matthew Merritt in MATLAB Answers
最後のアクティビティ: 2015 年 9 月 24 日

I am interested in using simbiology to simulate ~96 to ~144 different chemical reactions related to the TCA cycle. They would all be solved simultaneously. I just tried out the simbiology toolbox. It seems very powerful, but I just did some very basic rxn kinetics. Does anyone have experience with simbiology? Could I expect it to handle this many equations simultaneously? I make the approximation that most reactions are first order, though some of them will be "ping-pong". Would such a simulation run faster if I just wrote it myself in matlab? Does simbiology put extra overhead on the processes? I would probably want to run the simulation for 100 to 500 different time points.
al in MATLAB Answers
最後のアクティビティ: 2014 年 11 月 12 日

Hi There, I recently read a paper related to mathematical modelling of a biological system. All the ODEs were there in the article, so I tried to reproduce the dynamics of the model using “SIMBIOLOGY’ toolbox. It worked well and all the dynamics were similar to ones in the article. Later, I tried to write the code by myself (without using toolbox). Since it was my first time working with ODE functions in Matlab, I read the corresponding help documents in Matlab and tried to write the code. Surprisingly, the time course of results are completely wrong! I double check all the equations and other things (initial values and parameters) but everything was correct. I attached the simbiology file as well as the code I wrote. There are some equations that have “time” at the right side of equation like: dY25/dt = k60 + (k61 * Y27) – (deg(t) * Y26) … and deg(t) is a function of time (I attached the corresponding file). I read a post about this problem (of having time at the right side of equation) and did the same as the offered answer, but the problem is still remained! Do you think the problem is related to that? Can you please tell me what the problem is why the dynamics of Simbiology and Matlab script are different? Can you please have a look at the overall structure of my script to see if I did a mistake (I am not talking about details, just the overall structure of writing a code to solve a set of ODEs)? Another strange thing is that when I use the time span of [1:8000], which has 8000 time points, the results (dynamics) come out fast but when I use another time span [1: 60 :86400] , which has 1441 time points, the system will be very slow! Why is that? I used the same process for a simpler model (mitotic oscillator), which is available in simbliology, but never get the correct dynamics (the corresponding file is mitotic_model). Thanks you,
Zoltan Tuza in MATLAB Answers
最後のアクティビティ: 2013 年 8 月 1 日

Hi Everyone, I have a large stiff reaction network in Simbiology, which runs smoothly in R2010a with ode15s solver. I tested the code in R2012b and R2013a where the ode solver fails (all of them). A "very detailed" error message says: Error using SBCompiler.SimulationObject/simulate Integration Tolerance Not Met. If I export this model into SBML and back to matlab as an ODE function (calling ode15s() function), it runs without a problem in R2013a (using default ODE 15s settings). I was wondering is there any way to change the relTol, absTol settings for Simbiology simulations (configset obj)? It seems that way the (absolute/relative) tolerance settings for ode15s() and Simbiology's ode15s call are different. Thanks!
I in MATLAB Answers
最後のアクティビティ: 2013 年 2 月 9 日

Hi, I'm trying to numerically solve a set of ODEs and got a problem with numerical stability of my solutions. Simplified version of my actual problem (sufficient to illustrate the problem) consists of 2 ODEs for functions n(t) and nc(t). The equations to be solved are: * dn/dt = -alpha*(n+nc)*n + nc/tau + gamma*n * d(nc)/dt = alpha*(n+nc)*n - nc/tau + gamma*nc where alpha, tau, gamma and nu are constants set numerically. Both n(t) and nc(t) grow exponentially due to the last term while the first two terms represent a model of conversion between two species. Specifically, I have alpha=1e-9, tau=150, gamma=1e-5, nu=9000. Initial conditions are n(0)=100, nc(0)=0. I'm using a SimBiology toolbox that uses MATLAB's standard ODE solvers. As far as I can tell, the problem comes from the fact that the first two terms always add to approximately zero (and I want them in the model because later I'd like to choose parameters such that they wouldn't add to zero). This is because the time scale at which the steady state between the first two terms is reached is shorter than 1/gamma. Just as an example: at some point in time, alpha*(n+nc)*n would be about 10^8 and -nc/tau would be about -10^8. The problem then comes from the fact that we're subtracting two very large numbers that are very close to each other. And as the error in the estimate of their sum grows it eventually becomes so large as to produce non-sensical results: both n(t) and nc(t) eventually stop growing (and they should continue exponentially). Since it's not a very demanding simulation, ideally I'm looking for a way to improve the precision in calculating n(t) and nc(t). I've tried changing the MaxStep size, Relative and Absolute Tolerance, but without success. I appreciate any suggestions. Thank you.
Scott Daniel in MATLAB Answers
最後のアクティビティ: 2012 年 10 月 31 日

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?
Leslie in MATLAB Answers
最後のアクティビティ: 2012 年 1 月 25 日

I've built a model in SimBiology that I'm trying to simulate, but none of the ODE solvers provided are able to simulate past a certain time interval. Does anyone have any advice on how to proceed?