필터 지우기
필터 지우기

Unit conversion in Simbiology

조회 수: 9 (최근 30일)
Omar
Omar 2011년 4월 4일
댓글: Arthur Goldsipe 2017년 3월 3일
Hi to all,
Does Simbiology performs unit conversion when, for example, a species in the membrane is transformed into a cytoplasmatic product? It certainly does some conversion but I’m not sure is the right one. For example, 1 molecule/micrometer^2 is transformed by an irreversible reaction from the compartment X that has 6 micrometer^2 capacity into 6 nM of the product in compartment Y that has 1 micrometer^3 capacity. According to my numbers it should have been 10nM instead of 6nM.
Am I missing something here?
Thanks in advance,
Omar
  댓글 수: 2
George Kamin
George Kamin 2017년 3월 3일
You comment about accessing the "simulation settings" to disable unit checking, this no longer exists in R2016AB
Arthur Goldsipe
Arthur Goldsipe 2017년 3월 3일
Hi,
In R2016b, you can disable unit checking directly while viewing the model by going to the toolstrip tab labeled MODEL and clicking on the button named "Convert Units." You will also still find a button labeled "Simulation Settings" when viewing a task, like a simulation. Just go to the toolstrip tab labeled EDITOR and look for the gear icon.
-Arthur

댓글을 달려면 로그인하십시오.

채택된 답변

Rick Paxson
Rick Paxson 2011년 4월 5일
Hello Omar,
SimBiology can operate in one of two modes when it comes to Units conversions and checking dimensions. By default it performs dimensional analysis using user provided units but does no unit conversions. To turn on unit conversion from the SimBiology Desktop go to the "simulation settings" panel for the simulation task and at the bottom of that panel you will see a checkbox to turn on UnitConversion.
From the MATLAB command line here is the code that I used to confirm that product in compartment Y has 10nM:
m = sbiomodel('unit conversion check');
X = m.addcompartment('X', 'Capacity', 6, 'CapacityUnits', 'micrometer^2');
X.addspecies('membrane_species', 'InitialAmount', 1, 'InitialAmountUnits', 'molecule/micrometer^2');
Y = m.addcompartment('Y', 'Capacity', 1, 'CapacityUnits', 'micrometer^3');
Y.addspecies('cytoplasmic_product', 'InitialAmount', 0, 'InitialAmountUnits', 'nanomolarity');
m.addreaction('X.membrane_species -> Y.cytoplasmic_product', 'reactionrate', 'K*X.membrane_species');
m.addparameter('K', 'Value', 1, 'ValueUnits', '1/second');
% Turn on UnitConversion
cs = m.getconfigset;
cs.CompileOptions.UnitConversion = true;
[t,x] = sbiosimulate(m);
plot(t,x)
Hope this helps.
  댓글 수: 3
Omar
Omar 2011년 4월 12일
Hi to all,
There are still problems with the unit conversion and the use of unitless parametes. The workaround mentioned by me above works if the parameter is used whithin the model but if it is feed into an external function that, for example, encode for the input of certain species, then there are problems. For example, I have a function for a pulse of the input species X. This function has 5 parameters. If they are left without units and the unit conversion is turned on, there is an error blocking the simulation run that can be avoided by turning off unit conversion (which I don't want) or by defining the mock parameters explained in the comment above. However, in this later case the size of the pulse is dramatically reduced. How the units of the arguments of a user-defined function (that does not account for units at all) can generate this issue and how to work around this issue?
Looking forward,
Omar
Arthur Goldsipe
Arthur Goldsipe 2011년 4월 13일
Hi Omar,
With regard to unitless parameters, we recently added support for a new unit named "dimensionless" for just this case. That capability is available as of R2010b. As of R2011a (just released!), you can also specify arbitrary simulation TimeUnits when using UnitConversion.
With regard to unit conversion and user-defined functions, the units of input arguments or output arguments is not currently documented. Therefore, I recommend writing your user functions in a way that is independent of units. For example, can you make the inputs and outputs dimensionless quantities? This may require you to create additional parameters so that you can scale the arguments.
Finally, one caution against using user-defined functions to create pulse inputs. This approach introduces discontinuities into the equations. For the most accurate and robust numerical solutions to such problems, the solver needs to be informed of the discontinuities. The best way to do this is via events. The documentation actually incudes a demo documenting this approach. The title of the demo is "Deterministic Simulation of a Model Containing a Discontinuity". You can also type "edit discontSimBiologyModel.m" at the MATLAB prompt to see the demo.
Cheers,
Arthur

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

커뮤니티

더 많은 답변 보기:  SimBiology Community

카테고리

Help CenterFile Exchange에서 Extend Modeling Environment에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by