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.

359 questions
-1
votes
1 answer

Java finding Zero Points with Newton Algorithm endless loop

I'm havinga Problem with a method, which takes a Polynom like f(x)=x²+1 and calculates possible zero points with the newton algorithm. I have given requirements for specific variables so even if the naming is not good or a variable is not needed I…
KilledByCheese
  • 570
  • 5
  • 23
-1
votes
1 answer

Buoyancy vs water flow pressure

I'm trying to design a kind of water valve with inexpensive materials as a first prototype. The water flow from the PVC pipe (1) reach the body of the valve and pass through an aluminum grid (3) to the water tank. When the water level goes up pushes…
-1
votes
1 answer

Small python program involving newton method

I'm trying to write a small program in python that involves(among other things) Newton method, but i'm encountering several problems, that are probably pretty basic, but since I'm new at programming, i cant overcome.. First i defined the function…
-1
votes
1 answer

Newton's method with recursion in python

So I am running into an issue with my code for school. I don't know how to fix it. Here is my code. """ Convert Newton’s method for approximating square roots in Project 1 to a recursive function named newton. (Hint: The estimate of the square root…
Heather
  • 11
  • 1
  • 1
-1
votes
1 answer

How to apply Newton Raphson roots to determine roots for a function

Assuming that x is the hourly wind speed I am trying to fit using the Newton Raphson Method as shown below. K is a dimensionless parameter that I intend to solve by using the x values. def f(k) is the actual equation, def d_f(k) is the derivative…
Gwiji
  • 71
  • 8
-1
votes
1 answer

Solve equation system with partial diff using Newton Method

I have a question about the following equation system: Where mu ist the function of lambdas which I'm looking for. And E0 and C0 are known. May I solve the non-linear equation system using Newton Method in Matlab? If so, how could it work? Thanks…
-1
votes
3 answers

What does this C idiom mean?

Possible Duplicate: John Carmack’s Unusual Fast Inverse Square Root (Quake III) I came across this piece of code a blog recently - it is from the Quake3 Engine. It is meant to calculate the inverse square root fast using the Newton-Rhapson…
Omair
  • 754
  • 1
  • 9
  • 19
-1
votes
1 answer

Lisp (Scheme) Newton method

I am working on a academic problem and I am stuck. I have to implement a function (make-nstf f). The function should return a function which calculates zero of the function by using the newton method. To test my function I use https://repl.it/BWbp/1…
hyperion
  • 67
  • 3
-1
votes
1 answer

Invalid operands to binary expression ('double(*)(double' and 'double')

I was trying to figure out the Newton's method to find the root of equation. And this bug came out and I couldn't handle it. double fn(double n){ return sin(n)+log(n)-1; } double f1n(double n){ return cos(n)+1/n; } double operation(double…
Hao Xu
  • 7
  • 2
-1
votes
1 answer

Use Newton's method to find square root of a number?

Here is my code thus far. I don't know why it doesn't print anything. I hope it isn't because of some stupid mistake. y = float(raw_input("Enter a number you want square rooted: ")) x = 0 # Newton's Method: y = (x+y)/x + 2 while y > x: x +=…
-1
votes
1 answer

Unused arguments within a function in R

Below is the code I have. It works for primitive functions, such as sin. However, when using a function called gllik, it returns an error in f(y0): unused argument (y0). I'm not sure how to correct this. newton_search2 <- function(f, h, guess,…
user114634
  • 11
  • 3
-1
votes
1 answer

Find integer part of nth root

I have implemented a class for Big Integer in c# (project for school) , and I have to calculate nth root. I tried binary seach but it is taking too long for very big integers. I also tried to implement Newton method. The problem is that my Division…
-1
votes
1 answer

square root of a number with recursion

#include #include using namespace std; int e=0.001; double yk(int k,double x){ if(k==0) return 1; return 0.5*(yk(k-1,x) + x/yk(k-1,x)); } double square(double x,int k) { if(fabs(yk(k,x)*yk(k,x) - x)
-1
votes
2 answers

Input a value for a scanf(), but nothing happens

I'm writing some code as part of a few assignment exercises to learn C programming from absolute basics, and I've run into a problem, which is probably quite simple to solve, but I'm completely stuck! I'm writing a program to implement a basic…
alexheslop1
  • 115
  • 3
  • 9
-1
votes
1 answer

Programming Newton's method with backstepping in Python from Matlab Code

I am trying to code a Newton's Method with back stepping code that I wrote in Matlab to Python, but am having some trouble with the Python syntax. Matlab takes about 5 iterations, but my Python code is looping up to the max iteration of 1000 and…
1 2 3
23
24