Questions tagged [newtons-method]

In numerical analysis, Newton's method (also known as the Newton–Raphson method) is a method for finding successively better approximations to the roots (or zeroes) of a real-valued function.

In numerical analysis, Newton's method (also known as the Newton–Raphson method) is a method for finding successively better approximations to the roots (or zeroes) of a real-valued function.

Formula:

enter image description here

In this formula xn + 1 is the next closest approximation after xn, f(xn) is the function at xn and f'(xn) is the derivative of the function at xn.

First approximation x0 has to be in interval (a,b) where exact solution x* is situated.

418 questions
1
vote
0 answers

If i can compute the gradient and Hessian, will Newtons method significantly outperform BFGS/L-BFGS?

I have 3-parameter estimation problem (so dimension is low and memory not a problem) where the objective function and gradients+hessians are slow to evaluate, as it is a result of a Monte Carlo simulation. However, my code is implemented so that I…
1
vote
1 answer

numpy inverse matrix not working for full rank matrix - hessian in logistic regression using newtons-method

I am trying to compute the inverse of a full-rank matrix using numpy, but when I test the dot product, I find that it does not result in the identity matrix - which means it did not invert properly. My code: H = calculateLogisticHessian(theta, X)…
1
vote
0 answers

Haskell newton method

i'm trying to implement newtons method in haskell, but i'm ending every time in a "Stackoverflow" Exception.. I spent a lot of time and got no solution .. -.- data Term = Monom(Integer, Integer) | Add(Term, Term) | Mul(Term,…
MaMa
  • 31
  • 4
1
vote
1 answer

How do I Iterate the below equation to determine the roots

Previous Question How to determine the best way to iterate through a loop for a sigma for the below equation using the code. import statistics as stats import warnings import matplotlib import matplotlib.pyplot as plt import numpy as np import…
Gwiji
  • 71
  • 8
1
vote
0 answers

Using Newton-Raphson method to solve the hydrostatic equation

I'm trying to use newton-raphson method for nonlinear systems of equations as discribed in 'Numerical recipies' book in chapter 9.6 to solve the hydrostatic equetion for a polytropic star. For each iteration, I change the radius vector as discribed…
Noam Chai
  • 167
  • 1
  • 10
1
vote
0 answers

Convert Recursive CTE to Recursive Subquery

How would I convert the following CTE into a recursive subquery? It's an implementation of Newtons Method. Reasons: 1) I have no permissions to create functions or stored procs in the DB 2) I must do everything in TSQL 3) Not using Oracle TESTDATA…
SQALEX101
  • 209
  • 1
  • 3
  • 16
1
vote
0 answers

A program to calculate an equation for Newton's method in calculus

I want to figure out a program for calculating Newton's method after the user inputs the equation they would like to figure out and the number of iterations they want to know. This program is in python. So far, I just have a program to calculate one…
Conor
  • 39
  • 1
  • 9
1
vote
1 answer

General Newton Method Function File Matlab

I have very limited knowledge on Matlab and I'm trying to make a general Newton Raphson function but every time it comes up with an error saying there are not enough input arguments. My code needs three inputs, f (the function), c0 (the initial…
Beth
  • 13
  • 2
1
vote
2 answers

Newton-Raphson's method user input and numerical output problems

I've been trying to create a script that allows the user to input an equation and returned the root of that equation. However I've ran into an issue and I've noticed that on running the program it takes the input and runs it through the loop but it…
Kivkovich
  • 41
  • 5
1
vote
1 answer

Iteration method

I am working on finding the initial points of convergence using newton's iteration method in mathematica. newton function works now I would like to show which initial points from a grid produce Newton iterations that converge to -1, same for points…
itms
  • 183
  • 2
  • 14
1
vote
1 answer

Newtons Method finding cube root, answer comes out as 0 every time

I am using a program with C++ that will calculate the cube root of a given float point number using Newton Methods. My program compiles, but the answer always comes out to zero. Here's the program: #include #include #include…
Blake B.
  • 13
  • 4
1
vote
2 answers

'float' object is not Iterable in Newton-Raphson iteration

I am getting a 'float' object is not Iterable error in a script for Newton-Raphson iteration. I am applying the iteration to the function f(x) = sin(x), and x0 = 3 for the iteration. I am getting the error on the stopping condition, which is max{…
donut juice
  • 257
  • 6
  • 19
1
vote
0 answers

Computational cost of scipy.newton_krylov

I am trying to compare the computational cost of several methods of solving a nonlinear partial differential equation. One of the methods uses scipy.optimize.newton_krylov. The other methods use scipy.sparese.linalg.lgmres. My first thought was to…
Ken
  • 1,778
  • 11
  • 10
1
vote
2 answers

Why won't the Newton-Raphson method converge when computing the square roots of 1.0E21 and 1.0E23?

I have the following functions for computing the square root of a number using the Newton-Raphson method. double get_dx(double y, double x) { return (x*x - y)/(2*x); } double my_sqrt(double y, double initial) { double tolerance = 1.0E-6; …
R Sahu
  • 204,454
  • 14
  • 159
  • 270
1
vote
1 answer

how to implement newton-raphson to calculate the k(i) coefficients of a implicit runge kutta?

I'm trying to implement a RK implicit 2-order to convection-diffusion equation (1D) with fdm_2nd and gauss butcher coefficients: 'u_t = -uu_x + nu .u_xx' . My goal is to compare the explit versus implcit scheme. The explicit rk which works well with…