Physiolibrary.Blocks.Factors

Multiplication Effects

Information

Extends from Modelica.Icons.Package (Icon for standard packages).

Package Content

Name Description
Physiolibrary.Blocks.Factors.Normalization Normalization effect = u/NormalValue
Physiolibrary.Blocks.Factors.DamagedFraction DamagedFraction effect = 1 - DamagedAreaFraction
Physiolibrary.Blocks.Factors.Spline Spline effect = spline(data,u)
Physiolibrary.Blocks.Factors.LagSpline LagSpline Adapt the input signal before interpolation
Physiolibrary.Blocks.Factors.SplineLag SplineLag Adapt the effect after interpolation
Physiolibrary.Blocks.Factors.SplineLagOrZero SplineLagOrZero LagSpline if not Failed

Physiolibrary.Blocks.Factors.Normalization Physiolibrary.Blocks.Factors.Normalization

effect = u/NormalValue

Physiolibrary.Blocks.Factors.Normalization

Information

y = yBase * u

Extends from Icons.BaseFactorIcon.

Parameters

TypeNameDefaultDescription
RealNormalValue1Normal value of u, because y=(u/NormalValue)*yBase.
Booleanenabledtruedisabled => y=yBase

Connectors

TypeNameDescription
input RealInputyBase 
output RealOutputy 
input RealInputu 

Modelica definition

model Normalization "effect = u/NormalValue" extends Icons.BaseFactorIcon; parameter Real NormalValue=1 "Normal value of u, because y=(u/NormalValue)*yBase."; parameter Boolean enabled=true "disabled => y=yBase"; Modelica.Blocks.Interfaces.RealInput u; Types.Fraction effect; equation effect = if enabled then u/NormalValue else 1; y=effect*yBase; end Normalization;

Physiolibrary.Blocks.Factors.DamagedFraction Physiolibrary.Blocks.Factors.DamagedFraction

effect = 1 - DamagedAreaFraction

Physiolibrary.Blocks.Factors.DamagedFraction

Information

Extends from Icons.BaseFactorIcon.

Parameters

TypeNameDefaultDescription
FractionDamagedAreaFraction0[1]

Connectors

TypeNameDescription
input RealInputyBase 
output RealOutputy 

Modelica definition

model DamagedFraction "effect = 1 - DamagedAreaFraction" extends Icons.BaseFactorIcon; parameter Types.Fraction DamagedAreaFraction = 0; Types.Fraction effect; equation effect = 1-DamagedAreaFraction; y=yBase*effect; end DamagedFraction;

Physiolibrary.Blocks.Factors.Spline Physiolibrary.Blocks.Factors.Spline

effect = spline(data,u)

Physiolibrary.Blocks.Factors.Spline

Information

Extends from Icons.BaseFactorIcon4.

Parameters

TypeNameDefaultDescription
Booleanenabledtruedisabled => y=yBase
Realdata[:, 3] Array of interpolating points as {x,y,slope}
RealXscale1conversion scale to SI unit of x values
RealYscale1conversion scale to SI unit of y values
BooleanUsePositiveLog10falsex = if u/scaleX <=1 then 0 else log10(u/scaleX)

Connectors

TypeNameDescription
input RealInputyBase 
output RealOutputy 
input RealInputu 

Modelica definition

model Spline "effect = spline(data,u)" extends Icons.BaseFactorIcon4; Modelica.Blocks.Interfaces.RealInput u(nominal=Xscale); parameter Boolean enabled=true "disabled => y=yBase"; parameter Real[:,3] data "Array of interpolating points as {x,y,slope}"; parameter Real Xscale = 1 "conversion scale to SI unit of x values"; parameter Real Yscale = 1 "conversion scale to SI unit of y values"; parameter Boolean UsePositiveLog10 = false "x = if u/scaleX <=1 then 0 else log10(u/scaleX)"; Types.Fraction effect "Multiplication coeffecient for yBase to reach y"; protected parameter Real a[:,:] = if enabled then Interpolation.SplineCoefficients( data[:, 1],data[:, 2]*Yscale,data[:, 3]*Yscale) else zeros(1,1) "Cubic polynom coefficients of curve segments between interpolating points"; equation effect = if not enabled then 1 elseif UsePositiveLog10 then Interpolation.Spline(data[:, 1],a,if u/Xscale <= 1 then 0 else log10(u/Xscale)) else Interpolation.Spline(data[:, 1],a,u/Xscale); y=effect*yBase; end Spline;

