-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestSystem.m
More file actions
32 lines (24 loc) · 889 Bytes
/
testSystem.m
File metadata and controls
32 lines (24 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
System
x0=input("donner le vecteur colonne initial : "); #[-1;-1;-1];
tol=input("donner une tolerance de precision : "); # 1e-7;
Nmax=input("donner le nombre maximal d'iterations : "); #40;
[xp,niter]=ptFixe(@G,x0,tol,Nmax);
if niter<Nmax
disp("la solution par point fixe est xp = "); disp(xp);
printf("apres %d iterations \n",niter);
printf("la norme ||F(xp)|| = %.7e\n",norm(F(xp)));
else printf("convergence non atteinte par pt fixe \
apres %d iterations \n",Nmax)
end
input("Entree pour continuer ... ");
printf("\nResolution par Newton\n=====================\n")
[xn,niter]=NewtonSys(@F,@JF,x0,tol,Nmax);
if niter<Nmax
disp("la solution par Newton = "); disp(xn);
printf("apres %d iterations \n",niter);
else printf("convergence non atteinte apres %d iterations \n",Nmax)
end
%
%
printf("\nResolution directe par Octave\n=====================\n")
fsolve(@F,x0)