how can solve the ratio in matlab

조회 수: 9 (최근 30일)
Wajahat
Wajahat 2017년 8월 8일
편집: John D'Errico 2017년 8월 9일
how can i solve the the ratio in matlab
y(x)=1./((a^2 + b^2)e^x + (c^2 + d^2)e^-x)
where a, b,c and d are constant.
answer would be some sech()....
  댓글 수: 4
dpb
dpb 2017년 8월 8일
What "ratio"?
It's only sech(x) if (a^2 + b^2)=(c^2 + d^2)--> 1/2
Wajahat
Wajahat 2017년 8월 9일
But in this case (a^2 + b^2) is not equal to (c^2 + d^2), and i want to write the ratio in terms of hyperbolic function in matlab.

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

채택된 답변

John D'Errico
John D'Errico 2017년 8월 9일
편집: John D'Errico 2017년 8월 9일
Sigh. Has no one yet given you a useful answer yet? That is because this is simply not a question about MATLAB, in the sense that it is far easier solved using pencil and paper. Had you asked the question on a forum about mathematics, you would have gotten an answer quickly.
This is a basic transformation of variables problem. You know where you want to go. But sometimes directing a symbolic tool to give you the answer in the form you want is not trivial. Symbolic tools do as they "want", and they cannot see a fundamental form as a target.
First, make things simple.
u = a^2 + b^2
v = c^2 + d^2
Remember that u and v will always be non-negative, in case that proves to be necessary later on. Then we have:
y = 1/(u*exp(x) + v*exp(-x))
Next, pull v out of there. by defining w = u/v.
y = (1/v) * 1/(w*exp(x) + exp(-x))
So, really, this comes down to a simple problem. Even simpler when w==1, since y reduces to y=sech(x)/(2*v)
For w larger or smaller than 1, we can do another transformation. (I'm running out of variable names.)
w = exp(s)
y = (1/v) * 1/(exp(x + s) + exp(-x))
Now, we should remember that a standard sech has a point of symmetry at x==0, but we should also see that this function is just another linear transformation or so away from the target. It has a point of symmetry at x==-s/2. That should help us to recognize the next transformation.
z = x + s/2
y = (1/v)*1/(exp(s/2 + z) + exp(s/2 - z))
Factor out exp(s/2) from those exponentials.
y = 1/(v*exp(s/2)) * 1/(exp(z) + exp(-z))
Now, time to recognize some basic things. exp(s) was w. So exp(s/2) is sqrt(w).
AND don't forget that now we have finally found sech(z) in there.
y = 1/(v*sqrt(w)) * 1/2*sech(z)
y = 1/(2*v*sqrt(w)) * sech(x + s/2)
Finally, if you want, do some more un-transformations to get it all back in terms of a,b,c,d.
You need to make some effort here though. You should now be able to see yourself the rest of your way home on what may even be homework.

추가 답변 (1개)

Akhilesh Thakur
Akhilesh Thakur 2017년 8월 8일
http://www.mathworks.com/matlabcentral/newsreader/view_thread/320259 Are you asking is there any command to solve ratio? Why do you need command if you can create your own function. You just have to divide and call it.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by