how can solve the ratio in matlab
5 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
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.
0 个评论
更多回答(1 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Mathematics and Optimization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!