• Non ci sono risultati.

EXERCISE 1

N/A
N/A
Protected

Academic year: 2021

Condividi "EXERCISE 1"

Copied!
1
0
0

Testo completo

(1)

EXERCISE 1

Write two Matlab functions:

- [x,its] = bisection(f,a,b,tol,maxits), that implements the bisection method.

- [x,its] = newton(f,derf,x0,tol,maxits), that implements the bisection method.

In both cases, stop when either its > maxits or when |f (x )| < tol.

Use both functions to solve the equation ex− cos(x) − 2 = 0 (choose appropriately the initial guess or the initial interval).

Use both methods to solve the equation √3

x − π = 0 (use the function nthroot to compute cubic roots). Do both methods converge? Why?

1 / 1

Riferimenti

Documenti correlati

[r]

(i) she/he has passed the exam for the course on which the grant is available, and (ii) she/he does not exceed 150 teaching hours overall (including also the new grant). Suppose

[r]

Modify the parameters for the error control of the ordinary differential system by adopting a relative tolerance of 10  8 and an absolute one of 10  12 (respect to

Simulate the whole process, report the conditions of the PFR outlet, and plot the molar flow of the components versus the length of the reactor. How can the recovery of styrene

Initially, the distillation column is working in stationary conditions and in absence of external

Implement a shutdown strategy for the C4-C5 separation column. The sequence of events

Using the Matlab command whos, compare the memory usage when A is stored as dense and as sparse, for a large enough matrix size. the same number of