フィルターのクリア

I am trying to generate these 3 plots

1 回表示 (過去 30 日間)
Mr.DDWW
Mr.DDWW 2022 年 3 月 3 日
回答済み: Walter Roberson 2022 年 3 月 3 日
  5 件のコメント
Mr.DDWW
Mr.DDWW 2022 年 3 月 3 日
clc;clear all;
n=100000;
alphat=1;
y_b=linspace(0,1);
% y_b=.1
for j=1:length(y_b)
sum_D=0;
for i=1:n
sum_D=sum_D+(((-1)^(i-1))/(((i-1)+0.5)*pi))*exp(-((i-1)+0.5)^2*pi^2*alphat)*cos((i-1)+0.5)*pi*y_b(j);
end
F(j)=2*sum_D;
end
plot(y_b,F);grid on;
I tried but not correct
Walter Roberson
Walter Roberson 2022 年 3 月 3 日
Regardless of the theoretical shape, you can see from the below with very reduced n that after n = 2, the terms are too small to make any difference in the summation.
n=5.0000;
alphat=1;
y_b=linspace(0,1,10);
% y_b=.1
Pi = sym(pi);
for j=1:length(y_b)
sum_D = sym(zeros(1,n));
for i=1:n
sum_D(i)=(((-1)^(i-1))/(((i-1)+0.5)*Pi))*exp(-((i-1)+0.5)^2*Pi^2*alphat)*cos((i-1)+0.5)*Pi*y_b(j);
end
vpa(sum_D)
F(j)=2*sum(sum_D);
end
ans = 
ans = 
ans = 
ans = 
ans = 
ans = 
ans = 
ans = 
ans = 
ans = 
F(1:min(end,10)).'
ans = 
vpa(ans)
ans = 
plot(y_b,F);grid on;
simplify(F ./ F(2))
ans = 
vpa(ans)
ans = 

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

回答 (1 件)

Walter Roberson
Walter Roberson 2022 年 3 月 3 日
sum_D(i)=(((-1)^(i-1))/(((i-1)+0.5)*Pi))*exp(-((i-1)+0.5)^2*Pi^2*alphat)*cos((i-1)+0.5)*Pi*y_b(j);
Look at that. How does the change of j affect it ?
j does not show up until y_b(j) which is a multiplier. And it is constant for all the different I values. So the result is going to be same as if you calculated for all the i values without including the y_b(j) term, and then multiplied by the y_b(j) term afterwards.
Which means that the result is going to be exactly the same each time, except multiplied by y_b(j) . And since the y_b is linear, that means you get a linear result.

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by