blank plot with out value

a(1)=1;
b(1)=1;
c(1)=1;
s1=0;
s2=0;
s3=0;
k3=28;
k1=8/3;
k2=10;
t=1:20;
for i=1:20
a(i+1)=(1/i+1)*(b(i)-a(i))*k2;
b(i+1)=(1/(i+1))*(a(i)*(k3-c(i))-b(i));
c(i+1)=(1/(i+1))*(a(i)*b(i)-k1*c(i));
end
for i=1:20
s1=s1+(a(i).*t.^i);
s2=s2+(b(i).*t.^i);
s3=s3+(c(i).*t.^i);
end
plot(t,s1)
pl you are req to plot the plot between t vs s1 may be data overflow so how to remove it

2 Comments

Describe the equations you are trying to plot. Current equations are going to inf and result in nan values in s1.
this is lorenz equation which is change in power series a b c from x y z
a(i+1)=(1/i+1)*(b(i)-a(i))*k2;
b(i+1)=(1/(i+1))*(a(i)*(k3-c(i))-b(i));
c(i+1)=(1/(i+1))*(a(i)*b(i)-k1*c(i));

Sign in to comment.

Answers (2)

I think you mean s1 vs. t. If so, maybe this is what you want:
a(1)=1;
b(1)=1;
c(1)=1;
s1=0;
s2=0;
s3=0;
k3=28;
k1=8/3;
k2=10;
t=1:20;
for k=1:20
a(k+1)=(1/k+1)*(b(k)-a(k))*k2;
b(k+1)=(1/(k+1))*(a(k)*(k3-c(k))-b(k));
c(k+1)=(1/(k+1))*(a(k)*b(k)-k1*c(k));
end
% Now make t (currently 20 long) the same length (21) as "a":
t = 1 : length(a);
for k=1: length(a)
s1(k+1) = s1(k) + (a(k) .* t(k) .^ k);
s2 = s2 + (b(k) .* t(k) .^ k);
s3 = s3 + (c(k) .* t(k) .^ k);
end
% Now make t (currently 22 long) the same length (22) as s1:
t = 1 : length(s1);
% Now plot
plot(t, s1, 'b-', 'LineWidth', 2)
grid on;
xlabel('t');
ylabel('s1')

7 Comments

is there y value is so high so possible real results be such like that in fig
this is plot between t vs s2 real fig
fig is not matching data overflow may be problem so high value is right or not
@shiv gaur they're your equations not mine. I didn't alter them. So if they're wrong, I'll leave it up to you to correct them.
I have never seen this high value is this possible
I havef no idea. I haven't delved into the equations or your implementation of the formulas from the paper. I'll leave that to you. Good luck though.
is there any help to see the research paper and try to reproduce the fig5 ,4 of lorenz system which platform is use for helping

Sign in to comment.

Walter Roberson
Walter Roberson on 28 Feb 2022
You can remove that problem by using the symbolic toolbox for the calculations.
This will not be fast, but at least you will get some value instead of inf or nan. The values will probably reach the order of 10^26000 .

3 Comments

sir I am sending research paper on which they solve the problem only 20 iteration the x y z value is around 40 range pl see the fig 5 in this paper author say that the challenge problem for any numerical tool whereas they use eq 33 to 34 using power series how can resolve this problem in this research paper graph reproduce how how is not possible in our case
is there any help to see the research paper and try to reproduce the fig5 ,4 of lorenz system which platform is use for helping
Original plot is blank because every value is so far out of range that it cannot be plotted. The second shows the log10 of the data -- it is obviously trending to the order of -10^5000
Reminder: your role is to show you things like the below, how to get extended range. Our role is not to do your research for you or examine papers to come up with the correct equations for you. We help you understand MATLAB; we mostly do not help you to understand the science or mathematics.
N = 20;
a = sym(zeros(N+1,1));
b = sym(zeros(N+1,1));
c = sym(zeros(N+1,1));
a(1) = 1;
b(1) = 1;
c(1) = 1;
s1 = sym(0);
s2 = sym(0);
s3 = sym(0);
k3 = sym(28);
k1 = sym(8)/3;
k2 = sym(10);
t = sym(1:N+1).';
for i=1:N
a(i+1)=(1/i+1)*(b(i)-a(i))*k2;
b(i+1)=(1/(i+1))*(a(i)*(k3-c(i))-b(i));
c(i+1)=(1/(i+1))*(a(i)*b(i)-k1*c(i));
end
for i=1:N
s1=s1+(a(i).*t.^i);
s2=s2+(b(i).*t.^i);
s3=s3+(c(i).*t.^i);
end
s1
s1 = 
vpa(s1)
ans = 
subplot(2,1,1);
plot(double(t), double(s1)); title('original')
subplot(2,1,2);
plot(double(t), double(log10(-s1))); title('log10')

Sign in to comment.

Categories

Find more on Mathematics in Help Center and File Exchange

Products

Release

R2021b

Asked:

on 28 Feb 2022

Commented:

on 28 Feb 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!