if time is so small in series so how plot the figure

1 ビュー (過去 30 日間)
shiv gaur
shiv gaur 2022 年 3 月 2 日
コメント済み: Walter Roberson 2022 年 3 月 3 日
a(1)=1;
b(1)=1;
c(1)=1;
s1=0;
s2=0;
s3=0;
k3=2.8;
k1=0.33;
k2=1;
T=0.1;
t=0:0.01:0.1;
tau=0:0.1:1
tau=zeros(length(t));
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));
s1=s1+(a(i).*tau.^i);
s2=s2+(b(i).*tau.^i);
s3=s3+(c(i).*tau.^i);
disp([s1 s2 s3])
end
tau=0:0.1:1;
so how to plot the graph between tau =t/T where range of tau will be 0 to 1 ie tau=[0 1]; so the range of t=0 to 0.1
so pl plot the graph between plot(t,s1,t,s2,t,s3)

採用された回答

Walter Roberson
Walter Roberson 2022 年 3 月 2 日
a(1)=1;
b(1)=1;
c(1)=1;
s1=0;
s2=0;
s3=0;
k3=2.8;
k1=0.33;
k2=1;
T=0.1;
t=0:0.01:0.1;
tau = t ./ T;
%tau=zeros(length(t));
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));
s1=s1+(a(i).*tau.^i);
s2=s2+(b(i).*tau.^i);
s3=s3+(c(i).*tau.^i);
disp([s1;s2;s3])
end
0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 1.0000 0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 1.0000 0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 1.0000 0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 1.0000 0 0.1040 0.2160 0.3360 0.4640 0.6000 0.7440 0.8960 1.0560 1.2240 1.4000 0 0.1033 0.2134 0.3301 0.4536 0.5837 0.7206 0.8642 1.0144 1.1713 1.3350 0 0.1001 0.2011 0.3036 0.4085 0.5167 0.6288 0.7457 0.8683 0.9972 1.1333 0 0.1039 0.2149 0.3324 0.4555 0.5833 0.7152 0.8503 0.9877 1.1268 1.2667 0 0.1033 0.2131 0.3292 0.4512 0.5791 0.7126 0.8515 0.9955 1.1445 1.2981 0 0.1001 0.2010 0.3031 0.4068 0.5125 0.6202 0.7297 0.8410 0.9535 1.0667 0 0.1039 0.2151 0.3334 0.4587 0.5913 0.7318 0.8810 1.0401 1.2107 1.3946 0 0.1033 0.2131 0.3291 0.4512 0.5791 0.7125 0.8512 0.9950 1.1436 1.2967 0 0.1001 0.2010 0.3032 0.4072 0.5137 0.6232 0.7363 0.8537 0.9764 1.1056 0 0.1039 0.2151 0.3333 0.4581 0.5894 0.7269 0.8704 1.0195 1.1736 1.3316 0 0.1033 0.2131 0.3291 0.4512 0.5790 0.7123 0.8509 0.9944 1.1426 1.2951 0 0.1001 0.2010 0.3031 0.4072 0.5135 0.6224 0.7343 0.8493 0.9674 1.0886 0 0.1039 0.2151 0.3333 0.4582 0.5898 0.7282 0.8738 1.0270 1.1888 1.3603 0 0.1033 0.2131 0.3291 0.4512 0.5790 0.7123 0.8509 0.9943 1.1424 1.2948 0 0.1001 0.2010 0.3031 0.4072 0.5135 0.6226 0.7348 0.8506 0.9705 1.0951 0 0.1039 0.2151 0.3333 0.4582 0.5897 0.7279 0.8729 1.0247 1.1836 1.3494 0 0.1033 0.2131 0.3291 0.4512 0.5790 0.7123 0.8509 0.9943 1.1424 1.2948 0 0.1001 0.2010 0.3031 0.4072 0.5135 0.6225 0.7347 0.8503 0.9696 1.0929 0 0.1039 0.2151 0.3333 0.4582 0.5897 0.7280 0.8731 1.0253 1.1851 1.3530 0 0.1033 0.2131 0.3291 0.4512 0.5790 0.7123 0.8509 0.9943 1.1424 1.2948 0 0.1001 0.2010 0.3031 0.4072 0.5135 0.6225 0.7347 0.8504 0.9698 1.0936 0 0.1039 0.2151 0.3333 0.4582 0.5897 0.7280 0.8730 1.0252 1.1847 1.3520 0 0.1033 0.2131 0.3291 0.4512 0.5790 0.7123 0.8509 0.9943 1.1424 1.2948 0 0.1001 0.2010 0.3031 0.4072 0.5135 0.6225 0.7347 0.8503 0.9698 1.0934 0 0.1039 0.2151 0.3333 0.4582 0.5897 0.7280 0.8730 1.0252 1.1848 1.3523 0 0.1033 0.2131 0.3291 0.4512 0.5790 0.7123 0.8509 0.9943 1.1424 1.2948 0 0.1001 0.2010 0.3031 0.4072 0.5135 0.6225 0.7347 0.8503 0.9698 1.0935 0 0.1039 0.2151 0.3333 0.4582 0.5897 0.7280 0.8730 1.0252 1.1848 1.3522 0 0.1033 0.2131 0.3291 0.4512 0.5790 0.7123 0.8509 0.9943 1.1424 1.2948 0 0.1001 0.2010 0.3031 0.4072 0.5135 0.6225 0.7347 0.8503 0.9698 1.0935 0 0.1039 0.2151 0.3333 0.4582 0.5897 0.7280 0.8730 1.0252 1.1848 1.3522 0 0.1033 0.2131 0.3291 0.4512 0.5790 0.7123 0.8509 0.9943 1.1424 1.2948 0 0.1001 0.2010 0.3031 0.4072 0.5135 0.6225 0.7347 0.8503 0.9698 1.0935 0 0.1039 0.2151 0.3333 0.4582 0.5897 0.7280 0.8730 1.0252 1.1848 1.3522 0 0.1033 0.2131 0.3291 0.4512 0.5790 0.7123 0.8509 0.9943 1.1424 1.2948 0 0.1001 0.2010 0.3031 0.4072 0.5135 0.6225 0.7347 0.8503 0.9698 1.0935 0 0.1039 0.2151 0.3333 0.4582 0.5897 0.7280 0.8730 1.0252 1.1848 1.3522 0 0.1033 0.2131 0.3291 0.4512 0.5790 0.7123 0.8509 0.9943 1.1424 1.2948 0 0.1001 0.2010 0.3031 0.4072 0.5135 0.6225 0.7347 0.8503 0.9698 1.0935 0 0.1039 0.2151 0.3333 0.4582 0.5897 0.7280 0.8730 1.0252 1.1848 1.3522 0 0.1033 0.2131 0.3291 0.4512 0.5790 0.7123 0.8509 0.9943 1.1424 1.2948 0 0.1001 0.2010 0.3031 0.4072 0.5135 0.6225 0.7347 0.8503 0.9698 1.0935 0 0.1039 0.2151 0.3333 0.4582 0.5897 0.7280 0.8730 1.0252 1.1848 1.3522 0 0.1033 0.2131 0.3291 0.4512 0.5790 0.7123 0.8509 0.9943 1.1424 1.2948 0 0.1001 0.2010 0.3031 0.4072 0.5135 0.6225 0.7347 0.8503 0.9698 1.0935 0 0.1039 0.2151 0.3333 0.4582 0.5897 0.7280 0.8730 1.0252 1.1848 1.3522 0 0.1033 0.2131 0.3291 0.4512 0.5790 0.7123 0.8509 0.9943 1.1424 1.2948 0 0.1001 0.2010 0.3031 0.4072 0.5135 0.6225 0.7347 0.8503 0.9698 1.0935 0 0.1039 0.2151 0.3333 0.4582 0.5897 0.7280 0.8730 1.0252 1.1848 1.3522 0 0.1033 0.2131 0.3291 0.4512 0.5790 0.7123 0.8509 0.9943 1.1424 1.2948 0 0.1001 0.2010 0.3031 0.4072 0.5135 0.6225 0.7347 0.8503 0.9698 1.0935 0 0.1039 0.2151 0.3333 0.4582 0.5897 0.7280 0.8730 1.0252 1.1848 1.3522 0 0.1033 0.2131 0.3291 0.4512 0.5790 0.7123 0.8509 0.9943 1.1424 1.2948 0 0.1001 0.2010 0.3031 0.4072 0.5135 0.6225 0.7347 0.8503 0.9698 1.0935 0 0.1039 0.2151 0.3333 0.4582 0.5897 0.7280 0.8730 1.0252 1.1848 1.3522 0 0.1033 0.2131 0.3291 0.4512 0.5790 0.7123 0.8509 0.9943 1.1424 1.2948
plot(t, s1, t, s2, t, s3)
  6 件のコメント
