Documente Academic
Documente Profesional
Documente Cultură
08 Mai 2016
QCM (7 pts)
Solution:
>> a=8;
>> P=[1 5 3 4a ] ;
3 >> r=roots (P) ;
4 >> f i x ( r )
5 ans =
6
5
7
1
8
0
9 >> disp ( ' Proposition
10 Proposition Juste
1
2
Juste '
(b) (1 point) Si a 0 alors x 4 est considre comme approximation de la solution de la drive ;(Utilisez la commande oor).
Solution:
>> a=0;
>> P=[1 5 3 4a ] ;
3 >> r=roots ( polyder (P) ) ;
4 >> f l o o r ( r )
5 ans =
6
1
7
3
8 >> disp ( ' Proposition Fausse ' )
9 Proposition Fausse
1
2
M.LICHOURI
2 Anne Math
2 Anne Math
3. (2 points) Cette commande Matlab polyvalppolyderppolyderpP qq, f loorprootsppolyderpP qqqq nous calcul
(Choisissez un ou Plusieurs) (Justiez votre rponse) :
P'(-1)
P(3)
` P"([-1 3])
rrandp3, 5q; A
` 2 lignes et 2 colonnes
3 lignes et 2 colonnes
Impossible de calculer B quelque soit A.
Solution:
rand (2 ,
3);
magic ( 5 ) ] ;
2.1
1
2
Exercice 1 (5 pts)
clc ;
clear ;
M.LICHOURI
Page 2
2 Anne Math
23
24
25
26
27
2.2
Exercice 2 (5 pts)
Soit la fonction f pxq x2 sinpxq 6 23 crire un script ( programme) Matlab permettant de trouver
la racine approche de cette quation par la mthode de REGULA FALSI si elle existe dans l'intervaller2, 4s,
en utilisant l'algorithme suivant :
Algorithme REGULA FALSI;
1
a=2,b=4;
2
eps=0.00001;ecart=1;iter=0;
3
SI f(a)>0 alors
4
t=a; a=b; b=t;
5
TANT QUE iter<=50 et ecart>eps faire
6
x=(a*f(b)-b*f(a))/(f(b)-f(a));
7
SI f(x)> 0 alors
8
ecart=|x-a|; a=x;
9
Sinon
10
ecart=|x-b|;b=x;
11
Fsi;
12
iter=iter+1;
13 Fait;
14 Ecrire("la racine approchee est",x,"le nombre d'iteration est=",iter);
11
end
12
13
14
15
16
17
M.LICHOURI
Page 3
2 Anne Math
18
19
20
21
22
23
est %.8f ,
le nombre d" iteration est = %d\n '
2.3
1
2
,x , i t e r ) ;
Exercice 3 (3 pts)
clear a l l
clc
%
p1=[1 5 0 1 ] ;
5 p2=[3 10 1 5 ] ;
6 % determinant et inverse
7 A=[p1 ;1 p2 ; ones ( 2 , 4 ) ] ;
8 det (A)
9 inv (A)
10 % multiplication de deux polynome
11 w = conv (p2 , p1)
12 %somme de deux polynome
13 z=w+[0 0 0 1 5 0 1]
14 % division de deux polynome
15 [ q , r ] = deconv (z , p2)
16 % trouver l e s racines de q
17 x=roots (q)
18 % appliquer la fonction poly
19 q1=poly (x)
20 %
21 q1==q
22
23 %%Execution
24 %ans =
25 %
13.5910
26 %ans =
27 %
1.2123 0.0991
1.8936
28 %
0.0717
0.0035 0.3260
29 %
0.7133
0.0138 0.3039
30 %
0.5707
0.0818 0.2637
31 %w =
32 %
3
5 35 78 10
33 %z =
34 %
3
5 34 83 10
35 %q =
36 %
1.0000
5.0000
0.3333
37 %r =
38 %
0
0
0
39 %x =
40 %
5.0807
41 %
0.0404 + 0.8613 i
42 %
0.0404 0.8613 i
43 %q1 =
44 %
1.0000
5.0000
0.3333
45 %ans =
46 %
1
0
0
0
3
4
M.LICHOURI
8.2408
1.0301
4.1204
3.0903
15
16
3.7778
0 22.7778 40.6667
3.7778
Page 4
2 Anne Math
2.4
Exercice 4 (3 pts)
M.LICHOURI
Page 5
2 Anne Math
%
%
58 %A4 =
59 %
60 %
61 %
62 %
63 %
64 %A5 =
65 %
66 %
67 %
68 %
69 %
70 %A5 =
71 %
72 %
73 %
74 %
75 %
76 %A6 =
77 %
78 %
79 %
80 %
81 %
82 %
83 %
84 %A6 =
85 %
86 %
87 %
88 %
89 %
90 %
91 %
92 %>>
56
57
1
1
2
3
5
3
5
1
1
1
1
1
0
0
0
0
0
1
1
1
1
1
4
5
10
15
0
35
35
0
1
2
3
4
5
0
2
3
0
5
1
2
3
4
5
1
3
6
10
15
0
3
0
0
0
1
3
6
10
15
1
4
10
20
35
0
0
0
0
0
1
4
10
20
35
1
5
15
35
70
0
5
0
0
0
1
5
15
35
70
1
1
1
1
1
1
2
1
4
1
1
1
6
10
1
1
4
10
20
1
1
1
1
1
70
M.LICHOURI
Page 6