-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdev_import.py
More file actions
99 lines (67 loc) · 1.83 KB
/
dev_import.py
File metadata and controls
99 lines (67 loc) · 1.83 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
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
from dyno.symbolic_model import DynoModel
from dyno.modfile import DynareModel
from rich import inspect, print
model1 = DynoModel("examples/RBC.dyno")
model2 = DynoModel("examples/modfiles/RBC.mod")
model3 = DynareModel("examples/modfiles/RBC.mod")
models = [model1, model2, model3]
print("Filenames of imported models:")
print([model.filename for model in models])
print("Names of imported models:")
print([model.name for model in models])
print("Symbols of imported models:")
for m in models:
print(m.filename)
print(m.symbols)
print("Context of imported models:")
for m in models:
print(m.filename)
print(m.context)
print("Equations of imported models:")
for m in models:
print(m.equations)
print("Equations of imported models:")
for m in models:
print(m.equations)
for m in models:
print(m.filename)
print(m.steady_state)
for m in models:
print(m.__steady_state_vectors__)
for m in models:
print(m.filename)
print(m.residuals)
for m in models:
print(m.filename)
print(m.jacobians)
for m in models:
dr = print(m._repr_html_())
for m in models:
dr = m.solve()
print(dr)
import time
t1 = time.time()
for i in range(100):
model = DynoModel("examples/modfiles/RBC.mod")
dr = model.solve()
t2 = time.time()
print("Elsapsed time (dyno/mod)", t2 - t1)
# Importing modfile with preprocessor
from dyno.modfile import DynareModel
import time
t1 = time.time()
for i in range(100):
model = DynareModel("examples/modfiles/RBC.mod")
model.solve()
t2 = time.time()
print("Elsapsed time (preprocessos)", t2 - t1)
# Importing modfile with preprocessor
from dyno.modfile import DynareModel
import time
t1 = time.time()
for i in range(100):
model = DynoModel("examples/RBC.dyno")
model.solve()
t2 = time.time()
print("Elsapsed time (dyno/dyno):", t2 - t1)
# exit()