103 this =
this@fem.AFEMConfig(varargin[:]);
110 m = models.muscle.Model(
this);
126 targetd = 1:s.NumStateDofs;
128 targetd(s.DerivativeDirichletPosInStateDofs) = [];
129 m.SpaceReducer.TargetDimensions= targetd;
178 g = models.muscle.functions.Gordon66SarcoForceLength(f.mu(14));
179 [fun, dfun] = g.getFunction;
190 fun = @(ratio)(ratio<=1).*exp(-((1-ratio)/lw).^lexpo) ...
191 + (ratio>1).*exp(-((ratio-1)/rw).^rexpo);
192 dfun = @(ratio)(ratio<=1).*((lexpo*exp(-(-(ratio - 1)/lw)^lexpo)*(-(ratio - 1)/lw)^(lexpo - 1))/lw) ...
193 + (ratio > 1) .* (-(rexpo*exp(-((ratio - 1)/rw)^rexpo)*((ratio - 1)/rw)^(rexpo - 1))/rw);
196 fun = @(ratio)(-6.25*ratio.*ratio + 12.5*ratio - 5.25) .* (ratio >= .6) .* (ratio <= 1.4);
197 dfun = @(ratio)(12.5*ratio.*(1-ratio)) .* (ratio >= .6) .* (ratio <= 1.4);
199 f.ForceLengthFun= fun;
200 f.ForceLengthFunDeriv= dfun;
224 function alpha =
getAlphaRamp(ramptime,
double alphamax,
double starttime) {
231 ramp = general.functions.Ramp(ramptime, alphamax, starttime);
232 alpha = ramp.getFunction;
277 init@fem.AFEMConfig(
this);
281 if isa(geo,
" fem.geometry.Cube8Node ")
283 elseif isa(geo,
" fem.geometry.Cube20Node ") || isa(geo,
" fem.geometry.Cube27Node ")
284 press_geo = geo.toCube8Node;
286 error(
" Scenario not yet implemented for geometry class '%s' ",
class(geo));
288 this.
PressureFEM= fem.HexahedronTrilinear(press_geo);
307 ftw = zeros(fe.GaussPointsPerElem,length(this.FibreTypes),geo.NumElements);
324 anull = zeros(3,fe.GaussPointsPerElem,g.NumElements);
325 anull = this.
seta0(anull);
327 for m = 1:g.NumElements
328 anull(:,:,m) = anull(:,:,m) ./ ([1;1;1]*
Norm.
L2(anull(:,:,m)));
function setForceLengthFun(f)
Provided here only for convenient outside access.
function ftw = getFibreTypeWeights()
This is a lazy pre-implementation as fullmodels.muscle.Models always have fibre types and thus weight...
function addOption(name, default, varargin)
function alpha = getAlphaRamp(ramptime,double alphamax,double starttime)
Creates a linearly increasing scalar function starting at starttime milliseconds ranging from zero to...
function configureModelFinal()
function x0 = getX0(x0)
do nothing
function m = createModel()
Convenience method.
A variable number of input arguments.
function anull = seta0(anull)
do nothing!
double ActivationRampOffset
Determines the default number of milliseconds to wait before activation is started.
double ActivationRampMax
Determines the default value for maximum activation in activation ramps.
static function rowvec< double > n = L2(matrix< double > x)
Returns the discrete norm for each column vector in x.
char a0CoordinateSystem
The coordinate system in which to interpret the a0 vectors of fibre directions.
Norm: Static class for commonly used norms on sets of vectors.
A MatLab character array.
function u = getInputs()
Returns the inputs of the model.
function tmr = getTendonMuscleRatio(unused1)
Returns the [0,1] ratio between tendon and muscle at all gauss points of all elements.