code: def update():
      global x, xprev, t, n
      ret_x = []
      ret_xdot = []
      for _ in range(timesteps_per_update):
          xnext = (
              2 * beta * x
              + (alpha - beta) * xprev
              - dV_dx(x)
              + gamma * np.cos(omega * t)
          ) / (alpha + beta)
          n += 1
          t += dt
          xdot = (xnext - xprev) / (2 * dt)
          xprev = x
          x = xnext
          if n % timesteps_per_plot == 0:
              ret_x.append(x)
              ret_xdot.append(xdot)
      return ret_x, ret_xdot
  
file_path: bokeh/examples/server/app/duffing_oscillator.py
imports: import numpy
  from bokeh.layouts import column, row
  from bokeh.models import ColumnDataSource, Div, Paragraph, Range1d, Slider
  from bokeh.plotting import curdoc, figure
label_desc: Use image node_id 5 for calling a global function with example usage: update() and returns: ret_x,  ret_xdot