From 842a3fbcc6e8e4149595696e58bbfb0a0c50a5af Mon Sep 17 00:00:00 2001 From: yeye Date: Wed, 24 Mar 2021 17:00:14 +0100 Subject: [PATCH] asd --- kalman/graphics/figure2.py | 21 ++++++++++++++------- kalman/input_files/aorta_C.yaml | 30 +++++++++++++++--------------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/kalman/graphics/figure2.py b/kalman/graphics/figure2.py index 4ac9617..897c0cd 100644 --- a/kalman/graphics/figure2.py +++ b/kalman/graphics/figure2.py @@ -52,30 +52,37 @@ def plot_parameters(dat, input_file, deparameterize=False, ref=None): inputfile = yaml.full_load(file) #true_val = [10,250,250,250,30] - true_val = [10,60,220,160,100] + true_values = { + 3: 10, + 4: 60, + 5: 220, + 6: 160, + 2: 100 + } current_val = [] labels = [] - + ids = [] + for bnd_c in inputfile['estimation']['boundary_conditions']: if 'windkessel' in bnd_c['type']: for bnd_set in inputfile['boundary_conditions']: if bnd_c['id'] == bnd_set['id']: + ids.append(bnd_c['id']) current_val.append(bnd_set['value'][0]) labels.append('R_' + str(bnd_c['id'])) elif 'dirichlet' in bnd_c['type']: current_val.append(inputfile['boundary_conditions'][1]['parameters']['U']) + ids.append(bnd_c['id']) labels.append('U') dim = dat['theta'].shape[-1] fig1, axes = plt.subplots(1,1,figsize=(8,6)) - - axes.set_ylabel(r'$\theta$',fontsize=18) t = dat['times'] @@ -104,7 +111,7 @@ def plot_parameters(dat, input_file, deparameterize=False, ref=None): color=col_) - true_level = np.log(true_val[i]/current_val[i])/np.log(2) + true_level = np.log(true_values[ids[i]]/current_val[i])/np.log(2) axes.plot(t,1.5*i + t*0 + true_level , color=col_,ls='--') col_ = next(col) legends_=next(legends) @@ -115,8 +122,8 @@ def plot_parameters(dat, input_file, deparameterize=False, ref=None): # print('theta_peak: \t {}'.format(theta[round(len(theta)/2), :])) print('Final value theta: \t {}'.format(theta[-1, :])) print('Deparameterized: 2^theta_end: \t {}'.format(2**theta[-1, :])) - print('Real values: \t {}'.format(true_val)) - print('Recon values: \t {}'.format(np.round(2**theta[-1, :]*current_val,2))) + print('Real values: \t {}'.format(true_values)) + print('Recon values: \t {a}:{b} '.format(a=ids[:],b=np.round(2**theta[-1, :]*current_val,2))) diff --git a/kalman/input_files/aorta_C.yaml b/kalman/input_files/aorta_C.yaml index ad9fabb..39dcdbb 100755 --- a/kalman/input_files/aorta_C.yaml +++ b/kalman/input_files/aorta_C.yaml @@ -40,31 +40,31 @@ boundary_conditions: - id: 3 type: 'windkessel' - #value: [10,0,0] - value: [10,0.0008,2400] - p0: [80,1333.223874] - #p0: [0,1333.223874] + value: [10,0,0] + #value: [10,0.0008,2400] # [R_p,C,R_d] SEPARAR + #p0: [80,1333.223874] + p0: [0,1333.223874] - id: 4 type: 'windkessel' value: [60,0,0] #value: [60,0.00034,4200] - p0: [80,1333.223874] - #p0: [0,1333.223874] + #p0: [80,1333.223874] + p0: [0,1333.223874] - id: 5 type: 'windkessel' value: [220,0,0] #value: [220,0.00034,11000] - p0: [80,1333.223874] - #p0: [0,1333.223874] + #p0: [80,1333.223874] + p0: [0,1333.223874] - id: 6 type: 'windkessel' value: [160,0,0] #value: [160,0.00034,7800] - p0: [80,1333.223874] - #p0: [0,1333.223874] + #p0: [80,1333.223874] + p0: [0,1333.223874] timemarching: velocity_pressure_coupling: 'fractionalstep' # monolithic, fractionalstep @@ -128,14 +128,14 @@ linear_solver: estimation: boundary_conditions: - - - id: 3 - type: 'windkessel' - initial_stddev: 1 #- - # id: 4 + # id: 3 # type: 'windkessel' # initial_stddev: 1 + - + id: 4 + type: 'windkessel' + initial_stddev: 1 #- # id: 5 # type: 'windkessel'