does anybody please explain how to use 'tomlab' in Simbiology?

Hello, does anybody please explain how to use 'tomlab' in Simbiology? previously I used sundial, ode15s etc. Now I want to use tomlab instead of those.
Thanks in advance.
Emran

 Accepted Answer

Hi Arthur,
Thanks a lot. I use the same outline as you have given. Now I only want to use the 'solvers of tomlab'.
In Simbiology normally I use:
configsetObj = getconfigset(model);
set(configsetObj, 'StopTime', 86400, 'SolverType', 'ode15s'); % for 'ode15s'solver
now is it possible to follow same procedure:??
set(configsetObj, 'StopTime', 86400, 'SolverType', *'SNOPT'*); % a TOMLAb solver
or, what will be the actual code for 'SNOPT' , 'NPSOL' etc.
Regards,
Emran

More Answers (1)

Hi Emran,
TOMLAB and SimBiology are two separate products and are not integrated. Furthermore, TOMLAB is used for optimizing some objective function, while the SimBiology solvers ode15s and sundials are used for solving ordinary differential equations. Therefore, it does not really make sense to replace sundials with TOMLAB.
Perhaps you mean that you want to use TOMLAB for optimization of a SimBiology model? For example, you might want to determine the set of model parameters that best fit some experimental data. You should be able to do this by writing your own objective function to pass to TOMLAB. Here's a brief outline of what that function might look like:
  • Accept parameter values as inputs
  • Apply these parameter values to your SimBiology model
  • Set the OutputTimes of the model's configset to the experimental times
  • Simulate your model
  • Calculate the sum of the squares of the errors (the difference between simulated and measured results)
  • Return this sum as the output of the function
-Arthur

4 Comments

Hi Arthur,
Thanks a lot. I use the same outline as you have given. Now I only want to use the 'solvers of tomlab'.
In Simbiology normally I use:
configsetObj = getconfigset(model);
set(configsetObj, 'StopTime', 86400, 'SolverType', 'ode15s'); % for 'ode15s'solver
now is it possible to follow same procedure:??
set(configsetObj, 'StopTime', 86400, 'SolverType', *'SNOPT'*); % a TOMLAb solver
or, what will be the actual code for 'SNOPT' , 'NPSOL' etc.
Regards,
Emran
Hi Emran
Let me reiterate... SNOPT and NPSOL cannot replace ode15s or sundials. These functions have different purposes. ode15s and sundials solve a set of ordinary differential equations. SNOPT and NPSOL are used to minimize an objective function. Just like you can't use sqrt in place of sin, you can't use SNOPT in place of ode15s.
-Arthur
Hi Arthur,
Thanks again. I've understood that now. Just please tell me, I have to apply 'any' tomlab solver to the following code instead of 'ode15s' :
set(configsetObj, 'StopTime', 86400, 'SolverType', 'ode15s');
How can it be possible?
Regards,
Emran
Hi Emran,
SimBiology currently only allows you to set the SolverType to one of the built-in solvers (as of R2012b, that includes 'ode15s', 'ode23t', 'ode45', 'sundials', 'ssa', 'expltau', and 'impltau'):
-Arthur

Sign in to comment.

Categories

Products

Asked:

on 19 Sep 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!