Unable to meet integration tolerances without reducing the step size below the smallest value allowed (1.136868e-13) at time t.
Mostra commenti meno recenti
for tf=1:1:8
tspan = t0:step:tf*dose_length;
lt=length(tspan);
sx=size(xx1,1);
x0=xx1(sx,:);
% t0=t0+dose_length;
options = odeset('RelTol',10,'AbsTol',[10 10 10 10 ]);
[tt,xx1]= ode15s (@odebladder_exp,tspan,x0,options,muB,muE,alpha,pA,pT,pR,pK,pD,gRate,0, 0,K,g_T);
t0=t0+dose_length;
sx=size(xx1,1);
x1((tf-1)*lt+1:lt*tf,:)=xx1;
t1((tf-1)*lt+1:tf*lt)=tt;
end
5 Commenti
Sveta
il 3 Dic 2023
Torsten
il 3 Dic 2023
You only want a precision of 10 ? That means the true solution and the numerical solution are allowed to deviate by 10 ?
Further comments are not possible since we cannot execute your code (function odebladder_exp is missing).
Sveta
il 4 Dic 2023
@Sveta, I just want to check the stability of the original system with some random initial conditions. So far, I haven't encountered any integration failure messages in this relatively simple code. I prefer to include the fixed parameters inside the ODE function for easy reference. Which parameters do you intend to change during the integration?
tspan = [0 1000];
x0 = rand()*[1e7 2e4 3e4 4e4];
[t, x] = ode45(@odebladder_exp, tspan, x0);
plot(t, x), grid on
function xdot = odebladder_exp(t, x)
xdot = zeros (4, 1);
%% parameters (some are unused)
muB = 0.1;
muE = 0.19;
alpha = 0.7e-4;
pA = 0.1925*2.16e-6;
pT = 0.028e-2;
pR = 0.223e-8;
pK = 0.4e-6;
pD = 1.03e-10;
r = 0.0015;
b_injc = 2.2e6;
IFN = 0;
K = 1e12;
g_T = 5.2e3;
Q1 = 1;
Q2 = 1;
%% differential equations
xdot(1) = b_injc + x(1)*(- pT*x(4) - pA*x(2) - muB);
xdot(2) = (pR*x(1)*x(2) + (alpha - pD)*x(3)*x(2) + alpha*x(2)*x(3))*Q2 - x(2)*muE;
xdot(3) = pT*x(1)*x(4) - Q1*pK*x(2)*x(3);
xdot(4) = r*x(4)*(1 - x(4)/K) - pT*x(1)*x(4) - Q1*pK*x(4)*x(2)/(1 + g_T);
end
Risposte (1)
I had to add the line
global alpha pD K g_T IFN
at the beginning of your program to make the code work because the above global variables were not available.
In some phase of your code run, the integrator is no longer able to integrate your system of differential equations and gives up with the error message
Warning: Failure at t=6.160957e+02. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (1.818989e-12) at time t.
After each call of the integrator, you expect an array of size (71x4) as result and you want to save it into a different array. But since the integrator stops already at time 616,.. , the (71x4) array is not available and you make an assignment that would only have been possible if the integrator had succeeded. This gives the error message
Unable to perform assignment because the size of the left side is 71-by-4 and the size of the right side is 1-by-4.
and MATLAB stops.
I cannot help you in this respect since the error stems from the integration of your model equation that I don't know.
1 Commento
Sveta
il 5 Dic 2023
Categorie
Scopri di più su Stochastic Differential Equation (SDE) Models in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

