final press 8ecm

This commit is contained in:
2021-06-25 11:07:12 +02:00
parent 1b00a76a17
commit 4311b6f65e
29 changed files with 2868 additions and 162 deletions

View File

@ -146,27 +146,12 @@ def plot_parameters(dat, input_file, deparameterize=False, ref=None):
for i in range(len(ids)):
cur_key = ids[i]
true_level = np.log(true_values[ids[i]]/current_val[i])/np.log(2)
rec_value = np.round(2**theta[-1, idx]*current_val[i],2)
#curve = theta[:,idx] + line_split*idx - true_level
#dash_curve = line_split*idx + t*0
curve = 2**theta[:, idx]*current_val[i]
std_down = 2**(-np.sqrt(P[:, idx, idx]))*curve
std_up = 2**np.sqrt(P[:, idx, idx])*curve
dash_curve = true_values[ids[i]] + t*0
if ids_type[i] == 'dirichlet':
fig3, axes3 = plt.subplots(1,1,figsize=(12,5))
axes3.plot(t, curve , '-', color=col_,label= legends_ + '= ' + str(rec_value) + '/' + str(true_values[cur_key]) + '$', linewidth = 4)
axes3.fill_between(t, std_down, std_up, alpha=0.3, color=col_)
legends_=next(legends)
axes3.plot(t, dash_curve , color=col_,ls='--')
axes3.plot(t, dash_curve , color=col_,ls='--' , linewidth = 3)
axes3.set_ylabel(r'$U$',fontsize=36)
axes3.legend(fontsize=36,loc='upper right')
axes3.set_xlim([-0.01,0.81])
@ -177,28 +162,34 @@ def plot_parameters(dat, input_file, deparameterize=False, ref=None):
plt.savefig('U.png')
plt.close(fig3)
else:
cur_key = ids[i]
rec_value = np.round(2**theta[-1, idx]*current_val[i],2)
curve = 2**theta[:, idx]*current_val[i]
std_down = 2**(-np.sqrt(P[:, idx, idx]))*curve
std_up = 2**np.sqrt(P[:, idx, idx])*curve
dash_curve = true_values[ids[i]] + t*0
axes1.plot(t, curve , '-', color=col_,label= legends_ + '= ' + str(rec_value) + '/' + str(true_values[cur_key]) + '$', linewidth = 3)
axes1.fill_between(t, std_down, std_up, alpha=0.3, color=col_)
axes1.plot(t, dash_curve , color=col_,ls='--')
axes1.plot(t, dash_curve , color=col_,ls='--',linewidth = 3)
legends_=next(legends)
if RC_flag:
if i<len(current_val_C):
rec_value_C = np.round(2**theta[-1, idx+1]*current_val_C[idc],6)
if RC_flag:
if i<len(current_val_C):
true_level_C = np.log(true_values_C[ids[i]]/current_val_C[i])/np.log(2)
rec_value_C = np.round(2**theta[-1, idc]*current_val_C[idc],6)
curve_C = 2**theta[:, idx+1]*current_val_C[idc]
dash_curve_C = true_values_C[ids[i]] + t*0
std_C_down = 2**(-np.sqrt(P[:, idx+1, idx+1]))*curve_C
std_C_up = 2**np.sqrt(P[:, idx+1, idx+1])*curve_C
axes2.plot(t, curve_C , '-', color=col_,label= legends_ + '= ' + str(rec_value_C) + '/' + str(true_values_C[cur_key]) + '$', linewidth = 2)
axes2.fill_between(t, std_C_down, std_C_up, alpha=0.3, color=col_)
axes2.plot(t, dash_curve_C , color=col_,ls='--')
legends_=next(legends)
idx +=1
idc +=1
curve_C = 2**theta[:, idx+1]*current_val_C[idc]
dash_curve_C = true_values_C[ids[i]] + t*0
std_C_down = 2**(-np.sqrt(P[:, idx+1, idx+1]))*curve_C
std_C_up = 2**np.sqrt(P[:, idx+1, idx+1])*curve_C
axes2.plot(t, curve_C , '-', color=col_,label= legends_ + '= ' + str(rec_value_C) + '/' + str(true_values_C[cur_key]) + '$', linewidth = 3)
axes2.fill_between(t, std_C_down, std_C_up, alpha=0.3, color=col_)
axes2.plot(t, dash_curve_C , color=col_,ls='--',linewidth = 3)
legends_=next(legends)
idx +=1
idc +=1
if meas_flag:
@ -221,10 +212,12 @@ def plot_parameters(dat, input_file, deparameterize=False, ref=None):
if RC_flag:
axes2.set_ylabel(r'$C$',fontsize=24)
axes2.legend(fontsize=18,loc='upper right')
axes2.set_ylabel(r'$C$',fontsize=36)
axes2.legend(fontsize=36,loc='upper right')
axes2.set_xlim([-0.01,0.81])
axes2.set_xlabel(r'$t (s)$',fontsize=24)
plt.xticks(fontsize=28)
plt.yticks(fontsize=28)
axes2.set_xlabel(r'$t (s)$',fontsize=36)
fig2.savefig('C.png')
fig1.savefig('Rd.png')

