function m=ssmtrx(tempk, tempq, tempv) % Transition matrix for SS shaker model. Model parameters are: rate % parameters "tempk", charge parameters "tempq". "tempv" is the % applied voltage temperature=12; % Temperature in Celsius degrees kT=(273.15+temperature)*0.08625; A = tempk(1)*exp(tempq(1)*tempv/kT); B = tempk(2)*exp(tempq(2)*tempv/kT); C = tempk(3)*exp(tempq(3)*tempv/kT); D = tempk(4)*exp(tempq(4)*tempv/kT); E = tempk(5)*exp(tempq(5)*tempv/kT); F = tempk(6)*exp(tempq(6)*tempv/kT); N = tempk(7)*exp(tempq(7)*tempv/kT); N1 = tempk(8)*exp(tempq(8)*tempv/kT); O = tempk(9)*exp(tempq(9)*tempv/kT); O1 = tempk(10)*exp(tempq(10)*tempv/kT); iN = tempk(11)*exp(tempq(11)*tempv/kT); iN1 = tempk(12)*exp(tempq(12)*tempv/kT); CF = tempk(13)*exp(tempq(13)*tempv/kT); CF1 = tempk(14)*exp(tempq(14)*tempv/kT); CF2 = tempk(15)*exp(tempq(15)*tempv/kT); CF3 = tempk(16)*exp(tempq(16)*tempv/kT); m =[-4*A, B, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; 4*A, -B-3*A-C, 2*B, 0, 0, D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; 0, 3*A, -2*B-2*A-2*C, 3*B, 0, 0, D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; 0, 0, 2*A, -3*B-A-3*C, 4*B, 0, 0, D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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