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!