主要内容

addobservable

将可观察的对象添加到Simbiology模型

描述

example

obsObj= addobservable(模型Obj,obsName,obsExpression)adds an可观察对象的simbiology®模型模型Obj。输入obsNameobsExpression分别是可观察到的对象名称及其表达。

example

obsObj= addobservable(模型Obj,obsName,obsExpression,名称,价值)设置属性值obsObjusing one or more name-value pair arguments.Nameis the property name and价值is the corresponding valueName必须出现在引号中。您可以按任何顺序指定几个名称和值对参数NAME1,Value1,...,Namen,Valuen。有关属性列表,请参见可观察的对象属性

例子

全部收缩

加载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 aSimDataarray.

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 anyTOvalue above 0.85 is unsafe, and anyTOvalue 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',“功效阈值”);

图包含一个轴对象。带有标题状态与时间的轴对象包含33个类型行的对象。这些对象表示运行1-至,运行2-到,运行3-至,运行4-运行5-运行5-运行6-运行7-运行7-到,运行8-运行8-运行9-运行10- 运行11-到,运行12-跑步13-运行14-运行15-运行15-运行16至,运行17-运行17-运行18-运行18-运行19-运行20- 运行21-到,运行22-运行23-运行24-运行24-运行25-运行26至,运行26至,运行27-运行27-运行28-运行29-运行29-运行30- 运行31-到安全阈值,功效阈值。

Postprocess the simulation results. Find out which dose amounts are effective, corresponding to theTOresponses 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 eachSimDatasd并将评估结果作为新的结果返回SimDataarray,新闻, 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')

图包含一个轴对象。The axes object contains an object of type line.

该图显示,剂量范围从50到180纳莫尔提供TOresponses 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');

输入参数

全部收缩

Simbiology模型, specified as a SimBiology模型object

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

可观察对象的表达,指定为字符向量或字符串。

例子:“陷阱(时间,药物)”

Data Types:char|string

Output Arguments

全部收缩

可观察的对象,返回可观察目的。

Version History

在R2020a中引入

展开全部

将来发行的行为变化