This shows you the differences between two versions of the page.
ps:labs_python:02 [2023/10/11 13:01] ionut.gorgos |
ps:labs_python:02 [2024/10/09 15:04] (current) darius.necula [Semnale și sisteme de bază] |
||
---|---|---|---|
Line 20: | Line 20: | ||
<note tip> | <note tip> | ||
Pentru $\pi$ puteți folosi comanda //np.pi// din biblioteca //numpy//. | Pentru $\pi$ puteți folosi comanda //np.pi// din biblioteca //numpy//. | ||
+ | Pentru concatenare puteți folosi [[https://numpy.org/doc/stable/reference/generated/numpy.concatenate.html|np.concatenate]] sau [[https://numpy.org/doc/stable/reference/generated/numpy.hstack.html|np.hstack]] | ||
Puteți afișa un semnal folosind comanda //plt.plot// din interfața //matplotlib.pyplot//. | Puteți afișa un semnal folosind comanda //plt.plot// din interfața //matplotlib.pyplot//. | ||
Line 134: | Line 135: | ||
<note important>Pentru numărul imaginar //j//, în Python se folosește notația //1j//.</note> | <note important>Pentru numărul imaginar //j//, în Python se folosește notația //1j//.</note> | ||
+ | <note tip>Folosiți codul următor pentru a desena un cerc trigonometric, peste care veți reprezenta valorile calculate mai sus | ||
+ | <code python> | ||
+ | import numpy as np | ||
+ | import matplotlib.pyplot as plt | ||
+ | |||
+ | tt = np.arange(0, 2 * np.pi, 0.1) | ||
+ | figure1 = plt.figure('Figura 1', figsize=(10, 10)) | ||
+ | complex_tt = np.exp(1j * tt) | ||
+ | x = np.real(complex_tt) | ||
+ | y = np.imag(complex_tt) | ||
+ | plt.plot(x, y, 'k.') | ||
+ | plt.plot(0, 0, 'kx') | ||
+ | </code> | ||
+ | </note> | ||
<hidden> | <hidden> | ||
=== Exerciţiul 4 [1.5p] === | === Exerciţiul 4 [1.5p] === | ||
Line 152: | Line 167: | ||
Avem un sistem de feedback precum cel din imaginea următoare: | Avem un sistem de feedback precum cel din imaginea următoare: | ||
- | {{:ps:labs:feedback.png?400|}} | + | {{:ps:labs:feedback.png?400|}} |
Să presupunem că folosim acest sistem pentru sistemul de pilot automat al maşinii, unde x(t) este o constantă ce reprezintă viteza dorită, iar y(t) este viteza maşinii măsurată de vitezometru. În această aplicaţie, sistemul 2 este sistemul identitate (intrare = ieşire). | Să presupunem că folosim acest sistem pentru sistemul de pilot automat al maşinii, unde x(t) este o constantă ce reprezintă viteza dorită, iar y(t) este viteza maşinii măsurată de vitezometru. În această aplicaţie, sistemul 2 este sistemul identitate (intrare = ieşire). |