Solution of trigonometric equation

6 次查看(过去 30 天)
I have to find the solutions of
scale_length=(Esi*tan(pi*tox./x)-Eox*cot(pi*tsi./(2*x))) %(1)
or
(Esi*tan(pi*tox./x)=Eox*cot(pi*tsi./(2*x))
w.r.t x or sometimes I called x as lambda
so what I did I plotted this:
scale_length1=(tan(3.14*tox./x).*tan(1.57*tsi./(x)))-(3.9/11.8); %(2)
where Eox/Esi=3.9/11.8
code for do this is :
------% All Constants are in MKS-----%
E0=8.85e-12%F/m Vacuum permittivity
Eox=3.9*E0;%F/m permittivity of SiO2
Esi=11.8*E0;%F/m permittivity of Si
tox=1e-9;%oxide thickness in meters
tsi=10e-9;%silcon channel thickness in meters
x=1e-9:1e-10:50e-9;%direction along channel in meters
scale_length1=(tan(3.14*tox./x).*tan(1.57*tsi./(x)))-(3.9/11.8);%characteristics
equation
plot(x,scale_length1,'r')
ylim([-5 5])
refline(0,0)
now for solutions, I marked the intersection points of ref line and scale equation(2) for example see in the solutions.pdf attached file in which x1,x2,x3,x4 are the four solutions of equation 1 for tox=1nm and tsi=10nm case but by this, we can only get the solutions by observing the plot
not by MATLAB what I wanted that MATLAB should give the solutions of equation 1 by itself for example, tox=1nm and tsi=10nm solutions are 15.45nm, 4.47nm, 2.4667nm, 1.678nm
but this is by plot I'm also attaching a solution file and a file in which solutions for different tox and tsi combinations mentioned
I hope this would help
For more understanding of solutions, we can refer code provided by @John Sir, below although I think this also gives the solutions via plot, not by MATLAB which is my primary concern that answers should be given by MATLAB not by the plot(observing the intersection points)

采纳的回答

John D'Errico
John D'Errico 2017-9-30
This seems silly. Why are you using a 3 digit approximation to pi (and pi/2) here, then trying to solve for anything?
pi is already well defined in MATLAB.
format long g
pi
ans =
3.14159265358979
And pi/2 is also well defined. You write it as
pi/2
ans =
1.5707963267949
Of course, all of your other numbers are equally short, and I am sure, are not exactly values like 3.9 and 11.8.
Next, if you want results to have units of NANOMETERS, then setting tsi and tox to be on the order of 1e-9 is silly!
tox MUST have units of nanometers for your equations to make any sense at all. Therefore, tox is 1. Then x will also have units of nanometers, and it should be on the order of 1 too.
Eox = 3.9;
Esi = 11.8;
tox = 1;
tsi = 10;
x = 1:0.1:50;
So now everything will have units of nanometers. A number means something only to you. You must define the context, or a number is just a number. So if all numbers of interest are in the form of nanometers, then all is fine.
Regardless, it looks like you are trying to solve for all solutions of a problem that probably has infinitely many solutions.
So if we look for small x, then we see this plot:
ezplot(@(x) (tan(pi*tox./x).*tan(pi/2*tsi./(x)))-(3.9/11.8),[.01,2]);
ylim([-5 5])
refline(0,0)
Are you looking for the 4 largest solutions?
So if we instead re-parameterize your problem in terms of u=1/x, now looking for the smallest solutions, of infinitely many solutions, we will see this:
ezplot(@(u) (tan(pi*tox*u).*tan(pi/2*tsi*u))-(3.9/11.8),[0,.75]);
refline(0,0)
So for u=1/x no larger than 0.75 nanometers, we see the first 4 solutions, represented graphically. As x gets smaller, there will be infinitely many more solutions. But those are the possible solutions for the smallest values of u, and therefore, the largest values of x.
The difference is, when we try to plot this relation as a function of x, it gets nasty looking. Instead, things are more well behaved when we look for the smallest solutions in u, thus 1/x.
  3 个评论
John D'Errico
John D'Errico 2017-9-30
编辑:John D'Errico 2017-9-30
What you don't understand is that when you approximate coefficients to 3 digits, the error in the solution will often be amplified. You have perturbed the function from the true one that you want to solve, into some approximation, with a solution that is different from what you are looking for. But the perturbation may be one that amplifies the error in your coefficients. Being sloppy with computations leads to sloppy results, when it was never needed. Worse, being sloppy introduces random errors into a problem that you apparently don't even know how to solve. So you have no idea if the perturbed solution is close to the desired one or not.
As for solving the problem, USE FZERO!!!!!!!!!! There is nothing complicated here.
ufun = @(u) (tan(pi*tox*u).*tan(pi/2*tsi*u))-(3.9/11.8);
u1 = fzero(ufun,[0,.1])
u1 =
0.0645640586835582
1/u1
ans =
15.4884934496018
Was that really difficult?
For the next root, just pick out an interval where the solution lives, then apply fzero. You can even do it automatically, just by evaluating the function at a sequence of points, then looking for sign changes. Watch out for the singularities of course, since there will generally be a singularity between each pair of true roots. The one exception to that rule seems to be around 1.
Some basic analysis should even be able to identify where the singularities lie. That is, for which values of z does tan(z) have a singularity? Now look at your function. It is just a product of two tangents.
Note that by transforming the problem in terms of u, the singularities are now at nice simple increments. This is a simple problem.
NILESH PANDEY
NILESH PANDEY 2017-10-11
Thanks Sir I just checked your method this gives the correct results although I was using fzero command earlier but I wasn't converting the singularity as you did in your last comment
So, I was only getting the principle root(only one largest) no matter I reduce the interval for fzero or not
but your method is quite easy and correct to do the same thanks for your help and time I really appreciate that

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by