Walter Roberson
Walter Roberson 2022 年 3 月 3 日
And your s values are over 10^300 and 10^500
format long g
a(1) = sym(0);
b(1) = sym(1);
c(1) = sym(0);
s1 = sym(0);
s2 = sym(0);
s3 = sym(0);
k3=28;
k1=8/3;
k2=10;
T=0.1;
t=0:0.01:1;
tau = t ./ T;
%tau=zeros(length(t));
for i=1:20
a(i+1)=(1/sym(i+1)).*(b(i)-a(i))*k2;
b(i+1)=(1/sym(i+1)).*(a(i).*T*(k3-c(i))-b(i));
c(i+1)=(1/sym(i+1))*(T*a(i).*b(i)-k1*c(i));
if ~all(isfinite([a,b,c]),'all')
subplot(3,1,1); plot(abs(log10(a))); title('log10(abs(a))')
subplot(3,1,2); plot(abs(log10(b))); title('log10(abs(b))');
subplot(3,1,3); plot(abs(log10(c))); title('log10(abs(c))');
disp(a)
disp(b)
disp(c)
error('first loop broke at i = %d', i);
end
end
for i=1:20
s1=s1+(a(i).*tau.^i);
s2=s2+(b(i).*tau.^i);
s3=s3+(c(i).*tau.^i);
if ~all(isfinite([s1,s2,s3]),'all')
disp(s1)
disp(s2)
disp(s3)
error('second loop broke at i = %d', i);
end
end
plot(tau, s1, tau, s2, tau, s3);
title('original');
legend({'s1', 's2', 's3'});
plot(tau, log10(abs(s1)), tau, log10(abs(s2)), tau, log10(abs(s3)));
title('log10(abs(s))');
legend({'s1', 's2', 's3'});

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Find more on Interactive Control and Callbacks in Help Center and File Exchange

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by