forming table from function call

1 回表示 (過去 30 日間)
shiv gaur
shiv gaur 2022 年 2 月 2 日
コメント済み: shiv gaur 2022 年 2 月 3 日
la0 = 650; k0 = 2*pi/la0; a = 100/2;
ef = 1; ec = -19.6224 - 0.443*j; % set ec = -16.6224
pc = ef/ec; tol = 1e-12;
q = (0:3)’; m=0; % set m=0,1 for even or odd modes
ga1 = 1/k0/a*atanh(-pc) - j*pi/2/a/k0*(m+2*q);
ga2 = 1/k0/a*atanh(-pc) + j*pi/2/a/k0*(m+2*q);
gin = [ga1.’; ga2.’]; gin = gin(:); % list them as -/+ pairs
q = [q’;q’]; q = q(:);
gin(1)=[]; q(1)=[]; % eliminate duplicate q=0 case
bin = sqrt(gin.^2 + ef); % initial search vector
be = pwg(la0,ef,ec,a,bin,m,tol); % solution vector for beta
ga = sqrt(be.^2 - ef); ac = sqrt(be.^2 - ec); % gamma and alpha_c vectors
E = norm(pc*ac + ga.*tanh(ga*k0*a + j*m*pi/2)) % computational error norm
num2str([be,ga,ac],’%12.6f’) % table
pl form the table from the following program
  2 件のコメント
Kevin Holly
Kevin Holly 2022 年 2 月 2 日
la0 = 650; k0 = 2*pi/la0; a = 100/2;
ef = 1; ec = -19.6224 - 0.443*j; % set ec = -16.6224
pc = ef/ec; tol = 1e-12;
q = (0:3)'; m=0; % set m=0,1 for even or odd modes
ga1 = 1/k0/a*atanh(-pc) - j*pi/2/a/k0*(m+2*q);
ga2 = 1/k0/a*atanh(-pc) + j*pi/2/a/k0*(m+2*q);
gin = [ga1.'; ga2.']; gin = gin(:); % list them as -/+ pairs
q = [q';q']; q = q(:);
gin(1)=[]; q(1)=[]; % eliminate duplicate q=0 case
bin = sqrt(gin.^2 + ef); % initial search vector
be = pwg(la0,ef,ec,a,bin,m,tol); % solution vector for beta
Unrecognized function or variable 'pwg'.
ga = sqrt(be.^2 - ef); ac = sqrt(be.^2 - ec); % gamma and alpha_c vectors
E = norm(pc*ac + ga.*tanh(ga*k0*a + j*m*pi/2)) % computational error norm
num2str([be,ga,ac],'%12.6f') % table
Do you have the function pwg?
I assume you are doing something similiar to what starts on page 17 here.
shiv gaur
shiv gaur 2022 年 2 月 3 日
all the argument parameter is given in program

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

回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by