View File

@ -8,7 +8,7 @@ fluid:
implicit_windkessel: True
io:
write_path: 'results/HRz_Pb_V70'
write_path: 'results/impl_1ms'
restart:
path: '' # './projects/nse_coa3d/results/test_restart2/'
time: 0
@ -27,7 +27,8 @@ boundary_conditions:
value: ['0','0','-U*sin(DOLFIN_PI*t/Th)*(t<=Th) + (Th<t)*(U*DOLFIN_PI/Th*(t-Th)*exp(-(t-Th)*beta))']
parameters:
#U: 75 #REFERENCE
U: 150 #Pa Pb
U: 80
#U: 150 #Pa/Pb
#U: 40 #Pc
Th: 0.36
beta: 70
@ -55,9 +56,9 @@ boundary_conditions:
#C: 0.0010 # Pb
#C: 0.0001 # Pc
#C: 0.0008 # Pg
#R_d: 7200 # REFERENCE
R_d: 7200 # REFERENCE
#R_d: 8760 #Pa
R_d: 17520 #Pb x2
#R_d: 17520 #Pb x2
#R_d: 4000 #Pc
p0: 85
conv: 1333.223874
@ -71,9 +72,9 @@ boundary_conditions:
#C: 0.0010 # Pb
#C: 0.0001 # Pc
#C: 0.0008 # Pg
#R_d: 11520 # REFERENCE
R_d: 11520 # REFERENCE
#R_d: 8760 #Pa
R_d: 17520 #Pb x2
#R_d: 17520 #Pb x2
#R_d: 4000 #Pc
p0: 85
conv: 1333.223874
@ -86,9 +87,9 @@ boundary_conditions:
#C: 0.0005 #Pa
#C: 0.0010 #Pb
#C: 0.0001 #Pc
#R_d: 11520 # REFERENCE
R_d: 11520 # REFERENCE
#R_d: 8760 #Pa
R_d: 17520 #Pb x2
#R_d: 17520 #Pb x2
#R_d: 4000 #Pc
p0: 85
conv: 1333.223874
@ -131,7 +132,7 @@ fem:
convection_skew_symmetric: True # aka Temam term
stabilization:
forced_normal:
enabled: True
enabled: False
boundaries: [3,4,5,6]
gamma: 20
backflow_boundaries: [3,4,5,6]
@ -162,17 +163,17 @@ estimation:
-
id: 4
type: 'windkessel'
mode: 'Rd'
mode: 'RdC'
initial_stddev: 1
-
id: 5
type: 'windkessel'
mode: 'Rd'
mode: 'RdC'
initial_stddev: 1
-
id: 6
type: 'windkessel'
mode: 'Rd'
mode: 'RdC'
initial_stddev: 1
-
id: 2
@ -186,12 +187,12 @@ estimation:
mesh: '/home/yeye/NuMRI/kalman/meshes/coaortaH3_leo2.0.h5'
#mesh: './meshes/coaortaH1.h5'
fe_degree: 1
xdmf_file: 'measurements/aorta_zdir/Perturbation/Mg15V70/u_all.xdmf'
file_root: 'measurements/aorta_zdir/Perturbation/Mg15V70/u{i}.h5'
#xdmf_file: 'measurements/aorta/u_all.xdmf'
#file_root: 'measurements/aorta/u{i}.h5'
#xdmf_file: 'measurements/aorta_dt1ms/Perturbation/Mg15V70/u_all.xdmf'
#file_root: 'measurements/aorta_dt1ms/Perturbation/Mg15V70/u{i}.h5'
xdmf_file: 'measurements/aorta_exp_dt1ms/u_all.xdmf'
file_root: 'measurements/aorta_exp_dt1ms/u{i}.h5'
indices: 0 # indices of checkpoints to be processed. 0 == all
velocity_direction: ~
velocity_direction: [0,0,1]
noise_stddev: 45 # standard deviation of Gaussian noise
roukf:
@ -199,5 +200,5 @@ estimation:
observation_operator: 'postprocessing' #state or postprocessing
reparameterize: True
ODV_functional:
enable: True
VENC: 142
enable: False
VENC: 138