Convert SimBiology model to script format.
7 ビュー (過去 30 日間)
古いコメントを表示
Is there any way to import a SMBL using SimBiology (either code or GUI) then automatically produce the code for that model in script form. My aim here is to be able to import an SBML that I made using CellDesigner and simulate multiple times with randomly generated initial values (something that seems hard to do with the GUI alone).
Thanks
0 件のコメント
採用された回答
Rick Paxson
2015 年 1 月 13 日
There are a couple of ways of doing this from the MATLAB command line. Neither one produces a script from the model though.
Let me describe one of them and see if it satisfies your needs. Note that is assumes you are using R2014a or newer. If that is not the case let me know and I will describe the other way.
Say you have a SBML file with a model that has a number of parameters and you want to simulate the model using uniformly distributed random parameter values in the range [0 10] for two of those parameters. I will use a model that we ship with SimBiology called oscillator.xml (it is SBML) for demonstration purposes.
model = sbmlimport('oscillator');
func = createSimFunction(model, {'Reaction1.k1', 'Reaction3.k3'}, 'pA', []);
parameter_values = 10 * rand(10, 2);
stopTime = 100;
results = func(parameter_values, stopTime);
sbioplot(results)
Note that this model has a number of parameters (42) and a number of species (23) but in the call to createSimFunction you can specify a subset of this parameters that will be accessible from the generated function. Likewise the resulting function (func) will only return values for the species specified by name in the second argument to createSimFunction; in this case 'pA'.
When calling func, every row of the parameter_values matrix is used during one simulation. Calling func with a matrix returns simulation results for each of those rows. There are options that allow running these simulations in parallel (either using multiple cores, or a cluster) if you have the parallel computing toolbox.
Lastly I will mention that there are ways of doing this from the GUI (there is a Task for scanning with some options). But if you want more control over the parameters used this example might be more adequate.
0 件のコメント
その他の回答 (0 件)
コミュニティ
その他の回答 SimBiology コミュニティ
参考
カテゴリ
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!