Trying to Find the solution of trigonometric equation
5 views (last 30 days)
Show older comments
NILESH PANDEY
on 28 Dec 2016
Commented: Roger Stafford
on 28 Dec 2016
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)
0 Comments
Accepted Answer
Roger Stafford
on 28 Dec 2016
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 Comments
Roger Stafford
on 28 Dec 2016
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.)
More Answers (1)
John D'Errico
on 28 Dec 2016
Edited: John D'Errico
on 28 Dec 2016
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.
See Also
Categories
Find more on Particle & Nuclear Physics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!