Physiolibrary.Blocks.Factors.LagSpline Physiolibrary.Blocks.Factors.LagSpline

Adapt the input signal before interpolation

Physiolibrary.Blocks.Factors.LagSpline

Information

If the input signal u is constant and it is different from starting delayed input d, the middle value between u and d will be reached after HalfTime.

The mathematical background:

d'(t) = k*(u(t) - d(t)) => The solution of d(t) in special case, if u(t) is constant at each time t: d(t)=u+(d(0)-u)*e^(-k*t), where the definition of HalfTime is d(HalfTime) = d(0) + (d(0)-u)/2.

Extends from Icons.BaseFactorIcon5.

Parameters

TypeNameDefaultDescription
Booleanenabledtruedisabled => y=yBase
TimeHalfTime [s]
RealinitialValue1as u/Xscale
RealXscale1conversion scale to SI unit of x values
RealYscale1conversion scale to SI unit of y values
BooleanUsePositiveLog10falsex = if u_delayed/scaleX <=1 then 0 else log10(u_delayed/scaleX)
Realdata[:, 3]  

Connectors

TypeNameDescription
input RealInputyBase 
output RealOutputy 
input RealInputu 

Modelica definition

model LagSpline "Adapt the input signal before interpolation" extends Icons.BaseFactorIcon5; Modelica.Blocks.Interfaces.RealInput u; parameter Boolean enabled=true "disabled => y=yBase"; parameter Types.Time HalfTime(displayUnit="min"); //=3462.468; parameter Real initialValue = 1 "as u/Xscale"; parameter Real Xscale = 1 "conversion scale to SI unit of x values"; parameter Real Yscale = 1 "conversion scale to SI unit of y values"; parameter Boolean UsePositiveLog10 = false "x = if u_delayed/scaleX <=1 then 0 else log10(u_delayed/scaleX)"; parameter Real[:,3] data; Blocks.Math.Integrator integrator(k=(Modelica.Math.log(2)/ HalfTime), y_start=initialValue*Xscale, NominalValue=Xscale); Modelica.Blocks.Math.Feedback feedback; Types.Fraction effect; Spline spline( data=data, Xscale=Xscale, Yscale=Yscale, UsePositiveLog10=UsePositiveLog10, enabled=enabled); equation effect = spline.effect; connect(feedback.y, integrator.u); connect(integrator.y, feedback.u2); connect(feedback.u1, u); connect(integrator.y, spline.u); connect(yBase, spline.yBase); connect(spline.y, y); end LagSpline;

Physiolibrary.Blocks.Factors.SplineLag Physiolibrary.Blocks.Factors.SplineLag

Adapt the effect after interpolation

Physiolibrary.Blocks.Factors.SplineLag

Information

Extends from Icons.BaseFactorIcon3.

Parameters

TypeNameDefaultDescription
Booleanenabledtruedisabled => y=yBase
TimeHalfTime [s]
RealXscale1conversion scale to SI unit of x values
BooleanUsePositiveLog10falsex = if u/scaleX <=1 then 0 else log10(u/scaleX)
Realdata[:, 3]  
IO
Value I/O
StringstateNamegetInstanceName()Name in Utilities input/output function

Connectors

TypeNameDescription
input RealInputyBase 
output RealOutputy 
input RealInputu 

Modelica definition

