ํ•„ํ„ฐ ์ง€์šฐ๊ธฐ
ํ•„ํ„ฐ ์ง€์šฐ๊ธฐ

Finding the roots of an equation using Newton-Raphson method but I don't know the equation!

์กฐํšŒ ์ˆ˜: 4 (์ตœ๊ทผ 30์ผ)
qwerty3
qwerty3 2020๋…„ 11์›” 26์ผ
๋Œ“๊ธ€: Jim Riggs 2020๋…„ 11์›” 27์ผ
Hi all,
This is a challenging problem that I'm having difficulties with.
I've been given a P-code file (protected/hidden MATLAB code) that contains a function f function of two input variables ๐‘ฅ, ๐‘ฆ.
I'm to use my own my own coding of the Newton-Raphson to find all the roots of ๐‘“, i.e. ๐‘“(๐‘ฅ, ๐‘ฆ) = 0, given ๐‘ฅ, ๐‘ฆ are real variables defined between [โˆ’5, 5]. Hint: The function roots are "special" points (unsure what is meant by that bit).
I have uploaded the P-code containing the unknown function here.
I can plot the function using the fsurf function:
fsurf(@unknownFunction)
And I can render the following plot:
Plot rendered when unknownFunction.p is used with fsurf
This shows me that it has four roots.
I have absolutely no idea where to go from here. Every iteration of Newton-Raphson requires me to work out the first derivate of ๐‘“(๐‘ฅ, ๐‘ฆ) (so (๐‘“'(๐‘ฅ, ๐‘ฆ) ) in order to progress which obviously I cannot do due to not knowing the original function.
Can anyone offer me some ideas or support? I'm also a complete novice at MATLAB so detail would be appreciated if possible.
Thank you.

๋‹ต๋ณ€ (1๊ฐœ)

Jim Riggs
Jim Riggs 2020๋…„ 11์›” 26์ผ
You use a numerical approximation for the derivative.
Start at some initial guess for x & y.
take a small step, and compute the change in the function value over deltax and delta y.
These are numerical estimates of df/dx and df/dy.
  ๋Œ“๊ธ€ ์ˆ˜: 7
James Tursa
James Tursa 2020๋…„ 11์›” 27์ผ
Also, finding local minima of a function is not the same thing as finding roots of a function. What is the actual goal here?
Jim Riggs
Jim Riggs 2020๋…„ 11์›” 27์ผ
Yes, separating out dx and dy is probably more correct.

๋Œ“๊ธ€์„ ๋‹ฌ๋ ค๋ฉด ๋กœ๊ทธ์ธํ•˜์‹ญ์‹œ์˜ค.

์นดํ…Œ๊ณ ๋ฆฌ

Help Center ๋ฐ File Exchange์—์„œ Newton-Raphson Method์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ธฐ

์ œํ’ˆ


๋ฆด๋ฆฌ์Šค

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by