forming table from function call

2 Ansichten (letzte 30 Tage)
shiv gaur
shiv gaur am 2 Feb. 2022
Kommentiert: shiv gaur am 3 Feb. 2022
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 Kommentare
Kevin Holly
Kevin Holly am 2 Feb. 2022
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 am 3 Feb. 2022
all the argument parameter is given in program

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Gamma Functions finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by