Normand Marion B2
TP N°2 Outils Logiciels
Calcul symbolique : Applications aux Polynômes
1. Introduction
2. Première partie : apprentissage
3. Deuxième partie
31. Polynômes
311. Écrire un script permettant de calculer les polynômes Q(x) et P(x)
>> A = [5 0 0 0 0 0 0 -3]
A=
5 0 0 0 0 0 0 -3
>> B = [-1 0 5 -1 0]
B=
-1 0 5 -1 0
>> C = [9 -3 5 -1 7]
C=
9 -3 5 -1 7
>> D = [1 1 1]
D=
1 1 1
Calcul de Q(x) = A(x) * B(x) :
>> Q = conv(A,B)
Q=
-5 0 25 -5 0 0 0 3 0 -15 3 0
11 9 8 4 2
=> Q(x) = -5𝑥 + 25𝑥 -5𝑥 + 3𝑥 - 15𝑥 + 3𝑥
1
Normand Marion B2
Calcul de P(x) = C(x) * D(x) :
>> P = conv(C,D)
P=
9 6 11 1 11 6 7
6 5 4 3 2
=> P(x) = 9𝑥 + 6𝑥 + 11𝑥 + 𝑥 + 11𝑥 + 6x + 7
32. Limite
- Pour F1(x) :
syms x;
F1 = (x^4 + x^2 + 1)/(x^2 + 3*x + 1);
limit(F1,x,0,'left')
limit(F1,x,0,'right')
limit(F1,x,inf)
>> limit
ans =
ans =
ans =
Inf
- Pour F2(x) :
2
Normand Marion B2
syms x;
F1 = 3/(x^3 + 1);
limit(F1,x,0,'left')
limit(F1,x,0,'right')
limit(F1,x,inf)
>> limit
ans =
ans =
ans =
- Pour F3(x) :
syms x;
F1 = 1/(x^8 + x^6);
limit(F1,x,0,'left')
limit(F1,x,0,'right')
limit(F1,x,inf)
>> limit
ans =
Inf
ans =
Inf
ans =
3
Normand Marion B2
33. Dérivation
a) f(x) = ln² (x)
syms x
f = (log(x))^2
diff(f)
>> deriv
f=
log(x)^2
ans =
(2*log(x))/x
𝑙𝑛(𝑥)
=> f(x) = 2
𝑥
b) f(x) = ln(x²)
syms x
f = log(x^2)
diff(f)
>> deriv
f=
log(x^2)
ans =
2/x
2
=> f’(x) =
𝑥
c) f(x) = Arc(sinx)
4
Normand Marion B2
syms x
f = asin(x)
diff(f)
>> deriv
f=
asin(x)
ans =
1/(1 - x^2)^(1/2)
1
=> f’(x) =
1−𝑥²
d) f(x) = Arc(cosx)
syms x
f = acos(x)
diff(f)
>> deriv
f=
acos(x)
ans =
-1/(1 - x^2)^(1/2)
−1
=> f’(x) =
1−𝑥²
34. Intégration
341. Calculer les valeurs numériques des intégrales suivantes
5
Normand Marion B2
1
1 1 1
- I1 = ∫ + + 𝑑𝑥
(𝑥 + 1)² (𝑥 + 1) (𝑥 − 5)
0
syms x
f = 1/((x+1)^2)+1/(x+1)+1/(x-5);
int(f,0,1)
>> int
ans =
log(8/5) + 1/2
3π
4
𝑥
- I1 = ∫ 𝑐𝑜𝑠²(𝑥)
𝑑𝑥
π
>> int
ans =
- (3*pi)/4 - log(2)/2
syms x
f = x/(cos(x))^2;
int(f,pi,(3*pi)/4)
342. Application de l’intégration : Valeur moyenne, valeur efficace
de signaux
- syms t Im w T;
w = (2*pi)/T;
T = (2*pi)/w;
i(t) = Im*cos(w*t);
Imoy = 1/T*int(i(t),0,T)
6
Normand Marion B2
>> integ
Imoy =
- syms t Im w T;
w = (2*pi)/T;
T = (2*pi)/w;
i2(t) = (Im*cos(w*t))^2;
I2eff = 1/T*int(i2(t),0,T)
>> integ
I2eff =
Im^2/2
2
𝐼𝑚
=> 𝐼2 =
𝑒𝑓𝑓 2
343. Application aux signaux périodiques
Question numérique :
a)
4𝐸 𝑠𝑖𝑛(3𝑤𝑡) 𝑠𝑖𝑛(5𝑤𝑡)
x(t) =
π
[𝑠𝑖𝑛(𝑤𝑡) + 3
+ 5
+...]
w = 2*π*F
F = 10Hz
on a alors :
4*𝐸 𝑠𝑖𝑛(2π30𝑡) 𝑠𝑖𝑛(2π50𝑡)
x(t) =
π
[𝑠𝑖𝑛(2π10𝑡) + 3
+ 5
+...]
fréquence de𝑥 (t) = 30Hz
2
fréquence de 𝑥 (t) = 50Hz
3
b)
7
Normand Marion B2
8𝐸 𝑠𝑖𝑛(3𝑤𝑡) 𝑠𝑖𝑛(5𝑤𝑡)
x(t) =
π²
[𝑠𝑖𝑛(𝑤𝑡) − 3²
+ 5²
−...]
F=10Hz
on a alors :
8𝐸 𝑠𝑖𝑛(2π30𝑡) 𝑠𝑖𝑛(2π50𝑡)
x(t) =
π²
[𝑠𝑖𝑛(2π10𝑡) − 3²
+ 5²
−...]
fréquence de𝑥 (t) = 30Hz
2
fréquence de 𝑥 (t) = 50Hz
3
c)
2𝐸 2𝑐𝑜𝑠(2𝑤𝑡) 2𝑐𝑜𝑠(4𝑤𝑡)
x(t) =
π
[1 + 3
− 15
+...]
F=10Hz
on a alors :
2𝐸 2𝑐𝑜𝑠(2π20𝑡) 2𝑐𝑜𝑠(2π40𝑡)
x(t) =
π
[1 + 3
− 15
+...]
fréquence de𝑥 (t) = 20Hz
2
fréquence de 𝑥 (t) = 40Hz
3
d)
2𝐸 𝑠𝑖𝑛(2𝑤𝑡) 𝑠𝑖𝑛(3𝑤𝑡)
x(t) =
π
[𝑠𝑖𝑛(𝑤𝑡) − 2
+ 3
+...]
F=10Hz
on a alors :
2𝐸 𝑠𝑖𝑛(2π20𝑡) 𝑠𝑖𝑛(2π30𝑡)
x(t) =
π
[𝑠𝑖𝑛(2π10𝑡) − 2
+ 3
+...]
fréquence de𝑥 (t) = 20Hz
2
8
Normand Marion B2
fréquence de 𝑥 (t) = 30Hz
3
Programmation :
clear; clc
E=1;
F=10;
t= 0 : 0.0001 : 1
x1= ((4*E)/pi)*(sin(2*pi*10*t));
x2= ((4*E)/pi)*((sin(2*pi*30*t))/3);
x3= ((4*E)/pi)*((sin(2*pi*50*t))/5);
figure(1)
subplot(4,1,1);plot(t,x1,'r');title('x1')
subplot(4,1,2);plot(t,x2,'g');title('x2')
subplot(4,1,3);plot(t,x3,'y');title('x3')
x=x1+x2+x3;
figure(1)
subplot(4,1,4);plot(t,x,'b');title('x')
9
Normand Marion B2
On remarque que plus la fréquence est grande, plus la période est petite.
10