model SplineLag "Adapt the effect after interpolation" extends Icons.BaseFactorIcon3; Modelica.Blocks.Interfaces.RealInput u; parameter Boolean enabled=true "disabled => y=yBase"; parameter Types.Time HalfTime(displayUnit="d"); //Tau(unit="day"); parameter String stateName=getInstanceName() "Name in Utilities input/output function"; parameter Real Xscale = 1 "conversion scale to SI unit of x values"; parameter Boolean UsePositiveLog10 = false "x = if u/scaleX <=1 then 0 else log10(u/scaleX)"; parameter Real[:,3] data; Modelica.Blocks.Math.Product product; Blocks.Math.Integrator integrator(y_start=1, k=( Modelica.Math.log(2)/HalfTime), stateName=stateName); Modelica.Blocks.Math.Feedback feedback; Types.Fraction effect; Spline spline( data=data, Xscale=Xscale, UsePositiveLog10=UsePositiveLog10, enabled=enabled); Types.Constants.FractionConst fraction(k(displayUnit="1") = 1); equation //der(effect) = (ln(2)/HalfTime)*(spline(data,u)-effect) effect = integrator.y; connect(yBase, product.u1); connect(product.y, y); connect(feedback.y, integrator.u); connect(integrator.y, feedback.u2); connect(integrator.y, product.u2); connect(feedback.u1, spline.y); connect(u, spline.u); connect(fraction.y, spline.yBase); end SplineLag;

Physiolibrary.Blocks.Factors.SplineLagOrZero Physiolibrary.Blocks.Factors.SplineLagOrZero

LagSpline if not Failed

Physiolibrary.Blocks.Factors.SplineLagOrZero

Information

Extends from Icons.BaseFactorIcon2.

Parameters

TypeNameDefaultDescription
Booleanenabledtruedisabled => y=yBase
TimeHalfTime [s]
Realdata[:, 3]  
RealXscale1conversion scale to SI unit of x values
IO
Value I/O
StringstateNamegetInstanceName()Name in Utilities input/output function

Connectors

TypeNameDescription
input RealInputyBase 
output RealOutputy 
input RealInputu 
input BooleanInputFailed 

Modelica definition

model SplineLagOrZero "LagSpline if not Failed" extends Icons.BaseFactorIcon2; Modelica.Blocks.Interfaces.RealInput u; parameter Boolean enabled=true "disabled => y=yBase"; parameter Types.Time HalfTime(displayUnit="d"); parameter Real[:,3] data; parameter String stateName=getInstanceName() "Name in Utilities input/output function"; parameter Real Xscale = 1 "conversion scale to SI unit of x values"; Interpolation.Curve curve( x=data[:, 1], y=data[:, 2], slope=data[:, 3], Xscale=Xscale); Modelica.Blocks.Math.Product product; Blocks.Math.Integrator integrator(y_start=1, k=( Modelica.Math.log(2)/HalfTime), stateName=stateName); Modelica.Blocks.Math.Feedback feedback; Modelica.Blocks.Logical.Switch switch1; Modelica.Blocks.Sources.Constant Constant1(k=0); Modelica.Blocks.Interfaces.BooleanInput Failed; Types.Fraction effect; Modelica.Blocks.Logical.Switch switch2; Types.Constants.OneConst One; Modelica.Blocks.Sources.BooleanConstant booleanConstant(k=enabled); equation effect = integrator.y; connect(curve.u, u); connect(yBase, product.u1); connect(product.y, y); connect(feedback.y, integrator.u); connect(integrator.y, feedback.u2); connect(integrator.y, product.u2); connect(curve.val, switch1.u3); connect(Constant1.y, switch1.u1); connect(switch1.u2, Failed); connect(switch2.y, feedback.u1); connect(booleanConstant.y, switch2.u2); connect(switch2.u1, switch1.y); connect(One.y, switch2.u3); end SplineLagOrZero;

Automatically generated Tue Sep 15 22:55:05 2015.