Solving for an mathematical expression under certain parametric conditions

조회 수: 3 (최근 30일)
Subhajit Bej
Subhajit Bej 2020년 5월 5일
댓글: Walter Roberson 2020년 5월 8일
Hello,
How do I solve a mathematical expression for certain conditions?
For example, how do I solve for A or FIE in the limit x<<eps2?
Please, find attached my code.
syms n0 ns eps2 x
% ne=n0*Sin[theta0];
% n0=1;
% ns=1.5;
neu=ns*n0^(-1);
thetac=asind(neu);%critical angle
thetab=atand(neu);%Brewster's angle
thetaqb=acosd(((neu^2-1)*sqrt(neu^2+1))*(neu^4+1)^(-1));%Pseudo-Brewster angle
theta0=thetaqb;%The critical angle of 41.8 degrees,...
%the quasi-Brewster angle of 69.2 degrees,...
%and the pseudo-Brewster angle of 84.8 degrees.
ne=n0*sind(theta0);
% thetas=ArcSin[ne/ns];
thetas=asind(ne*ns^(-1));
% Z0=n0/Cos[theta0];
Z0=n0*cosd(theta0)^(-1);
% Zs=ns/Cos[thetas];
Zs=ns*cosd(thetas);
% n2=ne^2-I*eps2;
% eps2=;
n2=ne^2-1i*eps2;
% m11=1+(n2*(x^2))/2;
% x=;
m11=1+(n2*x^2)*0.5;
% m12=x*n2/eps2;
m12=x*n2*eps2^(-1);
% m21=x*eps2;
m21=x*eps2;
% m22=m11;
m22=m11;
% dnm=(m11+m12*Zs)*Z0+(m21+m22*Zs);
dnm=(m11+m12*Zs)*Z0+(m21+m22*Zs);
% r=((m11+m12*Zs)*Z0-(m21+m22*Zs))/dnm;
r=((m11+m12*Zs)*Z0-(m21+m22*Zs))*dnm^(-1);
% t=2*Z0/dnm;
t=2*Z0*dnm^(-1);
% R=Abs[r]^2;
R=abs(r)^2;
% T=Re[Zs]/Z0*(Abs[t]^2);
T=real(Zs)*(Z0*abs(t)^2)^(-1);
% A=1-T-R;
A=1-(T+R);
% FIE=n0*A*Cos[theta0]/eps2/x;
FIE=(n0*A*cosd(theta0))*(eps2*x)^(-1);

답변 (1개)

Guru Mohanty
Guru Mohanty 2020년 5월 8일
Hi, I understand you want to solve a equation under some parametric condition. To set some parametric condition you can use assume function. Here is a sample code using assume function.
syms x y
assume(x>y)
expr1 = 2*x-3*y==0;
expr2 = x + y ==2;
expr = [expr1;expr2];
solve(expr)
  댓글 수: 1
Walter Roberson
Walter Roberson 2020년 5월 8일
Note: solve() does not always pay attention to assumptions. When you get a result from solve() it is always a good idea to check that it really does pass all of the requirements.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Physics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by