Root of nonlinear equation on Simulink

3 次查看(过去 30 天)
Hello, how can i find the root of a nonlinear equation using Simulink? Can i use the Newton Raphson Method?
I have to find the variable E in this equation:
M = E - e*sin(E)
Thanks,
Lucas.
  6 个评论
Lucas Casaril
Lucas Casaril 2019-2-11
How can I use an interpolation method using block diagramn in Simulink?
Jim Riggs
Jim Riggs 2019-2-11
Oh. I interpreted 'e' as the constant 'e' as in exp(1).
With e having a value between 0 and 1 there are no inflection points, and there is only one root.

请先登录,再进行评论。

回答(1 个)

Jim Riggs
Jim Riggs 2019-2-11
编辑:Jim Riggs 2019-2-11
Since root finding involves itteration, I would implement this as an MEX function in Simulink. Build a root solver function in Matlab that you can put in a Matlab block. The Newton Raphson method should work fine, but I would still use a limit value on the step change in E when searching for the root, since for larger values of e, the slope can be rather small. A limit of 0.5 looks like a reasonable value (i.e. dont allow your guess in the value of E to change by more than +/- 0.5 for each itteration.
dM/dE = 1-e*cos(E)
  2 个评论
Jim Riggs
Jim Riggs 2019-2-11
编辑:Jim Riggs 2019-2-11
Note that if you can put other limits on the value of M, (or e) you can relax (increase) the step size limit and it will converge faster. The problem is primarily with areas of the curve where the slope is very small. This happens for large values of e where M is near zero or near 6.28.
So if M will never be < 0.2, or greater than 6, you can use a larger limit on the step.
Another approach is to put a lower limit on the slope calculation. For example, don't alows the absolute value of dM/dE to be less than some limit value (this is another way of limiting the size of the correction step). Make sure to test your algorithm with e=1 near M=0 and M=6.28, since these are the areas where the solution is the most sensitive.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by