Do simfunctions support parameterized dosing?

3 ビュー (過去 30 日間)
Abed Alnaif
Abed Alnaif 2018 年 11 月 5 日
コメント済み: Abed Alnaif 2018 年 11 月 5 日
The examples in the documentation regarding parameterized dosing do not use the simfunction, but I figured that it should work with simfunctions, since I didn't find anything in the documentation to indicate otherwise. But I'm not able to get the examples to work using simfunctions, using R2018b. Do simfunctions support parameterized dosing? Please find the code below for an example:
%%Example from Matlab documentation:
% https://www.mathworks.com/help/simbio/ref/repeatdoseobject.html
model = sbiomodel('simple model');
compartment = addcompartment(model,'Central',1);
compartment.CapacityUnits = 'liter';
species = addspecies(model,'drug');
species.InitialAmountUnits = 'milligram';
% Elimination rate
elimParam = addparameter(model,'kel',0.1);
elimParam.ValueUnits = '1/hour';
% Elimination reaction
reaction = addreaction(model,'drug -> null');
reaction.ReactionRate = 'kel*drug';
amountParam = addparameter(model,'A',50);
amountParam.ConstantValue = false;
amountParam.ValueUnits = 'milligram'
dose = adddose(model,'adaptive dose','repeat');
dose.Amount = 'A';
dose.TargetName = 'drug';
dose.StartTime = 0;
dose.TimeUnits = 'hour';
dose.Interval = 24;
dose.RepeatCount = 7;
weightParam = addparameter(model,'weight', 80);
weightParam.ValueUnits = 'kilogram';
scaleParam = addparameter(model,'doseAmountPerWeight',0.6);
scaleParam.ValueUnits = 'milligram/kilogram';
rule = addrule(model,'A = weight*doseAmountPerWeight','initialAssignment');
configset = getconfigset(model);
configset.StopTime = 7*24;
configset.TimeUnits = 'hour';
[time, drugAndAmount] = sbiosimulate(model,dose);
plot(time, drugAndAmount);
legend('drug','A');
%%It doesn't work using simfunctions
doseTbl = dose.getTable();
simFunction = createSimFunction(model,{},{'drug'},{'drug'});
simFunction([],10,doseTbl);

採用された回答

Arthur Goldsipe
Arthur Goldsipe 2018 年 11 月 5 日
Yes, parameterized doses are supported with SimFunctions. However, you cannot change the type of parameterization after creating a SimFunction. In your example, you created a SimFunction with a dose that was not parameterized, so you cannot simulate it with a parameterized dose table.
To create a SimFunction that uses a parameterized dose, replace your input {'drug'} with a "template" dose object that is parameterized. For example, you can re-use your existing dose for this by changing the next-to-last line of code to the following:
simFunction = createSimFunction(model,{},{'drug'},dose);
  1 件のコメント
Abed Alnaif
Abed Alnaif 2018 年 11 月 5 日
Thanks, I was able to get it to work with your suggestion.

サインインしてコメントする。

その他の回答 (0 件)

コミュニティ

その他の回答  SimBiology コミュニティ

カテゴリ

Help Center および File ExchangeScan Parameter Ranges についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by