ODE DeepONet Solve Class

Class which is returned in solveODE_DeepONet_IVP and solveODE_DeepONet_BVP calls

ode_DeepONetsolution

Name of class returned

__init__(eqn, inits, t_bdry, N_pde, N_sensors, sensor_range, epochs, order, net_layers, net_units, constraint, flag)

Constructer for class.

Parameters:
  • eqn (string) –

    Equation to solve in form of string. function and derivatives represented as "u", "ut", "utt", etc. for including function, i.e. cos(u), use tf.cos(u), or for ln(t), np.log(t). Write equation as would be written in code.

  • inits (list) –

    inital data for each deriviatve. Second order equation would have [u(t0), ut(t0)], with t0 being inital t in t_bdry.

  • t_bdry (list) –

    list of two elements, the interval of t to be solved on.

  • N_pde (int) –

    Number of randomly sampled collocation points along t which DeepONet uses in training.

  • N_sensors (int) –

    Number of sensors in which network learns over.

  • sensor_range (list) –

    range in which sensors are sampled over.

  • epochs (int) –

    Number of epochs DeepONet gets trained for.

  • order (int) –

    order of equation (highest derivative used). Can be 1-3.

  • net_layers (int) –

    Number of internal layers of DeepONet

  • net_units (int) –

    Number of units in each internal layer

  • constraint (string) –

    Determines hard constrainting inital conditions or network learning inital conditions. "soft" or "hard"

  • flag (string) –

    Flag for internal use to identify which equation is being solved.

Constructer calls PINNtrainSelect_DeepONet function to train, where all points are defined and solution prediction is generated within training file.

Class Functions

Fucntions the user should call to access information from solveODE call. Getter functions, Plotter functions, and time stepping function

Getters

get_equation()

Return input equation

get_inits()

Return input inital data

get_t_bdry()

Return input t_bdry

get_N_pde()

Return input N_pde

get_epochs()

Return input epochs

get_order()

Return input order

get_flag()

Return internal flag

get_N_sensors()

Return input N_sensors

get_sensor_range()

Return input sensor range

get_net_layers()

Return input net layers

get_net_units()

Return input net units

get_constraint()

Return input constraint

get_loss()

Return model total loss

get_t_points()

Return sampled t points

get_solution_prediction()

Return model solution prediction

get_params()

Return model paramaters

get_model()

Return model

get_de_points()

Return sampled de points

get_sensors()

Return sensors

Plotters

plot_epoch_loss(filetitle='ODE-Epoch-Loss')

Calls ode_Plotters.plot_epoch_loss with correct data

Parameters:
  • filetitle (string, default: 'ODE-Epoch-Loss' ) –

    Title of saved file

plot_solution_prediction(filetitle='ODE-solution-pred')

Calls ode_Plotters.plot_solution_prediction with correct data

Parameters:
  • filetitle (string, default: 'ODE-solution-pred' ) –

    Title of saved file

plot_predicted_exact(exact_eqn, filetitle='ODE-SolPred-Exact')

Calls ode_Plotters.plot_predicted_exact with correct data

Parameters:
  • exact_eqn (lambda) –

    Exact solution of equation as a python lambda function

  • filetitle (string, default: 'ODE-SolPred-Exact' ) –

    Title of saved file

Time Stepper

timeStep(steps)

Calls ode_TimeSteppers function for corresponding equation type

Parameters:
  • steps (int) –

    steps to timestep DeepONet. If original range was [0,2], and steps = 4, then timestep will be on [0, 8]