pde_Plotters

Functions for plotting data in PDE solution classes.

While available to user, not meant to be used. Meant to be used through object returned from solvePDE calls, then calling plotting function of object calls plotting functions with correct data. See examples for how this is done.

We encourage users to plot data by getting data from object (epoch loss, solution prediciton, etc.), and then making specific plots for each problem. These provide quick, easy to visualize plots of data from model available from solving function.

plot_epoch_loss(epoch_loss, epochs, title)

Plotting epoch loss of trained model. Saves image in current directory.

Parameters:
  • epoch_loss (list) –

    Total loss from training

  • epochs (int) –

    Epochs trained for

  • title (string) –

    File title

No returns

plot_iv_loss(iv_loss, epochs, title)

Plotting just initial value loss of trained model. Will be zero for problems in x and y or hard constraints. Saves image in current directory.

Parameters:
  • iv_loss (list) –

    iv loss from training

  • epochs (int) –

    Epochs trained for

  • title (string) –

    File title

No returns

plot_bc_loss(bc_loss, epochs, title)

Plotting just boundary value loss of trained model. Will be zero for hard constraints. Saves image in current directory.

Parameters:
  • bc_loss (list) –

    bc loss from training

  • epochs (int) –

    Epochs trained for

  • title (string) –

    File title

No returns

plot_pde_loss(de_loss, epochs, title)

Plotting just differential equation loss of trained model. Saves image in current directory.

Parameters:
  • de_loss (list) –

    de loss from training

  • epochs (int) –

    Epochs trained for

  • title (string) –

    File title

No returns

plot_solution_prediction(T, X, solPred, flag, title)

Plotting predicted solution of trained model as 2D contour plot. Saves image in current directory.

Parameters:
  • T (list) –

    Sampled points along T or X meshgrided with X or Y for evaluating model

  • X (list) –

    Sampled points along X or Y meshgrided with T or X for evaluating model

  • solPred (list) –

    Solution prediction of model

  • flag (string) –

    Flag which determines whether to plot axis T/X or X/Y

  • title (string) –

    File title

No returns

plot_3D(T, X, solPred, flag, title)

Plotting predicted solution of trained model in 3 dimensions. Saves image in current directory.

Parameters:
  • T (list) –

    Sampled points along T or X meshgrided with X or Y for evaluating model

  • X (list) –

    Sampled points along X or Y meshgrided with T or X for evaluating model

  • solPred (list) –

    Solution prediction of model

  • flag (string) –

    Flag which determines whether to plot axis T/X or X/Y

  • title (string) –

    File title

No returns

plot_predicted_exact(T, X, solPred, exact, flag, title)

Plotting predicted solution of model vs input function of solution. Saves image in current directory.

Parameters:
  • T (list) –

    Sampled points along T or X meshgrided with X or Y for evaluating model

  • X (list) –

    Sampled points along X or Y meshgrided with T or X for evaluating model

  • solPred (list) –

    Solution prediction of model

  • exact (list) –

    Values of exact equation evaluated at same points

  • flag (string) –

    Flag which determines whether to plot axis T/X or X/Y

  • title (string) –

    File title

No returns