ODE System Solve Class

Class which is returned in solveODE_System_IVP calls

ode_systemSolution

Name of class returned

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

Constructer for class.

Parameters:
  • eqn (list) –

    Equations to solve in form of list of strings. function and derivatives represented as "u", "ut", "utt", etc. for first equation. "x", "xt", etc. for second equation. "y", "yt", etc. for third equation. 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) –

    list of lists of inital data for each deriviatve.

  • 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 PINN uses in training.

  • epochs (int) –

    Number of epochs PINN gets trained for.

  • order (list) –

    list of orders of equations (highest derivative used). Can be 1-3. ex. [1, 3, 2], corresponding to a highest derivative of "ut", "xttt", "ytt".

  • net_layers (int) –

    Number of internal layers of PINN

  • 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"

  • model (PINN) –

    User may pass in user constructed network, however no guarentee of correct training.

  • flag (string) –

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

Constructer also generates, t: randomly sampled points along t, and de_points: randomly sampled points for model to train with. Then calls PINNtrainSelect_Standard function to train. Then defines solution prediction from returned model

Class Functions

Fucntions the user should call to access information from solveODE call. Getter functions and Plotter functions

Getters

get_equation()

Return input equation

get_inits()

Return input init_data

get_t_bdry()

Return input t_bdry

get_N_pde()

Return input N_pde

get_epochs()

Return input epochs

get_orders()

Return input orders

get_flag()

Return internal flag

get_constraint()

Return input constraint

get_epoch_loss()

Return model epoch loss

get_de_loss()

Return model de loss

get_vp_loss()

Return model ivp loss

get_t_points()

Return randomly sampled t points

get_solution_prediction()

Return model solution prediction

get_model()

Return trained model

get_de_points()

Return randomly sampled de points

get_net_layers()

Return input net layers

get_net_units()

Return input net units

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_ivp_loss(filetitle='ODE-IVP-Loss')

Calls ode_Plotters.plot_ivp_loss with correct data

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

    Title of saved file

plot_de_loss(filetitle='ODE-DE-Loss')

Calls ode_Plotters.plot_de_loss with correct data

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

    Title of saved file

plot_all_losses(filetitle='ODE-All-Losses')

Calls ode_Plotters.plot_all_losses with correct data

Parameters:
  • filetitle (string, default: 'ODE-All-Losses' ) –

    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