def simulate_dynamic(self, pattern, order = <NUM_LIT>, solution = solve_type.RK4, collect_dynamic = False, step = <NUM_LIT:0.1>, int_step = <NUM_LIT>, threshold_changes = <NUM_LIT>):
self.__validate_pattern(pattern);<EOL>if (self._ccore_network_pointer is not None):<EOL><INDENT>ccore_instance_dynamic = wrapper.syncpr_simulate_dynamic(self._ccore_network_pointer, pattern, order, solution, collect_dynamic, step);<EOL>return syncpr_dynamic(None, None, ccore_instance_dynamic);<EOL><DEDENT>for i in range(<NUM_LIT:0>, len(pattern), <NUM_LIT:1>):<EOL><INDENT>if (pattern[i] > <NUM_LIT:0.0>):<EOL><INDENT>self._phases[i] = <NUM_LIT:0.0>;<EOL><DEDENT>else:<EOL><INDENT>self._phases[i] = math.pi / <NUM_LIT>;<EOL><DEDENT><DEDENT>time_counter = <NUM_LIT:0>;<EOL>previous_order = <NUM_LIT:0>;<EOL>current_order = self.__calculate_memory_order(pattern);<EOL>dyn_phase = [];<EOL>dyn_time = [];<EOL>if (collect_dynamic == True):<EOL><INDENT>dyn_phase.append(self._phases);<EOL>dyn_time.append(<NUM_LIT:0>);<EOL><DEDENT>while (current_order < order):<EOL><INDENT>self._phases = self._calculate_phases(solution, time_counter, step, int_step);<EOL>time_counter += step;<EOL>if (collect_dynamic == True):<EOL><INDENT>dyn_phase.append(self._phases);<EOL>dyn_time.append(time_counter);<EOL><DEDENT>previous_order = current_order;<EOL>current_order = self.__calculate_memory_order(pattern);<EOL>if (abs(current_order - previous_order) < threshold_changes):<EOL><INDENT>break;<EOL><DEDENT><DEDENT>if (collect_dynamic != True):<EOL><INDENT>dyn_phase.append(self._phases);<EOL>dyn_time.append(time_counter);<EOL><DEDENT>output_sync_dynamic = syncpr_dynamic(dyn_phase, dyn_time, None);<EOL>return output_sync_dynamic<EOL>
!
        @brief Performs dynamic simulation of the network until stop condition is not reached.
        @details In other words network performs pattern recognition during simulation. 
                 Stop condition is defined by input argument 'order' that represents memory order, but
                 process of simulation can be stopped if convergance rate is low whose threshold is defined
                 by the argument 'threshold_changes'.

        @param[in] pattern (list): Pattern for recognition represented by list of features that are equal to [-1; 1].
        @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()