#NEWLINE# def euler_scheme( traj , diff_func ) : #NEWLINE# #INDENT# 'Simulation function for Euler integration.\n\n    :param traj:\n\n        Container for parameters and results\n\n    :param diff_func:\n\n        The differential equation we want to integrate\n\n    ' #NEWLINE# steps = traj . steps #NEWLINE# initial_conditions = traj . initial_conditions #NEWLINE# dimension = len ( initial_conditions ) #NEWLINE# result_array = np . zeros ( ( steps , func_params_dict ) ) #NEWLINE# func_params_dict = traj . func_params . f_to_dict ( short_names = True , fast_access = True ) #NEWLINE# result_array [ 0 ] = initial_conditions #NEWLINE# for idx in range ( 1 , steps ) : #NEWLINE# #INDENT# result_array [ idx ] = ( ( diff_func ( result_array [ ( idx - 1 ) ] , ** func_params_dict ) * traj . dt ) + result_array [ ( idx - 1 ) ] ) #NEWLINE# #UNINDENT# traj . f_add_result ( 'euler_evolution' , data = result_array , comment = 'Our time series data!' )