class_docstr: !
  @brief Model of oscillatory network that is based on the Kuramoto model of synchronization.
  
  @details CCORE option can be used to use the pyclustering core - C/C++ shared library for processing that significantly increases performance.
docstr: !
  @brief Performs dynamic simulation of the network until stop condition is not reached. Stop condition is defined by input argument 'order'.
  
  @param[in] order (double): Order of process synchronization, distributed 0..1.
  @param[in] solution (solve_type): Type of solution.
  @param[in] collect_dynamic (bool): If True - returns whole dynamic of oscillatory network, otherwise returns only last values of dynamics.
  @param[in] step (double): Time step of one iteration of simulation.
  @param[in] int_step (double): Integration step, should be less than step.
  @param[in] threshold_changes (double): Additional stop condition that helps prevent infinite simulation, defines limit of changes of oscillators between current and previous steps.
  
  @return (list) Dynamic of oscillatory network. If argument 'collect_dynamic' = True, than return dynamic for the whole simulation time,
          otherwise returns only last values (last step of simulation) of dynamic.
  
  @see simulate()
  @see simulate_static()
docstr_tok: ["!","@","brief","Performs","dynamic","simulation","of","the","network","until","stop","condition","is","not","reached",".","Stop","condition","is","defined","by","input","argument","'order","'",".","@","param","[","in","]","order","(","double",")",":","Order","of","process","synchronization",",","distributed","0","..","1",".","@","param","[","in","]","solution","(","solve_type",")",":","Type","of","solution",".","@","param","[","in","]","collect_dynamic","(","bool",")",":","If","True","-","returns","whole","dynamic","of","oscillatory","network",",","otherwise","returns","only","last","values","of","dynamics",".","@","param","[","in","]","step","(","double",")",":","Time","step","of","one","iteration","of","simulation",".","@","param","[","in","]","int_step","(","double",")",":","Integration","step",",","should","be","less","than","step",".","@","param","[","in","]","threshold_changes","(","double",")",":","Additional","stop","condition","that","helps","prevent","infinite","simulation",",","defines","limit","of","changes","of","oscillators","between","current","and","previous","steps",".","@","return","(","list",")","Dynamic","of","oscillatory","network",".","If","argument","'collect_dynamic","'","=","True",",","than","return","dynamic","for","the","whole","simulation","time",",","otherwise","returns","only","last","values","(","last","step","of","simulation",")","of","dynamic",".","@","see","simulate","(",")","@","see","simulate_static","(",")"]
code: def simulate_dynamic(
      self,
      order=0.998,
      solution=solve_type.FAST,
      collect_dynamic=False,
      step=0.1,
      int_step=0.01,
      threshold_changes=0.0000001,
  ):
      """!
      @brief Performs dynamic simulation of the network until stop condition is not reached. Stop condition is defined by input argument 'order'.
  
      @param[in] order (double): Order of process synchronization, distributed 0..1.
      @param[in] solution (solve_type): Type of solution.
      @param[in] collect_dynamic (bool): If True - returns whole dynamic of oscillatory network, otherwise returns only last values of dynamics.
      @param[in] step (double): Time step of one iteration of simulation.
      @param[in] int_step (double): Integration step, should be less than step.
      @param[in] threshold_changes (double): Additional stop condition that helps prevent infinite simulation, defines limit of changes of oscillators between current and previous steps.
  
      @return (list) Dynamic of oscillatory network. If argument 'collect_dynamic' = True, than return dynamic for the whole simulation time,
              otherwise returns only last values (last step of simulation) of dynamic.
  
      @see simulate()
      @see simulate_static()
  
      """
  
      if self._ccore_network_pointer is not None:
          ccore_instance_dynamic = wrapper.sync_simulate_dynamic(
              self._ccore_network_pointer,
              order,
              solution,
              collect_dynamic,
              step,
              int_step,
              threshold_changes,
          )
          return sync_dynamic(None, None, ccore_instance_dynamic)
  
      # For statistics and integration
      time_counter = 0
  
      # Prevent infinite loop. It's possible when required state cannot be reached.
      previous_order = 0
      current_order = self.sync_local_order()
  
      # If requested input dynamics
      dyn_phase = []
      dyn_time = []
      if collect_dynamic == True:
          dyn_phase.append(self._phases)
          dyn_time.append(0)
  
      # Execute until sync state will be reached
      while current_order < order:
          # update states of oscillators
          self._phases = self._calculate_phases(
              solution, time_counter, step, int_step
          )
  
          # update time
          time_counter += step
  
          # if requested input dynamic
          if collect_dynamic == True:
              dyn_phase.append(self._phases)
              dyn_time.append(time_counter)
  
          # update orders
          previous_order = current_order
          current_order = self.sync_local_order()
  
          # hang prevention
          if abs(current_order - previous_order) < threshold_changes:
              # print("Warning: sync_network::simulate_dynamic - simulation is aborted due to low level of convergence rate (order = " + str(current_order) + ").");
              break
  
      if collect_dynamic != True:
          dyn_phase.append(self._phases)
          dyn_time.append(time_counter)
  
      output_sync_dynamic = sync_dynamic(dyn_phase, dyn_time, None)
      return output_sync_dynamic
  
imports: import math
  import numpy
  import random
  import matplotlib.pyplot
  import matplotlib.animation
  import pyclustering.core.sync_wrapper
  from pyclustering.core.wrapper import ccore_library
  from scipy.integrate import odeint
  from pyclustering.nnet import network, conn_represent, conn_type, initial_type, solve_type
  from pyclustering.utils import pi, draw_dynamics, draw_dynamics_set, set_ax_param
label_desc: Use image node_id 7 for calling the sync_network obj's underlying member method code with example usage: obj.simulate_dynamic(order, solution, collect_dynamic, step, int_step, threshold_changes) and returns: output_sync_dynamic, sync_dynamic