0de7a2181e4cddb4c10f8bfd3b8ea43e18fbb19e,trunk/SUAVE/Components/Energy/Networks/Battery_Ducted_Fan.py,Battery_Ducted_Fan,evaluate_thrust,#Battery_Ducted_Fan#Any#,38

Before Change


            if initial_energy[0]==0: //beginning of segment; initialize battery
                battery.current_energy=battery.current_energy[-1]*np.ones_like(initial_energy)
        except AttributeError: //battery energy not initialized, e.g. in takeoff
            battery.current_energy=battery.current_energy[-1]*np.ones_like(F)
       
        pbat=-Pe/self.motor_efficiency
        
        battery_logic     = Data()

After Change


        numerics   = state.numerics
  
        results=propulsor.evaluate_thrust(state)
        Pe     =results.thrust_force_vector[:,0]*conditions.freestream.velocity
        """
        try:
            initial_energy=conditions.propulsion.battery_energy
            print conditions.propulsion
            if initial_energy[0][0]==0: //beginning of segment; initialize battery
                battery.current_energy=battery.current_energy[-1]*np.ones_like(initial_energy)
        except AttributeError: //battery energy not initialized, e.g. in takeoff
            battery.current_energy=battery.current_energy[-1]*np.ones_like(F)
        """
        pbat=-Pe/self.motor_efficiency
        
        battery_logic     = Data()
        battery_logic.power_in = pbat
        battery_logic.current  = 90.  //use 90 amps as a default for now; will change this for higher fidelity methods
      
        battery.inputs    =battery_logic
        battery.inputs.power_in=pbat
        tol = 1e-6
        battery.energy_calc(numerics)
        //allow for mass gaining batteries
       
        try:
            mdot=find_mass_gain_rate(battery,-(pbat-battery.resistive_losses))
        except AttributeError:
            mdot=np.zeros_like(F)
           
       
        
        
        //Pack the conditions for outputs
        battery_draw                         = battery.inputs.power_in
        battery_energy                       = battery.current_energy
      
        conditions.propulsion.battery_draw   = battery_draw
        conditions.propulsion.battery_energy = battery_energy
        output_power= battery_draw
        //number_of_engines
        //Create the outputs
        
        
 
        results.vehicle_mass_rate   = mdot
        results.energy              = battery_energy
        return results
            
    __call__ = evaluate_thrust
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: suavecode/SUAVE
Commit Name: 0de7a2181e4cddb4c10f8bfd3b8ea43e18fbb19e
Time: 2015-04-30
Author: jmvegh@stanford.edu
File Name: trunk/SUAVE/Components/Energy/Networks/Battery_Ducted_Fan.py
Class Name: Battery_Ducted_Fan
Method Name: evaluate_thrust


Project Name: Scitator/catalyst
Commit Name: 43df540b512c616a882df1f35c8862fa332b9317
Time: 2019-01-20
Author: grinchuk.alexey@gmail.com
File Name: rl/agents/actor.py
Class Name: RealNVPActor
Method Name: forward


Project Name: geomstats/geomstats
Commit Name: c1f116ffdced6cf3705b37868e55c4e2b258650b
Time: 2020-04-06
Author: nicolas.guigui@inria.fr
File Name: tests/test_invariant_metric.py
Class Name: TestInvariantMetricMethods
Method Name: setUp