Do simfunctions support parameterized dosing?
이전 댓글 표시
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);
채택된 답변
추가 답변 (0개)
커뮤니티
더 많은 답변 보기: SimBiology Community
카테고리
도움말 센터 및 File Exchange에서 Scan Parameter Ranges에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!