필터 지우기
필터 지우기

Get information from Unit Conversion

조회 수: 61 (최근 30일)
Elisa
Elisa 2024년 7월 3일 10:33
댓글: Jeremy Huard 2024년 7월 4일 14:41
Hi everyone, I am studying a simbiology model not made by me. In particular, I know that some parameters/species have inconsistent units, I just don't know which ones, since it's a huge model. While the Unit Conversion of Simbiology works perfectly, I'd like to know which parameters have different units; in other words I'd like to have a model with consistent units, that would work without using the unit conversion. It would also be sufficient to have, somehow, a table of the changes in units wrt a 'ground' unit, so that I can change the units manually.
I don't know if that's possible in simbiology and I haven't found any documentation on that.
  댓글 수: 3
Elisa
Elisa 2024년 7월 3일 11:43
Yes that's what I thought, but I guess proving the 'middle model' with consistent units could be something doable and it would be extremely useful when developing. Thank you for your quick reply by the way!
John D'Errico
John D'Errico 2024년 7월 3일 12:24
You got the best possible result, actually, in the sense that you just got a response from someone on the staff. I hope it helps!

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

채택된 답변

Jeremy Huard
Jeremy Huard 2024년 7월 3일 12:13
편집: Jeremy Huard 2024년 7월 3일 12:16
Hi @Elisa,
I am curious about why you want to turn off unit conversion. Can you please explain the motivation behind it?
As for an implementation, one possible way to convert parameter units with your system of units could be as follows:
% export the model object to the MATLAB workspace from the Model Builder
% and keep Model Builder open
% create dictionary to map current/old units to new ground units
conversiondic = configureDictionary("string","string");
conversiondic("milligram") = "nanogram";
conversiondic("day") = "hour";
conversiondic("milliliter") = "liter";
conversiondic
% get parameter objects with a unit composed with one of the old units
parObj = sbioselect(modelObj,'Type','Parameter','Where','Units','function',...
@(x) contains(x,conversiondic.keys))
% convert units of each parameter
for currentPar=parObj'
oldunit = currentPar.Units;
% convert unit string to ground units
newunit = replace(oldunit,conversiondic.keys,conversiondic.values);
% convert parameter value to new units
sbioconvertunits(currentPar,newunit);
end
parObj
% the changes in units and values of these parameters will now be reflected
% in Model Builder as well.
% you can now keep working in the Model Builder Apps and save your project
  댓글 수: 4
Elisa
Elisa 2024년 7월 4일 13:16
Hi @Jeremy Huard, sorry for the late reply. Yes, it's always GenSSI (you can find the link to the repo in the previous post).
The SBML does not a perfect job in exporting the model, since simbiology supports several things that cannot be coded into SBML. I am parsing the result of getequation(), but it has been a pain changing the units of each parameter, I was interested in automating this task.
I've tried using the Profile Likelihood method, but sbioparameterci takes a long time to run (I'm talking > 30 hours), and I've suggested to use GenSSI instead for global and structural identifiability analysis.
Elisa
Jeremy Huard
Jeremy Huard 2024년 7월 4일 14:41
Thanks @Elisa for this info!
Calculating the Profile Likelihood CI can indeed be quite computationally expensive.
If you use the optimization-based method, increasing MaxStep and the Tolerance with a local optimizer might help. You could also try the integration-based method. In both cases parallel computing would help if you have access to the Parallel Computing Toolbox.

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

추가 답변 (0개)

커뮤니티

더 많은 답변 보기:  SimBiology Community

카테고리

Help CenterFile Exchange에서 Perform Sensitivity Analysis에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by