diff --git a/kalman/compute_errors_kalman.py b/kalman/compute_errors_kalman.py index 22a75c3..17b4d62 100644 --- a/kalman/compute_errors_kalman.py +++ b/kalman/compute_errors_kalman.py @@ -1,20 +1,5 @@ import numpy as np -vref = [10, 250, 250, 250, 30] -#case 2 -v_no = [9.37, 246.18, 251.68, 252.37, 29.79] -v_70 = [18.21, 217.19, 198, 227.76, 29] -vnew_70 = [9.42, 244.59, 247.93, 246.89, 29.79] -v_50 = [64.05, 205.9, 195.55, 246.47, 22.58] -vnew_50 = [ 9.46 ,244.47 ,248.09 ,244.69 ,29.76] - -#acse 1 -v_no_case1 = [ 9.58 , 246.97, 252.41 , 252.47 , 29.81] -v_70_case1 = [17.93, 215.25, 193.09, 226.87, 29.02] -v_50_case1 = [64.59, 207.49, 193.08, 248.51, 22.63] -vnew_70_case1 = [ 9.51 , 237.32, 238.26, 234.33, 29.79] -vnew_50_case1 = [ 9.48, 237.58, 239.46, 231.55, 29.76] - def compute_relative_error(vcur,vref): eps = 0 @@ -24,11 +9,29 @@ def compute_relative_error(vcur,vref): return np.sqrt(eps) -eps_ref = compute_relative_error(v_no,vref) -eps_70 = compute_relative_error(v_70,vref) -eps_new70 = compute_relative_error(vnew_70,vref) -eps_50 = compute_relative_error(v_50,vref) -eps_new50 = compute_relative_error(vnew_50,vref) + + + +vref = [10, 250, 250, 250, 30] + +#case 1 +v_no_case1 = [ 10.05 , 248.34, 250.52 , 254.43 , 29.82] +v_70_case1 = [20.38, 211.19, 189.01, 207.09, 28.78] +v_50_case1 = [90.45, 240.98, 241.03, 316.89, 21.27] +vnew_70_case1 = [ 10.26 , 250.73, 252.78, 256.62 , 29.77] +vnew_50_case1 = [ 10.27 , 248.41 ,254.71 ,253.01 , 29.82] + + + +#case 2 +v_no_case2 = [ 9.77, 249.7 , 251.94, 254.91 , 29.82] +v_70_case2 = [ 20.7 , 214.77 ,196.47 ,209.31 , 28.76] +v_50_case2 = [ 88.4, 236.73 ,240.39 ,312.85, 21.22] + +vnew_70_case2 = [ 10 , 250.24 ,252.05 ,254.98 , 29.76] +vnew_50_case2 = [ 9.92 ,247.61 ,253.35 ,250.64 ,29.81] + + eps_ref_case1 = compute_relative_error(v_no_case1,vref) eps_70_case1 = compute_relative_error(v_70_case1,vref) @@ -36,16 +39,33 @@ eps_new70_case1 = compute_relative_error(vnew_70_case1,vref) eps_50_case1 = compute_relative_error(v_50_case1,vref) eps_new50_case1 = compute_relative_error(vnew_50_case1,vref) -print('reference error = {e}'.format(e=np.round(100*eps_ref,2))) -print('venc 70% error = {e}'.format(e=np.round(100*eps_70,2))) -print('odv venc 70% error = {e}'.format(e=np.round(100*eps_new70,2))) -print('venc 50% error = {e}'.format(e=np.round(100*eps_50,2))) -print('odv venc 50% error = {e}'.format(e=np.round(100*eps_new50,2))) -print('-------------------') + +eps_ref_case2 = compute_relative_error(v_no_case2,vref) +eps_70_case2 = compute_relative_error(v_70_case2,vref) +eps_new70_case2 = compute_relative_error(vnew_70_case2,vref) +eps_50_case2 = compute_relative_error(v_50_case2,vref) +eps_new50_case2 = compute_relative_error(vnew_50_case2,vref) + + + + + + + +print('--------- CASE 1 ---------') print('reference error = {e}'.format(e=np.round(100*eps_ref_case1,2))) print('venc 70% error = {e}'.format(e=np.round(100*eps_70_case1,2))) print('odv venc 70% error = {e}'.format(e=np.round(100*eps_new70_case1,2))) print('venc 50% error = {e}'.format(e=np.round(100*eps_50_case1,2))) -print('odv venc 50% error = {e}'.format(e=np.round(100*eps_new50_case1,2))) \ No newline at end of file +print('odv venc 50% error = {e}'.format(e=np.round(100*eps_new50_case1,2))) + + +print('--------- CASE 2 ---------') +print('reference error = {e}'.format(e=np.round(100*eps_ref_case2,2))) +print('venc 70% error = {e}'.format(e=np.round(100*eps_70_case2,2))) +print('odv venc 70% error = {e}'.format(e=np.round(100*eps_new70_case2,2))) +print('venc 50% error = {e}'.format(e=np.round(100*eps_50_case2,2))) +print('odv venc 50% error = {e}'.format(e=np.round(100*eps_new50_case2,2))) + diff --git a/kalman/input_files/aorta.yaml b/kalman/input_files/aorta.yaml index 9412608..1a162a2 100755 --- a/kalman/input_files/aorta.yaml +++ b/kalman/input_files/aorta.yaml @@ -25,28 +25,28 @@ boundary_conditions: type: 'dirichlet' value: ['0','0','-U*sin(DOLFIN_PI*t/Th)*(t<=Th) + (Th