Get information from Unit Conversion
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
John D'Errico
2024-7-3
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
2024-7-3
编辑:Jeremy Huard
2024-7-3
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 个评论
Jeremy Huard
2024-7-4
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 Center 和 File Exchange 中查找有关 Extend Modeling Environment 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!