class_docstr: A PID controller for ODE adaptive step size control.
class_docstr_tok: ["A","PID","controller","for","ODE","adaptive","step","size","control","."]
code: def __init__(
      self,
      h,
      pcoeff,
      icoeff,
      dcoeff,
      order=1,
      accept_safety=0.81,
      eps=1e-8,
  ):
      self.h = h
      self.b1 = (pcoeff + icoeff + dcoeff) / order
      self.b2 = -(pcoeff + 2 * dcoeff) / order
      self.b3 = dcoeff / order
      self.accept_safety = accept_safety
      self.eps = eps
      self.errs = []
  
imports: import math
  import torch
  import torchsde
  from scipy import integrate
  from torch import nn
  from torchdiffeq import odeint
  from tqdm.auto import tqdm, trange
label_desc: Use image node_id 1 to create a new PIDStepSizeController object  with example: obj = PIDStepSizeController(h, pcoeff, icoeff, dcoeff, order, accept_safety, eps)