50 this =
this@dscomponents.ACoreFun(sys);
62 this.mc= this.getMotoConst(
mu(1));
73 dy(1,:) = (-c(1,:).*(y(1,:)-c(11,:))-c(5,:).*(y(1,:)-y(2,:)))./c(7,:);
76 dy(2,:) = (-c(6,:).*(y(2,:)-c(11,:))-c(5,:).*(y(2,:)-y(1,:))...
77 -c(4,:).*y(3,:).^3.*y(4,:).*(y(2,:)-c(9,:))...
78 -c(2,:).*y(5,:).^4.*(y(2,:)-c(10,:))...
79 -c(3,:).*y(6,:).^2.*(y(2,:)-c(10,:)))./c(8,:);
82 dy(3,:) = 0.32*(13-y(2,:))./(exp((13-y(2,:))/5)-1).*(1-y(3,:))...
83 -0.28*(y(2,:)-40)./(exp((y(2,:)-40)/5)-1).*(y(3,:));
84 dy(4,:) = 0.128*(exp((17-y(2,:))/18)).*(1-y(4,:))-4./(exp((40-y(2,:))/5)+1).*(y(4,:));
85 dy(5,:) = 0.032*(15-y(2,:))./(exp((15-y(2,:))/5)-1).*(1-y(5,:))...
86 -0.5*(exp((10-y(2,:))/40)).*(y(5,:));
87 dy(6,:) = 3.5./(exp((55-y(2,:))/4)+1).*(1-y(6,:))-0.025*(y(6,:));
109 error(
" evaluate is overridden directly. ");
118 J(1,1:6:end) = -(c(1,:) + c(5,:))./c(7,:);
119 J(2,1:6:end) = c(5,:)./c(8,:);
120 J(1,2:6:end) = c(5,:)./c(7,:);
121 J(2,2:6:end) = -(c(4,:).*y(4,:).*y(3,:)^3 + c(2,:).*y(5,:)^4 + c(3,:).*y(6,:)^2 + c(5,:) + c(6,:))./c(8,:);
122 J(3,2:6:end) = (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);
123 J(4,2:6:end) = (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);
124 J(5,2:6:end) = (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);
125 J(6,2:6:end) = -(7.*exp(55./4 - y(2,:)./4).*(y(6,:) - 1))./(8.*(exp(55./4 - y(2,:)./4) + 1)^2);
126 J(2,3:6:end) = (3.*c(4,:).*y(3,:)^2.*y(4,:).*(c(9,:) - y(2,:)))./c(8,:);
127 J(3,3:6:end) = ((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);
128 J(2,4:6:end) = (c(4,:).*y(3,:)^3.*(c(9,:) - y(2,:)))./c(8,:);
129 J(4,4:6:end) = - (16.*exp(17./18 - y(2,:)./18))./125 - 4./(exp(8 - y(2,:)./5) + 1);
130 J(2,5:6:end) = (4.*c(2,:).*y(5,:)^3.*(c(10,:) - y(2,:)))./c(8,:);
131 J(5,5:6:end) = ((4.*y(2,:))./125 - 12./25)./(exp(3 - y(2,:)./5) - 1) - exp(1./4 - y(2,:)./40)./2;
132 J(2,6:6:end) = (2.*c(3,:).*y(6,:).*(c(10,:) - y(2,:)))./c(8,:);
133 J(6,6:6:end) = - 7./(2.*(exp(55./4 - y(2,:)./4) + 1)) - 1./40;
150 copy = models.motoneuron.Dynamics(this.
System);
153 copy =
clone@dscomponents.ACoreFun(
this, copy);
168 i = [1,1,2,2,2,2,2,2,3,3,4,4,5,5,6,6];
169 j = [1,2,1,2,3,4,5,6,2,3,2,4,2,5,2,6];
180 function c = getMotoConst(moto_mu) {
185 c = zeros(11,length(moto_mu));
186 Rmd = 14.4+6.05-coolExp(6.05,14.4,moto_mu);
188 Rms=1.15+0.65-coolExp(0.65,1.15,moto_mu);
190 ld=coolExp(0.55,1.06,moto_mu);
191 ls=coolExp(77.5e-6*100,113e-6*100,moto_mu);
193 rd=coolExp(41.5e-6*100,92.5e-6*100,moto_mu)/2;
194 rs=coolExp(77.5e-6*100,113e-6*100,moto_mu)/2;
196 c(1,:) = 2*pi*rd.*ld./Rmd;
198 c(2,:) = 4*2*pi*rs.*ls;
200 c(3,:) = 16*2*pi*rs.*ls;
202 c(4,:) = 30*2*pi*rs.*ls;
204 c(5,:) = 2./(Ri*ld./(pi*rd.^2)+Ri*ls./(pi*rs.^2));
206 c(6,:) = 2*pi*rs.*ls./Rms;
208 c(7,:) = 2*pi*rd.*ld*Cm;
210 c(8,:) = 2*pi*rs.*ls*Cm;
212 s = ones(size(moto_mu));
220 function v = coolExp(a,b,
mu)
221 v = exp(log(100)*
mu)*(b-a)/100 + a;
integer fDim
The current output dimension of the function.
function dy = evaluateCoreFun(matrix< double > y,double t,colvec< double > mu)
Model
The Model this System is attached to.
function dy = evaluate(matrix< double >, y, unused1, unused2)
Evaluates the nonlinear core function at given time and state. Can evaluate vectorized arguments...
Basic interface for all dynamical system's core functions Inherits the AProjectable interface...
integer xDim
The current state space dimension of the function's argument .
colvec< double > mu
The current model parameter mu for evaluations. Will not be persisted as only valid for runtime durin...
MotoSystem: The global dynamical system used within the MotoModel.
function initJSparsityPattern()
Initializes the Sparsity pattern of the Jacobian.
FibreDynamics: Class for nonlinear dynamics of muscle fibre compound.
sparse< logical > JSparsityPattern
Sparsity pattern for the jacobian matrix.
function J = getStateJacobian(matrix< double >, y, unused1, unused2)
Evaluates the full Jacobian of the nonlinear core function. Vectorized evaluation is not tested yet...
upperlimit_poly
The upper limit polynomial for maximum mean current dependent on the fibre type.
function prepareSimulation(colvec< double > mu)
function copy = clone()
Create new instance.