How can I use Newton’s Method when I have a 2D domain?

5 views (last 30 days)
I have a 2D domain (x,y) and the implicit function I have to solve using the Newton's Method is:
alpha_test - dC/dx*tan(alpha_test) + dC/dy = 0
The input I have is the matrix domain (x,y), the values of C for each point of the domain.
I used the finite difference method to find dC/dx and dC/dy.
The output I need to obtain is a matrix with the values of alpha defined everywhere in my domain.
Thank you in advance for helping.

Answers (1)

John D'Errico
John D'Errico on 10 Feb 2023
Don't write code for Newton's method, when you can use fzero. Just put a loop around it, and call fzero for each pair of dC/dx and dC/dy.
Never write code to do what existing code already does well. This is certainly true unless you can write better code than the professional wrote, a person who is highly skilled in both MATLAB and in numerical analysis. (And if you can do that, then you would not be asking this question in the first palce.)

Categories

Find more on Optimization in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!