Skip to content
Snippets Groups Projects
Commit 983ba6b8 authored by Jan Habscheid's avatar Jan Habscheid
Browse files

UPdated PINN + first draw for ANN

parent 7d2d07d8
No related branches found
No related tags found
No related merge requests found
'''
Jan Habscheid
Jan.Habscheid@rwth-aachen.de
'''
import numpy as np
import pandas as pd
from src.FEniCSx_NonLinearHeatEquation import solve_heatequation, kappa_Slack, kappa_Klinger
# Parameters
melting_temp_C = np.linspace(1., 8., 30)
ice_temp_C = .0
number_cells = 1024
relax_param = 0.1
x0 = 0
x1 = 1
return_type = 'Vector'
rtol = 1e-4
max_iter = 500
# Transform to Kelvin
melting_temp_K, ice_temp_K = melting_temp_C + 273.15, ice_temp_C + 273.15
# Solve heat equation
T_vals = []
for melting_temp_ in melting_temp_K:
T_, x_ = solve_heatequation(melting_temp_, ice_temp_K, kappa_Slack, relax_param, number_cells, x0, x1, return_type, rtol, max_iter)
T_vals.append(T_)
# Save data
T_vals = np.array(T_vals)
x = x_
# columns = [f'melting_temp_K {melting_temp_K_}' for melting_temp_K_ in
# melting_temp_K]
columns = [f'{melting_temp_K_}' for melting_temp_K_ in melting_temp_K]
df = pd.DataFrame(T_vals.T, columns=columns)
df['x'] = x
df.to_csv('data/heat_equation.csv', index=False)
# Validation data
T_validate, x_validate = solve_heatequation(3.5+273.15, ice_temp_K, kappa_Slack, relax_param, number_cells, x0, x1, return_type, rtol, max_iter)
# Save validation data
df_validate = pd.DataFrame({'T': T_validate, 'x': x_validate})
df_validate.to_csv('data/heat_equation_validate.csv', index=False)
This diff is collapsed.
This diff is collapsed.
File added
This diff is collapsed.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment