Trying to Find the solution of trigonometric equation

4 次查看(过去 30 天)
i am trying to solve Esi*tan(pi*tox/y)-Eox*cot(pi*tsi/(2*y))=0 for finding the value of y where Esi=11.68*8.85e-12; Eox=3.9*8.85e-12;
i am trying to find y for various tox and tsi combinations let for case 1:tox=1e-9; tsi=10e-9; now matlab is not giving any solution i am attaching my code for this. i think this equation has many solutions for a particular tox,tsi so may be that's why matlab is not giving the answers can any one give me the code by that i can get every or at least two three solutions (values of y)? (tox,tsi should be in nano meter scale)

采纳的回答

Roger Stafford
Roger Stafford 2016-12-28
Rather than using ‘solve’, you should try ‘fzero’ with various different estimated values for y obtained from doing a plot. This will give you a number of precise values for y. There should be an infinite number of possible solutions to this equation as y approaches zero. (Note: It might be more convenient to first find solutions for 1/y and then take their reciprocals.)
  2 个评论
NILESH PANDEY
NILESH PANDEY 2016-12-28
编辑:NILESH PANDEY 2016-12-28
Thank you sir, but still i am getting only one value of y i used this code h=8.85e-12; Eox=3.9*h; Esi=11.68*h; tox=1e-9; tsi=10e-9; fun=@(y)(Esi*tan(pi*tox/y)-Eox*cot(pi*tsi/(2*y))) y0=[1e-9 50e-9] y = fzero(fun,y0) can you tell me how to get various value of y? like after running this code i am getting y =
1.5441e-08
why not other values of y?
i have to find at least three values of y
Roger Stafford
Roger Stafford 2016-12-28
The ‘fzero’ function can only obtain one solution per call. You must call it for different values of the y0 “estimate” to obtain different solutions for y.
(Note: It might be easier for computing and plotting purposes to alter your function to the following equivalent form:
fun=@(y)(Esi*sin(pi*tox/y)*sin(pi*tsi/(2*y))-Eox*cos(pi*tox/y)*cos(pi*tsi/(2*y)))
This function doesn’t have singularities.)

请先登录,再进行评论。

更多回答(1 个)

John D'Errico
John D'Errico 2016-12-28
编辑:John D'Errico 2016-12-28
I think it easy to overlook the logical. :) So, lets apply some common sense here. Suppose you had a solution y for a given Tsi and Tox? Then it it is true that if you doubled the values of both Tsi and Tox, then y/2 would be the "same" solution.
That points out the logical conclusion, that really what matters is not the (unspecified, unknown) values of Tox, Tsi, but their ratio!
As well, Roger points out there there will typically be infinitely many solutions. What is typically desired is the principle solution in these case. And as y approaches zero, the solutions will multiply. What you really want is the LARGEST value of y that solves the problem.
Given those points, lets re-parameterize the problem. Define some new variables as:
T = (Tox/Tsi)/2
u = Tox/y
The nice thing is, T and u have no units attached, unitless variables.
So, if you knew the values of Tox, Tsi, then you can solve for the principle value u (here the smallest solution), then you could solve for y directly.
tan(pi*u)-(Eox/Esi)*cot(pi*T*u)=0
See that I intentionally put the factor of 1/2 into T, to make the problem simpler to write. In fact, what really matters is not the exact value of Esi, Eox, but their ratio too.
Regardless, the above is now a 2-variable problem, in u and T. We can think of it as an implicit function u(T). This is something that could be plotted I suppose.
Esi=11.68*8.85e-12;
Eox=3.9*8.85e-12;
syms u T
solve(tan(pi*u)-(Eox/Esi)*cot(pi*T*u)== 0,u)
Warning: Cannot find explicit solution.
> In solve (line 316)
ans =
Empty sym: 0-by-1
So, no surprise, still no simple analytical solution.
But if you have the ratio T (thus you know the values of Tsi and Tox), then we can solve it. Try T=2 for example.
solve(subs(tan(pi*u)-(Eox/Esi)*cot(pi*T*u)== 0,T,2),u)
ans =
-(log(584/779 - (265785^(1/2)*1i)/779)*1i)/(2*pi)
-(log((265785^(1/2)*1i)/779 + 584/779)*1i)/(2*pi)
>> vpa(ans)
ans =
- 0.11510392754004651087851947005433 + 1.4616073164841064025282536379539e-41i
0.11510392754004651087851947005433 + 1.4616073164841064025282536379539e-41i
There are two solutions, with essentially zero imaginary part.
  1 个评论
NILESH PANDEY
NILESH PANDEY 2016-12-28
Thank you For your explanation it's clarify so much things, yes sir you are right there will be a principal solution let y1 and y2,y3... will be less than y1 or i think they will be less by some factors . in my work i have to find at least three solutions (y1>y2>y3) is there is a relation between these solutions and is there is any way to find out these solutions?

请先登录,再进行评论。

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by