-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2-exemploNumpyIncidenciaLeisKirchhoffTellegen.py
More file actions
35 lines (25 loc) · 1.15 KB
/
Copy path2-exemploNumpyIncidenciaLeisKirchhoffTellegen.py
File metadata and controls
35 lines (25 loc) · 1.15 KB
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
33
34
35
import numpy as np
v = np.array([95,105,70,-10,35])
e = np.array([95,105,70])
i = np.array([5,-40,35,-5,35])
A = np.array([[1,0,0, 1, 0],\
[0,1,0,-1, 1],
[0,0,1, 0,-1]])
print('KCL: A.dot(i)=',A.dot(i))
print('KVL: ATransp.dot(e)=',A.transpose().dot(e))
print('Tellegen: iTransp.dot(v)=',i.transpose().dot(v))
vhat = np.array([20,30,10,-10,20])
ihat = np.array([10,-20,10,-10,10])
print('Tellegen cruzado: iTransp.dot(vhat)=',i.transpose().dot(vhat))
print('Tellegen cruzado: iHatTransp.dot(v)=',ihat.transpose().dot(v))
print()
print('-------------------------------------')
print('Aplicando Tellegen cruzado para um circuito linear e para um circuito nao linear.')
vLinear = np.array([-10,-80,-90,-80])
iLinear = np.array([-10,-40,10,30])
vNaoLinear = np.array([-1/8,2,15/8,2])
iNaoLinear = np.array([-8,2/5,8,-42/5])
print('Tellegen cruzado com um circuito linear e outro nao linear: iLinearTransp.dot(vNaoLinear)=',\
iLinear.transpose().dot(vNaoLinear))
print('Tellegen cruzado com um circuito linear e outro nao linear: iNaoLinearTransp.dot(vLinear)=',\
iNaoLinear.transpose().dot(vLinear))