diff --git a/sample-result.mat b/sample-result.mat new file mode 100644 index 0000000..0f1f40b Binary files /dev/null and b/sample-result.mat differ diff --git a/sample_script.py b/sample_script.py index fbc9b85..6526ab9 100755 --- a/sample_script.py +++ b/sample_script.py @@ -17,6 +17,7 @@ # Load the data: data = loadmat('sample-data.mat', squeeze_me=True) +# set the density uncertainty at the boundary points sigma_rho_dirichlet = 0.01 # calculate density and uncertainty @@ -27,6 +28,9 @@ sigma_grad_x=data['sigma_rho_x'], sigma_grad_y=data['sigma_rho_y'], sigma_dirichlet=sigma_rho_dirichlet) +# save the results to file +savemat(file_name='sample-result.mat', mdict={'X': data['X'], 'Y': data['Y'], 'rho': rho, 'sigma_rho': sigma_rho}, long_field_names=True) + # Plot the results fig1 = plt.figure(1, figsize=(12,8)) plt.figure(1) @@ -60,7 +64,8 @@ plt.title('sigma rho') plt.tight_layout() -# save results to file + +# save plot to file plt.savefig('sample-result.png') plt.close()