Question on specifying input to sbiosimulate
6 次查看(过去 30 天)
显示 更早的评论
I'm using sbiosimulate to solver the model loaded from an xml file
[t, x, names] = sbiosimulate(modelObj);
modelObj has the following
Model Components:
Compartments: 3
Events: 0
Parameters: 193
Reactions: 40
Rules: 5
Species: 60
I want to change the values of 10 parameters present in modelObj while calling sbiosimulate.
Could someone suggest how this can be done?
For example,
While using ode15s I can easily do this using
ode45(@(t,z)model(t,z,c), tSpan, z0);
Where c is the vector containing the values of the 10 parameters.
Any suggestions?
0 个评论
回答(2 个)
Jeremy Huard
2019-4-29
编辑:Jeremy Huard
2019-4-29
There is multiple ways to do this:
1- if you want to run multiple simulations, I recommend to use a SimFunction that will take a matrix of parameter values as input. Please refer to this post: Tips and Tricks: Use SimFunction for easy and fast model simulations in scripts
2- if you run a single simulation, you can create a variant with sbiovariant, add content to it with addcontent and pass it to sbiosimulate. When you pass this variant to sbiosimulate, the values in this variant will be used for simulation instead of the values stored in the model.
An easier way to create it is to use the App.
3- you can modify parameter values in the model itself. For this, you can use sbioselect to select the object corresponding to your parameter and change its value with the dot notation (parObj.Value). However, I don't recommend this method because this change will persist for the rest of your analysis, which might not be what you want.
3 个评论
Jeremy Huard
2019-4-29
编辑:Jeremy Huard
2019-4-29
Hi Deepa,
let's please focus on one single thread because all your questions are spread over mutliple threads and one looses the context of your original question.
Let me summarize my recommendations here:
- in my opinion, you should forget the idea of using nonlinear constraints because you're constraining your simulation over the whole timespan. What really interests you is that your system reaches a steadystate that corresponds to your data.
- I strongly recommend to use sbiofit that will give you access to confidence intervals. This will be great to evaluate the identifiability of your parameters.
- I strongly recommend to use the App if you're new to SimBiology. I like to program myself but I use the App every day as it makes me more efficient. Once I have set a task, you can generate the code associated to it if you want to capture this in a script.
- To use sbiofit (or the fit task in the App, which is the same thing), generate a table with one line for a time that you think is long enough for your system to reach steady state.
- If you're unsure about this time and prefers to use sbiosteadystate, which tries to compute the steady state algebraically, this is fine. You can use sbiosteadystate in an objective function that you pass to fmincon or lsqnonlin.
- Whether you use the method in 4 or 5, you can call sbiosteadystate after your optimization with the optimized parameter values to get the species concentrations at steady state. They will be saved in the variant returned by sbiosteadystate. Then you use it to start simulation at steady state.
- Whether you use 4 or 5, you won't need to use SimFunction. But SimFunction are an alternative to sbiosteadystate in the objective function if you simulate long enough.
Jeremy Huard
2019-5-2
Hi Deepa,
there might be different reasons to get this error message. A typical one is when one of the fluxes becomes Inf or NaN, for instance when it contains a division by 0. Another reason could be that you use a proportional error model for data that gets close to 0. If this is the case, you can try whith a constant error model.
Checking the valus of fluxes might be tedious. Maybe I can help if you can share your SimBiology file.
2 个评论
Jeremy Huard
2019-5-2
Hi Deepa,
please send your model to jhuard at the domain of this website.
Thanks
社区
更多回答在 SimBiology Community
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Scan Parameter Ranges 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!