Older stuff/Tests_alias_TKinter_gui.py
def PrepareSimulation(self, rho, cp, lmbd):
        """
        Defines inputs and initial Simulation state (Sim) for make_sim_step
        """

        all_parameters = self.get_numbers_from_the_user_input(self.number_parameters_to_get_from_user)
        (self.dt, self.object_length, self.place_of_interest,
            self.number_of_elements) = all_parameters

        t_data = []  # experimental data of time points
        T_data = []  # experimental data of temperature data at x0=0.008
        q_data = []  # experimental data of Measured HeatFluxes at left boundary
        T_amb_data = []  # experimental data of ambinet temperature

        # read from datafile (might look like this)
        with open('DATA.csv') as csvDataFile:
            csvReader = csv.reader(csvDataFile)
            next(csvReader, None)  # skip first line (headers)
            for row in csvReader:
                t_data.append(float(row[0]))
                T_data.append(float(row[1]))
                q_data.append(float(row[2]))
                T_amb_data.append(float(row[3]))

        test_q = MakeDataCallable(t_data, q_data)  # colapse data into callable function test_q(t)
        self.T_experiment = MakeDataCallable(t_data, T_data)  # colapse data into callable function T_experiment(t)
        T_amb = MakeDataCallable(t_data, T_amb_data)  # colapse data into callable function T_amb(t)
        # Look into NumericalForward.py for details

        # This  is how the experiment recorded in DATA.csv was aproximately done
        my_material = Material(rho, cp, lmbd)
        self.Sim = Simulation(Length=self.object_length,
                              Material=my_material,
                              N=self.number_of_elements,
                              HeatFlux=test_q,
                              AmbientTemperature=T_amb,
                              RobinAlpha=13.5,
                              x0=self.place_of_interest)

        self.MyCallBack = NewCallback(ExperimentData=(t_data, T_data))
        self.t_start = t_data[0]
        self.t_stop = t_data[-1]-1
        self.Sim.t.append(0.0)  # push start time into time placeholder inside Simulation class
        self.Sim.T.fill(T_data[0])  # fill initial temperature with value of T0
        self.Sim.T_record.append(self.Sim.T)  # save initial step

        return True

        Defines inputs and initial Simulation state (Sim) for make_sim_step
        
Defines inputs and initial Simulation state (Sim) for make_sim_step
Defines inputs and initial Simulation state ( Sim ) for make_sim_step
def PrepareSimulation(self, rho, cp, lmbd):
        all_parameters = self.get_numbers_from_the_user_input(self.number_parameters_to_get_from_user)
        (self.dt, self.object_length, self.place_of_interest,
            self.number_of_elements) = all_parameters
        t_data = []  
        T_data = []  
        q_data = []  
        T_amb_data = []  
        with open('DATA.csv') as csvDataFile:
            csvReader = csv.reader(csvDataFile)
            next(csvReader, None)  
            for row in csvReader:
                t_data.append(float(row[0]))
                T_data.append(float(row[1]))
                q_data.append(float(row[2]))
                T_amb_data.append(float(row[3]))
        test_q = MakeDataCallable(t_data, q_data)  
        self.T_experiment = MakeDataCallable(t_data, T_data)  
        T_amb = MakeDataCallable(t_data, T_amb_data)  
        my_material = Material(rho, cp, lmbd)
        self.Sim = Simulation(Length=self.object_length,
                              Material=my_material,
                              N=self.number_of_elements,
                              HeatFlux=test_q,
                              AmbientTemperature=T_amb,
                              RobinAlpha=13.5,
                              x0=self.place_of_interest)
        self.MyCallBack = NewCallback(ExperimentData=(t_data, T_data))
        self.t_start = t_data[0]
        self.t_stop = t_data[-1]-1
        self.Sim.t.append(0.0)  
        self.Sim.T.fill(T_data[0])  
        self.Sim.T_record.append(self.Sim.T)  
        return True
def PrepareSimulation ( self , rho , cp , lmbd ) : all_parameters = self . get_numbers_from_the_user_input ( self . number_parameters_to_get_from_user ) ( self . dt , self . object_length , self . place_of_interest , self . number_of_elements ) = all_parameters t_data = [ ] T_data = [ ] q_data = [ ] T_amb_data = [ ] with open ( 'DATA.csv' ) as csvDataFile : csvReader = csv . reader ( csvDataFile ) next ( csvReader , None ) for row in csvReader : t_data . append ( float ( row [ 0 ] ) ) T_data . append ( float ( row [ 1 ] ) ) q_data . append ( float ( row [ 2 ] ) ) T_amb_data . append ( float ( row [ 3 ] ) ) test_q = MakeDataCallable ( t_data , q_data ) self . T_experiment = MakeDataCallable ( t_data , T_data ) T_amb = MakeDataCallable ( t_data , T_amb_data ) my_material = Material ( rho , cp , lmbd ) self . Sim = Simulation ( Length = self . object_length , Material = my_material , N = self . number_of_elements , HeatFlux = test_q , AmbientTemperature = T_amb , RobinAlpha = 13.5 , x0 = self . place_of_interest ) self . MyCallBack = NewCallback ( ExperimentData = ( t_data , T_data ) ) self . t_start = t_data [ 0 ] self . t_stop = t_data [ - 1 ] - 1 self . Sim . t . append ( 0.0 ) self . Sim . T . fill ( T_data [ 0 ] ) self . Sim . T_record . append ( self . Sim . T ) return True
Defines inputs and initial Simulation state (Sim) for make_sim_step
Defines inputs and initial Simulation state ( Sim ) for make_sim_step
"""
        Defines inputs and initial Simulation state (Sim) for make_sim_step
        """ # experimental data of time points # experimental data of temperature data at x0=0.008 # experimental data of Measured HeatFluxes at left boundary # experimental data of ambinet temperature # read from datafile (might look like this) # skip first line (headers) # colapse data into callable function test_q(t) # colapse data into callable function T_experiment(t) # colapse data into callable function T_amb(t) # Look into NumericalForward.py for details # This  is how the experiment recorded in DATA.csv was aproximately done # push start time into time placeholder inside Simulation class # fill initial temperature with value of T0 # save initial step
self
rho
cp
lmbd