addobservable
将可观察的对象添加到Simbiology模型
Syntax
描述
adds anobsObj
= addobservable(模型Obj
,obsName
,obsExpression
)可观察
对象的simbiology®模型模型Obj
。输入obsName
和obsExpression
分别是可观察到的对象名称及其表达。
例子
Calculate Statistics After Model Simulation Using Observables
加载Target-Mediated药物Disposition (TMDD) Model。
sbioloadprojecttmdd_with_TO.sbproj
设置目标占用(TO
) as a response.
cs = getconfigset(m1); cs.RuntimeOptions.StatesToLog ='至';
Get the dosing information.
d = getdose(m1,'每日剂量');
使用A扫描不同剂量的数量Simbiology.scenarios
目的。为此,首先参数化数量
剂量的财产。然后使用Scenarios
目的。
量表= addParameter(M1,'AmountParam','单位',D.Amountunits);d.amount ='AmountParam'; d.Active = 1; doseSamples = SimBiology.Scenarios('AmountParam',linspace(0,300,31));
Create aSimFunction
模拟模型。放TO
作为仿真输出。
%抑制模拟过程中发出的信息警告。警告('离开','simbiology:simfunction:doses_not_empty');f = createSimFunction(m1,doseSamples,'至',d)
f = SimFunction Parameters: Name Value Type Units _______________ _____ _____________ ____________ {'AmountParam'} 1 {'parameter'} {'nanomole'} Observables: Name Type Units ______ _____________ _________________ {'TO'} {'parameter'} {'dimensionless'} Dosed: TargetName TargetDimension Amount AmountValue AmountUnits _______________ ___________________________________ _______________ ___________ ____________ {'Plasma.Drug'} {'Amount (e.g., mole or molecule)'} {'AmountParam'} 1 {'nanomole'} TimeUnits: day
警告('on','simbiology:simfunction:doses_not_empty');
使用由Scenarios
目的。In this case, the object generates 31 different doses; hence the model is simulated 31 times and generates aSimData
array.
doseTable = getTable(d); sd = f(doseSamples,cs.StopTime,doseTable)
Simbiology仿真数据阵列:31-1 by-1模型名称:TMDD记录数据:物种:0隔室:0参数:1敏感性:0可观察:0
绘制仿真结果。还添加两条参考线,代表安全性和功效阈值TO
。In this example, suppose that anyTO
value above 0.85 is unsafe, and anyTO
value below 0.15 has no efficacy.
h = sbioplot(SD);时间= SD(1).Time;H.NextPlot ='add'; safetyThreshold = plot(h,[min(time), max(time)],[0.85, 0.85],'DisplayName','Safety Threshold');efficacyThreshold = plot(h,[min(time), max(time)],[0.15, 0.15],'DisplayName',“功效阈值”);
Postprocess the simulation results. Find out which dose amounts are effective, corresponding to theTO
responses within the safety and efficacy thresholds. To do so, add an observable expression to the simulation data.
%抑制模拟过程中发出的信息警告。警告('离开','SimBiology:sbservices:SB_DIMANALYSISNOTDONE_MATLABFCN_UCON');新闻= addobservable(sd,'stat1','max(TO) < 0.85 & min(TO) > 0.15','单位',“无量纲”)
Simbiology仿真数据阵列:31-1 by-1模型名称:TMDD记录数据:物种:0隔室:0参数:1敏感性:0敏感性:0可观察:1
The addobservable function evaluates the new observable expression for eachSimData
在sd
并将评估结果作为新的结果返回SimData
array,新闻
, which now has the added observable (stat1
)。
Simbiology将可观察结果存储在A的两个不同特性中SimData
目的。If the results are scalar-valued, they are stored insimdata.scalarobservables
。否则,它们被存储在SimData.VectorObservables
。在此示例中,stat1
可观察expression is scalar-valued.
Extract the scalar observable values and plot them against the dose amounts.
scalarObs = vertcat(newSD.ScalarObservables); doseAmounts = generate(doseSamples); figure plot(doseAmounts.AmountParam,scalarObs.stat1,'o','MarkerFaceColor','b')
该图显示,剂量范围从50到180纳莫尔提供TO
responses that lie within the target efficacy and safety thresholds.
You can update the observable expression with different threshold amounts. The function recalculates the expression and returns the results in a newSimData
对象数组。
新闻2 = updateobservable(newSD,'stat1','最大(TO)<0.75&min(to)> 0.30');
Rename the observable expression. The function renames the observable, updates any expressions that reference the renamed observable (if applicable), and returns the results in a newSimData
对象数组。
newsd3 = RenameObservable(newsd2,'stat1',“效应”);
恢复警告设置。
警告('on','SimBiology:sbservices:SB_DIMANALYSISNOTDONE_MATLABFCN_UCON');
输入参数
模型Obj
—Simbiology模型
Simbiology模型object
Simbiology模型, specified as a SimBiology模型object
。
obsName
—可观察对象的名称
角色向量|string
Name of the observable object, specified as a character vector or string.
名字
不能包含字符
[]
,- >
, or<->
。Cannot be empty, the word时间, 这个单词无效的, or all whitespace.
Must be unique in a model, meaning no observable object can have the same name as another observable, species, compartment, parameter, reaction, variant, or dose in the model.
For details, seeGuidelines for Naming Model Components。
例子:'auc_obs'
Data Types:char
|string
obsExpression
—可观察物体的表达
角色向量|string
可观察对象的表达,指定为字符向量或字符串。
例子:“陷阱(时间,药物)”
Data Types:char
|string
Version History
在R2020a中引入R2022a: Component naming restriction
将来发行的行为变化
In a future release, there will be a naming restriction on the following model component types: model, compartment, species, parameter, reaction, rule, event, observable, dose, and variant. The restriction is that within a single model, these components will be required to have unique names even when they are of different types with the following two exceptions:
Species in different parent compartments can have the same name.
带有不同父母的参数可以具有相同的名称。具体而言,您可以使用相同的名称进行模型划分的参数和反应式参数,其中每个反应分析参数属于不同的反应。
matlab命令
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择一个网站
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:。
您还可以从以下列表中选择一个网站:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
美洲
- AméricaLatina(Español)
- 加拿大(英语)
- 美国(英语)