How can I shrink the time of getting the results please?
Show older comments
I run the following code for 13 days until I got the results so could anyone advise me if there is any truck that I can use to shrink the time please? Because I need to run the code for different values!
function FisherN01analyticalsmallomega
y0=1;
a=1
c=50;
b = 2.5
t =(0:0.1:10000);
y = logisticOscilanalytical(t,c,y0,b,a);
Y = @(T) interp1(t,y,T);
g = @(t) ( (b.*sin(b.*t) + cos(b.*t).* (2.*Y(t)./c)).^2./(a.^2.*sin(b.*t).^3 .* (Y(t) - (Y(t).^2).^2))) );
t= (0:10:10000);
N = length(t);
JT = zeros(1,N);
for i = 1:N
JT = integral(g,0,t(1,i),'ArrayValued',true);
end
figure(1)
plot(t,JT,'-','LineWidth',2)
1;
% function y = logisticOscilanalytical(t, c, y0, b, a)
% ee = exp( (a/ b) * (1- cos( b*t)));
% y = (-c.* y0.* ee)./ ( (y0 - c) - y0.* ee);
% end
2 Comments
Jan
on 28 May 2015
I've formatted the code, because it was not readable. Please use the "{} Code" button. Do not post code which is commented out - this confuses the readers.
Avan Al-Saffar
on 28 May 2015
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!