One mistake in what you are both doing: Do not use == there to form equ1. Just subtract off the right hand side constant.
The == prevents you from ever plotting anything. And that prevents you from seeing the fundamental shape of what results. And that prevents you from thinking about the real problem in what you wish to solve.
Next, recognize the result is just a ratio of a pair of sinh terms, less a constant. So if I look at the resulting expression, we have
kb = Q(1.38)*Q(10)^(-23);
h = Q(6.626)*Q(10)^(-34);
e = Q(1.602)*Q(10)^(-19);
equ1 = ((T*sinh((2*(Pi^2)*kb*T0*x)/hbar*e*B))/(T0*sinh((2*(Pi^2)*kb*T*x)/hbar*e*B))) - (A/A0)
equ1 =

Again, a ratio of simple sinh terms. so the fundamental shape is symmetric in x. But perhaps it is better to clear that fraction. I'll also divide by T. As long as we are not interested in the trivial solution at x==0, even if such a solution exists, we can do this (We know that sinh has no other zeros besides at zero, so this changes nothing else in the problem.)
equ2 = ((sinh((2*(Pi^2)*kb*T0*x)/hbar*e*B)) - (A/A0/T)*(T0*sinh((2*(Pi^2)*kb*T*x)/hbar*e*B)));
And, as well, the scaling of this thing is miserable. so a simple transformation will help to make the numbers better.
equ3 = subs(equ2,x,y*1e5);
vpa(equ3,5)
ans = 
You should agree I have done nothing that changes the fundamental nature of the problem. But what I did was make it easier to work with, and easier to understand the next steps because we can understand these simple numbers a little better.
We are looking for the root(s) of that thing. Again, recognize this is symmetric in x (as well as y now.) y == 0 is clearly a solution, but a spurious one created when we cleared the fraction. So ignore that solution.
Do any other roots exist? In fact, the first sinh term will dominate the result, because sinh grows in magnitude so rapidly. One trick is to consider the Taylor series of equ3, remembering this old rule as we go:
vpa(taylor(equ3,'order',50),3)
The point is to carefully look at the coefficients of every term in that series. I generated a lot of terms here, just to convince you that none of the coefficients are negative, at least out that far. So if we have a root at zero, and all coefficients of the Taylor polynomial are positive, then we can assert that no other root exists. (A useful fact to remember - The Taylor series for sinh(u) is convergent for all u. Therefore, if we can prove no root can exist for the Taylor polynomial in this case, then no root can exist for the original function either.) And since the result is a symmetric function in the unknown (there may only be odd order terms in the Taylor polynomial, think about it - this is just the difference of a pair of sinh terms), then no negative root exists either.
So next, I suppose we could spend some time to compute the general coefficient in the Taylor expansion of this function, then to prove it must always be positive. I think I can do that, based on the Taylor series expansion for sinh.
It is pretty simple really. The Taylor series of sinh(u) has only odd terms in it, and the nth term is just u^(2*n+1)/factorial(2*n+1). But since the sinh(4.1381*y) in our expansion will dominate the sinh(1.738*y) term, the difference of the two will always have a positive coefficient, for large n as well as small.
And again, as long as the resulting polynomial always has positive coefficients (with a zero constant term) then there are no positive roots, nor are there any negative roots due to symmetry.
One other comment: I see you think there was a root near -50? That was at best a spurious one, due to numerical problems since we have shown no roots can exist. When x is small in your original version equ1, you were dividing by a VERY small number when x is approximately -50. And that will cause numerical problems. That is not an issue in what I did. As long as EVERY coefficient in the Taylor series expansion of equ3 is uniformly positive (they are) then no root can exist other than zero.
2 Comments
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/693225-sinh-solver-and-numerical-solution#comment_1205990
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/693225-sinh-solver-and-numerical-solution#comment_1205990
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/693225-sinh-solver-and-numerical-solution#comment_1215875
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/693225-sinh-solver-and-numerical-solution#comment_1215875
Sign in to comment.