150 this =
this@dscomponents.ACoreFun(sys);
154 this.
fDim= sys.dsa + sys.dm;
156 this.spm= sys.Model.SinglePeakMode;
181 dy(1) = (-c(1)*(y(1)-c(11))-c(5)*(y(1)-y(2)))/c(7);
183 dy(2) = (-c(6)*(y(2)-c(11))-c(5)*(y(2)-y(1))...
184 -c(4)*y(3).^3*y(4)*(y(2)-c(9))...
185 -c(2)*y(5).^4*(y(2)-c(10))...
186 -c(3)*y(6).^2*(y(2)-c(10)))/c(8);
188 dy(3) = 0.32*(13-y(2))/(exp((13-y(2))/5)-1)*(1-y(3))...
189 -0.28*(y(2)-40)/(exp((y(2)-40)/5)-1)*(y(3));
190 dy(4) = 0.128*(exp((17-y(2))/18))*(1-y(4))-4/(exp((40-y(2))/5)+1)*(y(4));
191 dy(5) = 0.032*(15-y(2))/(exp((15-y(2))/5)-1)*(1-y(5))...
192 -0.5*(exp((10-y(2))/40))*(y(5));
193 dy(6) = 3.5/(exp((55-y(2))/4)+1)*(1-y(6))-0.025*(y(6));
196 dy(dm+1:end) = this.dydt_sarcomere(y(dm+1:end),t);
210 dy(dm+1,:) = dy(dm+1,:) + signal;
230 error(
" evaluate is overridden directly. ");
240 J = spalloc(bs,bs,45+303);
246 JN(1,1) = -(c(1) + c(5))/c(7);
249 JN(2,2) = -(c(4)*y(4)*y(3)^3 + c(2)*y(5)^4 + c(3)*y(6)^2 + c(5) + c(6))/c(8);
250 JN(3,2) = (8*(y(3) - 1))/(25*(exp(13/5 - y(2)/5) - 1)) - (7*y(3))/(25*(exp(y(2)/5 - 8) - 1)) + (y(3)*exp(y(2)/5 - 8)*((7*y(2))/25 - 56/5))/(5*(exp(y(2)/5 - 8) - 1)^2) + (exp(13/5 - y(2)/5)*((8*y(2))/25 - 104/25)*(y(3) - 1))/(5*(exp(13/5 - y(2)/5) - 1)^2);
251 JN(4,2) = (8*exp(17/18 - y(2)/18)*(y(4) - 1))/1125 - (4*y(4)*exp(8 - y(2)/5))/(5*(exp(8 - y(2)/5) + 1)^2);
252 JN(5,2) = (y(5)*exp(1/4 - y(2)/40))/80 + (4*(y(5) - 1))/(125*(exp(3 - y(2)/5) - 1)) + (exp(3 - y(2)/5)*((4*y(2))/125 - 12/25)*(y(5) - 1))/(5*(exp(3 - y(2)/5) - 1)^2);
253 JN(6,2) = -(7*exp(55/4 - y(2)/4)*(y(6) - 1))/(8*(exp(55/4 - y(2)/4) + 1)^2);
254 JN(2,3) = (3*c(4)*y(3)^2*y(4)*(c(9) - y(2)))/c(8);
255 JN(3,3) = ((8*y(2))/25 - 104/25)/(exp(13/5 - y(2)/5) - 1) - ((7*y(2))/25 - 56/5)/(exp(y(2)/5 - 8) - 1);
256 JN(2,4) = (c(4)*y(3)^3*(c(9) - y(2)))/c(8);
257 JN(4,4) = - (16*exp(17/18 - y(2)/18))/125 - 4/(exp(8 - y(2)/5) + 1);
258 JN(2,5) = (4*c(2)*y(5)^3*(c(10) - y(2)))/c(8);
259 JN(5,5) = ((4*y(2))/125 - 12/25)/(exp(3 - y(2)/5) - 1) - exp(1/4 - y(2)/40)/2;
260 JN(2,6) = (2*c(3)*y(6)*(c(10) - y(2)))/c(8);
261 JN(6,6) = - 7/(2*(exp(55/4 - y(2)/4) + 1)) - 1/40;
265 J(dm+1:bs,dm+1:bs) = this.Jac_Sarco(y(dm+1:end), t);
285 copy = models.motorunit.Dynamics(this.
System);
288 copy =
clone@dscomponents.ACompEvalCoreFun(
this, copy);
303 dm = s.dm; dsa = s.dsa;
305 J = sparse(size,size);
308 i = [1,1,2,2,2,2,2,2,3,3,4,4,5,5,6,6];
309 j = [1,2,1,2,3,4,5,6,2,3,2,4,2,5,2,6];
310 J(1:dm,1:dm) = sparse(i,j,
true,6,6);
313 mc = metaclass(
this);
314 s = load(fullfile(fileparts(which(mc.Name)),
" JSparsityPattern "));
315 J(dm+1:size,dm+1:size) = s.JP;
345 function sc = getSarcoConst(mu_fibretype) {
357 function c = getMotoConst(mu_fibretype) {
364 c = zeros(11,length(mu_fibretype));
366 Rmd = 14.4+6.05-coolExp(6.05,14.4,mu_fibretype);
367 Rms=1.15+0.65-coolExp(0.65,1.15,mu_fibretype);
369 ld=coolExp(0.55,1.06,mu_fibretype);
370 ls=coolExp(77.5e-6*100,113e-6*100,mu_fibretype);
372 rd=coolExp(41.5e-6*100,92.5e-6*100,mu_fibretype)/2;
373 rs=coolExp(77.5e-6*100,113e-6*100,mu_fibretype)/2;
375 c(1,:) = 2*pi*rd.*ld./Rmd;
377 c(2,:) = 4*2*pi*rs.*ls;
379 c(3,:) = 16*2*pi*rs.*ls;
381 c(4,:) = 30*2*pi*rs.*ls;
383 c(5,:) = 2./(Ri*ld./(pi*rd.^2)+Ri*ls./(pi*rs.^2));
385 c(6,:) = 2*pi*rs.*ls./Rms;
387 c(7,:) = 2*pi*rd.*ld*Cm;
389 c(8,:) = 2*pi*rs.*ls*Cm;
391 s = ones(size(mu_fibretype));
399 function v = coolExp(a,b,
mu)
400 v = exp(log(100)*
mu)*(b-a)/100 + a;
414 function dy = dydt_sarcomere(
matrix<
double> y,
rowvec<
double>
t);
416 function initSarcoConst();
418 function J = Jac_Sarco(
matrix<
double> y,
rowvec<
double> t);
integer fDim
The current output dimension of the function.
SarcoConst_base
basis constant set for sarcomere submodel
function prepareSimulation(colvec< double > mu)
double MSLink_MinFactor
The minimal factor at which the value of the motoneuron should be amplified when added to the sarcom...
double MSLink_MaxFactorSignal
The value of the motoneuron input at which the MSLink_MaxFactor should be attained.
dependent SarcoConst_dynpos
Positions constants.
SarcoConst_slow
constants for sarcomere submodel specific for slow twitch fibre
function copy = clone()
Create new instance.
double MSLink_MaxFactor
The maximal factor with which the value of the motoneuron should be amplified when added to the sarc...
Basic interface for all dynamical system's core functions Inherits the AProjectable interface...
function J = getStateJacobian(matrix< double >, y,rowvec< double > t)
Evaluates the full Jacobian of the nonlinear core function.
integer xDim
The current state space dimension of the function's argument .
models.BaseFirstOrderSystem System
The system associated with the current ACoreFun.
colvec< double > mu
The current model parameter mu for evaluations. Will not be persisted as only valid for runtime durin...
function dy = evaluate(matrix< double >, y,rowvec< double > t)
Evaluates the nonlinear core function at given time and state. Can evaluate vectorized arguments...
sparse< logical > JSparsityPattern
Sparsity pattern for the jacobian matrix.
function dy = evaluateCoreFun(matrix< double > y,double t,colvec< double > mu)
SarcoConst_fast
constants for sarcomere submodel specific for fast twitch fibre
SHDynamics: Class for nonlinear dynamics of shorten motorunit model.
function initJSparsityPattern()
Initializes the Sparsity pattern of the Jacobian.
function f = getLinkFactor(rowvec< double > y)
scalar link factor motoneuron to middle sarcomere