- #1
- 25
- 0
[MATLAB]
The cod is:
function RunLogOscilNumeric3
k =10;
p0 =0.001;
t = [0:0.01:10000 ];
omega = 1;
N0 = 1;
options =[ 'AbsTol',1e-3,'RelTol',1e-6]
% options =odeset( 'RelTol',1e-6 ,'stats','on');
[t,p]=ode45(@logOscilnumeric3,t,p0,options,omega,k,N0);
Pmax = max(p)
Pmean = mean(p)
figure(1)
plot(t,p)
1;
% function dpdt = logOscilnumeric3(t,p,omega,k,N0)
% dpdt = N0.*p - (N0.*sin(omega.*t).*p.^2/k);
% end
The error is :
Warning: Failure at t=1.058553e+01. Unable to meet integration tolerances
without reducing the step size below the smallest value allowed
(2.842171e-14) at time t.
> In ode113 at 425
In RunLogOscilNumeric3 at 11
The cod is:
function RunLogOscilNumeric3
k =10;
p0 =0.001;
t = [0:0.01:10000 ];
omega = 1;
N0 = 1;
options =[ 'AbsTol',1e-3,'RelTol',1e-6]
% options =odeset( 'RelTol',1e-6 ,'stats','on');
[t,p]=ode45(@logOscilnumeric3,t,p0,options,omega,k,N0);
Pmax = max(p)
Pmean = mean(p)
figure(1)
plot(t,p)
1;
% function dpdt = logOscilnumeric3(t,p,omega,k,N0)
% dpdt = N0.*p - (N0.*sin(omega.*t).*p.^2/k);
% end
The error is :
Warning: Failure at t=1.058553e+01. Unable to meet integration tolerances
without reducing the step size below the smallest value allowed
(2.842171e-14) at time t.
> In ode113 at 425
In RunLogOscilNumeric3 at 11