battery_discharge_flag error

38 views
Skip to first unread message

Daniel E.

unread,
Mar 24, 2022, 3:31:27 PM3/24/22
to SUAVE FORUM
Hi all,

I am getting the following error:
AttributeError: 'Conditions' object has no attribute 'battery_discharge_flag'
The following is the mission segment I have setup. I am using a lift_cruise network.
Any thoughts on what could be causing this?

Thank you
- Daniel


def mini_mission():
       
        # ------------------------------------------------------------------
        #   Initialize the Mission
        # ------------------------------------------------------------------
        mission = SUAVE.Analyses.Mission.Sequential_Segments()
        mission.tag = 'the_mission'

        # unpack Segments module
        Segments                                                 = SUAVE.Analyses.Mission.Segments
        base_segment                                             = Segments.Segment()
        base_segment.process.iterate.initials.initialize_battery = SUAVE.Methods.Missions.Segments.Common.Energy.initialize_battery
        base_segment.process.iterate.conditions.planet_position  = SUAVE.Methods.skip
        base_segment.battery_discharge                           = True
   
        # ------------------------------------------------------------------
        #  Single Point Segment 1: constant Speed, constant altitude
        # ------------------------------------------------------------------
        segment = SUAVE.Analyses.Mission.Segments.Single_Point.Set_Speed_Set_Altitude(base_segment)
        segment.tag                   = "single_point"
        segment.analyses.extend(analyses)
        segment.altitude              = altitude
        segment.temperature_deviation = delta_isa
        segment.battery_energy        = nets.battery.max_energy
       
        # add to misison
        mission.append_segment(segment)    

        return mission

# Run mini mission to get propulsive efficiency
    nets                                    = getattr( vehicle.networks, net)
    mission                                 = mini_mission()
    mission.segments.single_point.air_speed =  35.0
    point_results = mission.evaluate()  

Emilio

unread,
Mar 30, 2022, 2:50:27 PM3/30/22
to SUAVE FORUM
Hi Daniel,
This script is missing the unknowns and residuals. Just one line (which is different for each segment) needs to be added.

-Emilio

Reply all
Reply to author
Forward
0 new messages