-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.py
More file actions
68 lines (53 loc) · 930 Bytes
/
Main.py
File metadata and controls
68 lines (53 loc) · 930 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import sympy as sym
# from sympy.abc import a, b, c, d
from sympy import Matrix, symbols
a, b, c, d = symbols('a b c d')
C, I, G, Yt = symbols('C I G Yt')
Yt_1, Yt_2, Gt_1 = symbols('Yt_1 Yt_2 Gt_1')
e, u, v = symbols('e u v')
# A = Matrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [-1, -1, -1, 1]])
# B = Matrix([[-a, 0, 0, -b], [-c, c, 0, 0], [0, 0, -d, 0], [0, 0, 0, 0]])
# A_t = Transpose(A)
# Yt_1, Yt_2, Gt_1 = symbols('Yt_1 Yt_2 Gt_1')
A = Matrix([
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[-1, -1, -1, 1]
])
B = Matrix([
[-b, -a, 0, 0],
[0, -c, c, 0],
[0, 0, 0, -d],
[0, 0, 0, 0]
])
Y = Matrix([
[C],
[I],
[G],
[Yt]
])
X = Matrix([
[1],
[Yt_1],
[Yt_2],
[Gt_1]
])
U = Matrix([
[e],
[u],
[v],
[0]
])
# print(Y)
M = -A.inv() * B
print(M)
A_U = A.inv() * U
_Y = M * X + A_U
print(_Y)
#
# print(X)
#
# print(A.inv())
#
# print(U)