36
36
# run_fortran(in_str)
37
37
# get the arrays stored in specific text file
38
38
#TODO: MAKE IT MORE GENERIC, SAVE IT TO A SPECIFIC FOLDER AND LOOP THROUGH ALL TXT FILE IN FOLDER
39
- arr_li = ['VFUNC' , 'PFUNC' , 'STATDIST' , 'AGRID' , 'LORENZ' ,'LAMBDA' ]
39
+ arr_li = ['VFUNC' , 'PFUNC' , 'STATDIST' , 'AGRID' , 'LORENZ' ,'LAMBDA' , 'VFUND' , 'PFUND' , 'Q' , 'CONSUM_EQ' ]
40
40
f_dict = dict ()
41
+ ps_spec_suffix = ""
41
42
for c in arr_li :
43
+ c = c + ps_spec_suffix
42
44
f = os .path .join (f_path , c )
43
45
try :
44
46
vf = np .transpose (np .genfromtxt (f ))
45
47
except OSError :
46
48
vf = None
47
49
f_dict [c ] = vf
48
50
51
+ #PS4B - GRAPHS
52
+ # required_graph = ['VFUNC', 'PFUNC', 'VFUND', 'PFUND']
53
+ # fig, axs = plt.subplots(2, 2)
54
+ # order = [axs[0,0],axs[0,1],axs[1,0],axs[1,1]]
55
+ # print(axs)
56
+ # def_x = f_dict['AGRID']
57
+ # colors = ['r', 'b', 'g', 'pink', 'c']
58
+ # for i, item in enumerate(required_graph):
59
+ # g = f_dict[item]
60
+ # current_ax = order[i]
61
+ # print(current_ax)
62
+ # current_ax.set_title(item)
63
+ # for di, dim in enumerate(g):
64
+ # current_ax.plot(def_x, f_dict[item][di], colors[di])
65
+ # plt.show()
66
+ plt .plot ( f_dict ['AGRID' ],f_dict ['CONSUM_EQ' ][2 ], 'r' )
67
+ plt .plot ( f_dict ['AGRID' ],f_dict ['CONSUM_EQ' ][3 ], 'b' )
68
+ plt .show ()
69
+
49
70
# ps2 - PLOT GRAPHS
50
71
# df1 = [f_dict['AGRID'][int(i-1)] for i in f_dict['PFUNC'][0]]
51
72
# df2 = [f_dict['AGRID'][int(i-1)] for i in f_dict['PFUNC'][1]]
59
80
# ozspace = np.linspace(0,1,100)
60
81
# plt.plot(ozspace, f_dict['LORENZ'], 'r')
61
82
# plt.plot(ozspace, ozspace, 'b')
62
- plt .plot ( f_dict ['AGRID' ],f_dict ['LAMBDA ' ][0 ], 'r' )
63
- plt .plot ( f_dict ['AGRID' ],f_dict ['LAMBDA ' ][1 ], 'b' )
64
- plt .show ()
83
+ # plt.plot( f_dict['AGRID'],f_dict['PFUNC '][0], 'r')
84
+ # plt.plot( f_dict['AGRID'],f_dict['PFUNC '][1], 'b')
85
+ # plt.show()
0 commit comments