Items tagged with newton newton Tagged Items Feed

Hello, I'd like to use Maple to use Newton's Method in an interval to find multiple roots of 4xcos(3x)+(x-2)^2-2=0. What I have so far is:

with(Student[NumericalAnalysis]):
f := 4*x*cos(3*x)+(x-2)^2-2:
Newton(f,x=2,tolerance=10^(-4));

 

Other than trying out different initial guesses is there a way to do this?

I can get the function to iterate as a recursive function by just reevaluating the x := evalf(x-(f1*j-i*g1)/(h*k-i*j), 25); y := evalf(y-(h*g1-f1*j)/(h*k-i*j), 25) portion of the function below but im trying beneath it to assign it as newt2d so that i can iterate it as newtons method in two variables like (newt2d@@10) and I can't seem to figure out what im doing wrong. Thanks for any help you can provide!

f := proc (x, y) options operator, arrow; x+y-cos(x)+sin(y-1) end proc; f1 := f(x, y)

(x, y) -> x + y - cos(x) + sin(y - 1)
x + y - cos(x) + sin(y - 1)

> g := proc (x, y) options operator, arrow; x^4+y^4-2*x*y end proc; g1 := g(x, y);

(x, y) -> x + y - 2 x y
x + y - 2 x y

> dh := D[1](f); h := dh(x, y);

(x, y) -> 1 + sin(x)
1 + sin(x)

> di := D[2](f); i := di(x, y);

(x, y) -> 1 + cos(y - 1)
1 + cos(y - 1)

> dj := D[1](g); j := dj(x, y);

(x, y) -> 4 x - 2 y
4 x - 2 y

> dk := D[2](g); k := dk(x, y);

(x, y) -> 4 y - 2 x
4 y - 2 x

x := .3; y := .8

0.3
0.8

> x := evalf(x-(f1*j-i*g1)/(h*k-i*j), 25); y := evalf(y-(h*g1-f1*j)/(h*k-i*j), 25);

0.2924403963319692595180140
0.8321243516906678979858730

> newt2d(.3, .8);

0.2577789764, 0.8333916830

> (newt2d@@5)(.3, .8);

Error, (in @@) invalid arguments



Hello,

 

Can anyone help me with this error in Maple while using prcNewton to find local extrema: 

 

 
> prcNewton := proc () 
local ftn, strpt, epsilon, maxlps, i, xn, dftn; 
if 4 < nargs then 
elif nargs < 2 then end if; 
if nargs = 2 then 
epsilon := 1/10000000; 
maxlps := 1000 
elif nargs = 3 then 

Use Newton's Method to find a local extrema for f(x)=sin(x^2)+x

with start point x=(1,0)

take derivative of f(x) then apply Newton's Method

 

My teacher started us off with this but I can't seem to get it to work the way she did, any help would be appreciated!

 

prcNewton:=proc( ) 

  local ftn,strpt,epsilon,maxlps,i,xn,dftn; 

  if nargs>4 then     

Dividing by zero...

September 03 2012 twotone 0

This thread stimulated me into playing with a few ideas,

I pieced together this little newton-raphson procedure...

> newton := proc( f, # the function x0 # the initial guess n, # step count limit tol # error tolerance)

local x, g, k;

g := D(f); # the derivative f’(x)

x[0] := evalf(x0); # initialize the iteration

for k from 1 to n do # loop for newton’s iteration

# Newton’s iteration formula

1 Introduction

Three tanks are connected with two pipes. Each tank is initially filled to a different level. A valve in each pipe opens, and the liquid levels gradually reach equilibrium. Here, we model the system in MapleSim (including the influence of flow inertia), and also derive and solve the analytical equations in Maple.

NewtonBlackArea.mw

I have been working with Newton-Raphson fractals for some time.  Like others it was necessary to deal with the "black areas" many times, so I performed some additional analysis and present some of these results here.  This will allow others to stop coloring these areas black and allow visualization of the structure inside these areas.  It will also help demonstrate...

Use Newton’s Method to approximate the indicated root of the equation to correct six decimal places.

 

The root of 2.2x5 – 4.4x3 + 1.3x2-0.9x-4.0=0 in the interval [-2, -1].

 

The rest of the assignment states : "

Start by plotting the function in
Maple to get a reasonably good initial approximation. You may use a
“while” loop, but do not use existing Maple commands for Newton’s
Page 1 of 1