Exemple #1
0
def plotOEM(myAircraft):
    # make a square figure and axes
    fig = figure(figsize=(15, 15))
    ax = axes([0.1, 0.1, 0.8, 0.8])

    labels = []
    fracs = []
    colors = []

    labels.append(myAircraft.wing.id)
    fracs.append(myAircraft.wing.mWing.getValue())
    colors.append(giveColorForNetworkx(wingC))

    labels.append(myAircraft.htp.id)
    fracs.append(myAircraft.htp.mHtp.getValue())
    colors.append(giveColorForNetworkx(htpC))

    labels.append(myAircraft.vtp.id)
    fracs.append(myAircraft.vtp.mVtp.getValue())
    colors.append(giveColorForNetworkx(vtpC))

    labels.append(myAircraft.fuselage.id)
    fracs.append(myAircraft.fuselage.mFuselage.getValue())
    colors.append(giveColorForNetworkx(fuselageC))

    labels.append(myAircraft.engine.id)
    fracs.append(myAircraft.engine.mEngine.getValue())
    colors.append(giveColorForNetworkx(engineC))

    labels.append(myAircraft.pylon.id)
    fracs.append(myAircraft.pylon.mPylon.getValue())
    colors.append(giveColorForNetworkx(pylonC))

    labels.append(myAircraft.systems.id)
    fracs.append(myAircraft.systems.mSystems.getValue())
    colors.append(giveColorForNetworkx(systemsC))

    labels.append(myAircraft.landingGear.id)
    fracs.append(myAircraft.landingGear.mLandingGear.getValue())
    colors.append(giveColorForNetworkx(landingGearC))

    labels.append('oIM')
    fracs.append(myAircraft.oIM.getValue())
    colors.append(giveColorForNetworkx(aircraftC))

    explode = [0.05] * len(labels)
    myPie = pie(fracs,
                explode=explode,
                labels=labels,
                colors=colors,
                autopct='%1.1f%%',
                shadow=True)
    legends = []
    for i in range(len(fracs)):
        out = '%-10s= %.2f[kg]' % (labels[i], fracs[i])
        legends.append(out)

    ax.legend(myPie[0], legends, shadow=True)
    saveFigure('OEM Breakdown')
    close(fig)
Exemple #2
0
def plotCOC(myAircraft):
    # make a square figure and axes
    fig = figure(figsize=(15, 15))
    ax = axes([0.1, 0.1, 0.8, 0.8])

    labels = []
    fracs = []
    colors = []

    #===========================================================================
    # COC
    #===========================================================================
    labels.append('costCrew')
    fracs.append(myAircraft.costCrew.getValue())
    colors.append(giveColorForNetworkx(wingC))

    labels.append('costFuel')
    fracs.append(myAircraft.costFuel.getValue())
    colors.append(giveColorForNetworkx(fuselageC))

    labels.append('costMaintenance')
    fracs.append(myAircraft.costMaintenance.getValue())
    colors.append(giveColorForNetworkx(htpC))

    labels.append('costNavigation')
    fracs.append(myAircraft.costNavigation.getValue())
    colors.append(giveColorForNetworkx(engineC))

    labels.append('costLanding')
    fracs.append(myAircraft.costLanding.getValue())
    colors.append(giveColorForNetworkx(vtpC))

    labels.append('costGround')
    fracs.append(myAircraft.costGround.getValue())
    colors.append(giveColorForNetworkx(fuelC))

    #===========================================================================
    # Plot
    #===========================================================================
    explode = [0.05] * len(labels)
    myPie = pie(fracs,
                explode=explode,
                labels=labels,
                colors=colors,
                autopct='%1.1f%%',
                shadow=True)

    legends = []
    for i in range(len(fracs)):
        out = '%-10s= %.2f[EU/bh]' % (labels[i], fracs[i])
        legends.append(out)

    ax.legend(myPie[0], legends, shadow=True)

    saveFigure('COC Breakdown')
    close(fig)
Exemple #3
0
def plotOEM(myAircraft):
    # make a square figure and axes
    fig         = figure(figsize=(15,15)) 
    ax          = axes([0.1, 0.1, 0.8, 0.8])
    
    labels      = []
    fracs       = []
    colors      = []
    
    labels.append(myAircraft.wing.id)
    fracs.append(myAircraft.wing.mWing.getValue())
    colors.append(giveColorForNetworkx(wingC))

    labels.append(myAircraft.htp.id)
    fracs.append(myAircraft.htp.mHtp.getValue())
    colors.append(giveColorForNetworkx(htpC))

    labels.append(myAircraft.vtp.id)
    fracs.append(myAircraft.vtp.mVtp.getValue())
    colors.append(giveColorForNetworkx(vtpC))

    labels.append(myAircraft.fuselage.id)
    fracs.append(myAircraft.fuselage.mFuselage.getValue())
    colors.append(giveColorForNetworkx(fuselageC))
    
    labels.append(myAircraft.engine.id)
    fracs.append(myAircraft.engine.mEngine.getValue())
    colors.append(giveColorForNetworkx(engineC))

    labels.append(myAircraft.pylon.id)
    fracs.append(myAircraft.pylon.mPylon.getValue())
    colors.append(giveColorForNetworkx(pylonC))

    labels.append(myAircraft.systems.id)
    fracs.append(myAircraft.systems.mSystems.getValue())
    colors.append(giveColorForNetworkx(systemsC))

    labels.append(myAircraft.landingGear.id)
    fracs.append(myAircraft.landingGear.mLandingGear.getValue())
    colors.append(giveColorForNetworkx(landingGearC))

    labels.append('oIM')
    fracs.append(myAircraft.oIM.getValue())
    colors.append(giveColorForNetworkx(aircraftC))

    explode=[0.05]*len(labels)
    myPie = pie(fracs, explode=explode,labels=labels,  colors=colors, autopct='%1.1f%%', shadow=True)
    legends = []
    for i in range(len(fracs)):
        out = '%-10s= %.2f[kg]'%(labels[i],fracs[i])
        legends.append(out)  
    
    ax.legend(myPie[0],legends,shadow = True)
    saveFigure('OEM Breakdown')
    close(fig)
Exemple #4
0
def plotCOC(myAircraft):
    # make a square figure and axes
    fig         = figure(figsize=(15,15))
    ax          = axes([0.1, 0.1, 0.8, 0.8])
    
    labels      = []
    fracs       = []
    colors      = []
    
    #===========================================================================
    # COC
    #===========================================================================
    labels.append('costCrew')
    fracs.append(myAircraft.costCrew.getValue())
    colors.append(giveColorForNetworkx(wingC))

    labels.append('costFuel')
    fracs.append(myAircraft.costFuel.getValue())
    colors.append(giveColorForNetworkx(fuselageC))
    
    labels.append('costMaintenance')
    fracs.append(myAircraft.costMaintenance.getValue())
    colors.append(giveColorForNetworkx(htpC))

    labels.append('costNavigation')
    fracs.append(myAircraft.costNavigation.getValue())
    colors.append(giveColorForNetworkx(engineC))

    labels.append('costLanding')
    fracs.append(myAircraft.costLanding.getValue())
    colors.append(giveColorForNetworkx(vtpC))

    labels.append('costGround')
    fracs.append(myAircraft.costGround.getValue())
    colors.append(giveColorForNetworkx(fuelC))

    #===========================================================================
    # Plot
    #===========================================================================
    explode=[0.05]*len(labels)
    myPie = pie(fracs, explode=explode,labels=labels,colors=colors, autopct='%1.1f%%', shadow=True)
    
    legends = []
    for i in range(len(fracs)):
        out = '%-10s= %.2f[EU/bh]'%(labels[i],fracs[i])
        legends.append(out)  
    
    ax.legend(myPie[0],legends,shadow = True)
         
    saveFigure('COC Breakdown')
    close(fig)
Exemple #5
0
def plotConvergence(myAircraft):

    fig = figure(figsize=(15, 15))
    ax = axes()
    myAircraft.plotter(ax)
    #    leg = ax.legend(loc='upper right',frameon=False,ncol=5)
    #    for t in leg.get_texts():
    #        t.set_fontsize('xx-small')

    ax.tick_params(pad=10, labelsize='x-large')
    ax.set_xscale('log')
    ax.grid(True, which='both', ls='-')
    ylabel('rel. Change [-]', size='40')
    xlabel('Iteration [-]', size='40')
    saveFigure('Convergence')
    close(fig)
Exemple #6
0
def plotDrag(myAircraft):
    # make a square figure and axes
    fig = figure(figsize=(15, 15))
    ax = axes([0.1, 0.1, 0.8, 0.8])

    labels = []
    fracs = []
    colors = []

    labels.append(myAircraft.wing.id)
    fracs.append(myAircraft.wing.cD0c.getValue())
    colors.append(giveColorForNetworkx(wingC))

    labels.append(myAircraft.htp.id)
    fracs.append(myAircraft.htp.cD0c.getValue())
    colors.append(giveColorForNetworkx(htpC))

    labels.append(myAircraft.vtp.id)
    fracs.append(myAircraft.vtp.cD0c.getValue())
    colors.append(giveColorForNetworkx(vtpC))

    labels.append(myAircraft.fuselage.id)
    fracs.append(myAircraft.fuselage.cD0c.getValue())
    colors.append(giveColorForNetworkx(fuselageC))

    labels.append(myAircraft.engine.id)
    fracs.append(myAircraft.engine.cD0c.getValue())
    colors.append(giveColorForNetworkx(engineC))

    explode = [0.05] * len(labels)

    myPie = pie(fracs,
                explode=explode,
                labels=labels,
                colors=colors,
                autopct='%1.1f%%',
                shadow=True)

    legends = []
    for i in range(len(fracs)):
        out = '%-10s= %.2f' % (labels[i], fracs[i])
        legends.append(out)

    ax.legend(myPie[0], legends, shadow=True)

    saveFigure('Component Drag')
    close(fig)
Exemple #7
0
def plotDrag(myAircraft):
    # make a square figure and axes
    fig         = figure(figsize=(15,15))
    ax          = axes([0.1, 0.1, 0.8, 0.8])
    
    labels      = []
    fracs       = []
    colors      = []
    
    labels.append(myAircraft.wing.id)
    fracs.append(myAircraft.wing.cD0c.getValue())
    colors.append(giveColorForNetworkx(wingC))


    labels.append(myAircraft.htp.id)
    fracs.append(myAircraft.htp.cD0c.getValue())
    colors.append(giveColorForNetworkx(htpC))


    labels.append(myAircraft.vtp.id)
    fracs.append(myAircraft.vtp.cD0c.getValue())
    colors.append(giveColorForNetworkx(vtpC))
    
    labels.append(myAircraft.fuselage.id)
    fracs.append(myAircraft.fuselage.cD0c.getValue())
    colors.append(giveColorForNetworkx(fuselageC))

    
    labels.append(myAircraft.engine.id)
    fracs.append(myAircraft.engine.cD0c.getValue())
    colors.append(giveColorForNetworkx(engineC))

    
    explode=[0.05]*len(labels)
    
    
    myPie = pie(fracs, explode=explode,labels=labels,colors=colors, autopct='%1.1f%%', shadow=True)
    
    legends = []
    for i in range(len(fracs)):
        out = '%-10s= %.2f'%(labels[i],fracs[i])
        legends.append(out)  
    
    ax.legend(myPie[0],legends,shadow = True)
    
    saveFigure('Component Drag')
    close(fig)
def plotConvergence(myAircraft):
                
    fig = figure(figsize=(15,15))
    ax  = axes()
    myAircraft.plotter(ax)
#    leg = ax.legend(loc='upper right',frameon=False,ncol=5)
#    for t in leg.get_texts():
#        t.set_fontsize('xx-small')

    
    ax.tick_params(pad=10,labelsize='x-large')
    ax.set_xscale('log')
    ax.grid(True, which='both', ls='-')
    ylabel('rel. Change [-]',size='40')        
    xlabel('Iteration [-]',size='40')
    saveFigure('Convergence')
    close(fig) 
Exemple #9
0
def plotMFUEL(myAircraft):
    # make a square figure and axes
    fig = figure(figsize=(15, 15))
    ax = axes([0.1, 0.1, 0.8, 0.8])

    labels = []
    fracs = []
    colors = []

    labels.append('mFuelCR')
    fracs.append(myAircraft.fuel.mFuelCR.getValue())
    colors.append(giveColorForNetworkx(fuelC))

    labels.append('mFuelCLIMB')
    fracs.append(myAircraft.fuel.mFuelCLIMB.getValue())
    colors.append(giveColorForNetworkx(wingC))

    labels.append('mFuelDESCENT')
    fracs.append(myAircraft.fuel.mFuelDESCENT.getValue())
    colors.append(giveColorForNetworkx(aircraftC))

    labels.append('mFuelTO')
    fracs.append(myAircraft.fuel.mFuelTO.getValue())
    colors.append(giveColorForNetworkx(payloadC))

    labels.append('mFuelRES')
    fracs.append(myAircraft.fuel.mFuelRES.getValue())
    colors.append(giveColorForNetworkx(engineC))

    explode = [0.05] * len(labels)
    myPie = pie(fracs,
                explode=explode,
                labels=labels,
                colors=colors,
                autopct='%1.1f%%',
                shadow=True)
    legends = []
    for i in range(len(fracs)):
        out = '%-10s= %.2f[kg]' % (labels[i], fracs[i])
        legends.append(out)

    ax.legend(myPie[0], legends, shadow=True)
    saveFigure('mFUEL Breakdown')
    close(fig)
Exemple #10
0
def plotMFUEL(myAircraft):
    # make a square figure and axes
    fig         = figure(figsize=(15,15))
    ax          = axes([0.1, 0.1, 0.8, 0.8])
    
    labels      = []
    fracs       = []
    colors      = []
    

    labels.append('mFuelCR')
    fracs.append(myAircraft.fuel.mFuelCR.getValue())
    colors.append(giveColorForNetworkx(fuelC))

    labels.append('mFuelCLIMB')
    fracs.append(myAircraft.fuel.mFuelCLIMB.getValue())
    colors.append(giveColorForNetworkx(wingC))

    labels.append('mFuelDESCENT')
    fracs.append(myAircraft.fuel.mFuelDESCENT.getValue())
    colors.append(giveColorForNetworkx(aircraftC))
    
    labels.append('mFuelTO')
    fracs.append(myAircraft.fuel.mFuelTO.getValue())
    colors.append(giveColorForNetworkx(payloadC))

    labels.append('mFuelRES')
    fracs.append(myAircraft.fuel.mFuelRES.getValue())
    colors.append(giveColorForNetworkx(engineC))

    explode=[0.05]*len(labels)
    myPie = pie(fracs, explode=explode,labels=labels,colors=colors, autopct='%1.1f%%', shadow=True)
    legends = []
    for i in range(len(fracs)):
        out = '%-10s= %.2f[kg]'%(labels[i],fracs[i])
        legends.append(out)  
    
    ax.legend(myPie[0],legends,shadow = True)
    saveFigure('mFUEL Breakdown')
    close(fig)
Exemple #11
0
def plotGeometry(myAircraft):

    fig         = figure(figsize=(15,15))
    ax          = Axes3D(fig)
        
    ax          = plotWingGeom(ax, myAircraft.wing,wingC)
    ax          = plotWingGeom(ax, myAircraft.htp,htpC)
    ax          = plotCoG(ax, myAircraft,engineC)
    #note: this is a high level representation of the wings geometry
    #ax          = plotWingHighGeom(ax, myAircraft.wing,fuelC)
    ax          = plotVtpGeom(ax, myAircraft.vtp,vtpC)
    ax          = plotFuselageGeom(ax, myAircraft.fuselage,fuselageC)
    ax          = plotEngineGeom(ax,myAircraft.engine,engineC)
    
    ax.set_xlim3d(0,myAircraft.fuselage.lfus.getValue()+2)
    ax.set_ylim3d(0,myAircraft.fuselage.lfus.getValue()+2)
    ax.set_zlim3d(0,myAircraft.fuselage.lfus.getValue()+2)
    ax.set_aspect('equal')

    leg = ax.legend(loc='right')
    for t in leg.get_texts():
        t.set_fontsize('small')  

    
    ax.view_init(elev=90.,azim=0.)
    saveFigure('aircraftGeomTop',True)

    ax.view_init(elev=0.,azim=90.)
    saveFigure('aircraftGeomSide',True)

    ax.set_xlim3d(0,myAircraft.wing.span.getValue()/2.+2)
    ax.set_ylim3d(0,myAircraft.wing.span.getValue()/2.+2)
    ax.set_zlim3d(0,myAircraft.wing.span.getValue()/2.+2)

    ax.view_init(elev=0.,azim=180.)
    saveFigure('aircraftGeomFront',True)
    close(fig)
    
    

    

    
    
Exemple #12
0
def plotDOC(myAircraft):
    # make a square figure and axes
    fig = figure(figsize=(15, 15))
    ax = axes([0.1, 0.1, 0.8, 0.8])

    labels = []
    fracs = []
    colors = []
    '''
    #===========================================================================
    # COC
    #===========================================================================
    labels.append('costCrew')
    fracs.append(myAircraft.costCrew.getValue())
    colors.append(giveColorForNetworkx(wingC))

    labels.append('costFuel')
    fracs.append(myAircraft.costFuel.getValue())
    colors.append(giveColorForNetworkx(wingC))
    
    labels.append('costMaintenance')
    fracs.append(myAircraft.costMaintenance.getValue())
    colors.append(giveColorForNetworkx(wingC))

    labels.append('costNavigation')
    fracs.append(myAircraft.costNavigation.getValue())
    colors.append(giveColorForNetworkx(wingC))

    labels.append('costLanding')
    fracs.append(myAircraft.costLanding.getValue())
    colors.append(giveColorForNetworkx(wingC))

    labels.append('costGround')
    fracs.append(myAircraft.costGround.getValue())
    colors.append(giveColorForNetworkx(wingC))

    #===========================================================================
    # COO
    #===========================================================================
    labels.append('costDepreciation')
    fracs.append(myAircraft.costDepreciation.getValue())
    colors.append(giveColorForNetworkx(aircraftC))

    labels.append('costInterest')
    fracs.append(myAircraft.costInterest.getValue())
    colors.append(giveColorForNetworkx(aircraftC))

    labels.append('costInsurance')
    fracs.append(myAircraft.costInsurance.getValue())
    colors.append(giveColorForNetworkx(aircraftC))
    '''
    #===========================================================================
    # TU Berlin DOC method
    #===========================================================================

    # C1 = costCrew + CostCap

    labels.append('costCrew')
    fracs.append(myAircraft.costCrew.getValue())
    colors.append(giveColorForNetworkx(wingC))

    labels.append('costCap')
    fracs.append(myAircraft.costCap.getValue())
    colors.append(giveColorForNetworkx(wingC))

    # C2 = costFuel + costLanding + costGround + costNavigation + costMaintenance

    labels.append('costFuel')
    fracs.append(myAircraft.costFuel.getValue())
    colors.append(giveColorForNetworkx(aircraftC))

    labels.append('costLanding')
    fracs.append(myAircraft.costLanding.getValue())
    colors.append(giveColorForNetworkx(aircraftC))

    labels.append('costGround')
    fracs.append(myAircraft.costGround.getValue())
    colors.append(giveColorForNetworkx(aircraftC))

    labels.append('costNavigation')
    fracs.append(myAircraft.costNavigation.getValue())
    colors.append(giveColorForNetworkx(aircraftC))

    labels.append('costMaintenance')
    fracs.append(myAircraft.costMaintenance.getValue())
    colors.append(giveColorForNetworkx(aircraftC))

    #===========================================================================
    # Plot
    #===========================================================================
    explode = [0.05] * len(labels)
    myPie = pie(fracs,
                explode=explode,
                labels=labels,
                colors=colors,
                autopct='%1.1f%%',
                shadow=True)

    legends = []
    for i in range(len(fracs)):
        out = '%-10s= %.2f[EU/bh]' % (labels[i], fracs[i])
        legends.append(out)

    ax.legend(myPie[0], legends, shadow=True)

    saveFigure('DOC Breakdown')
    close(fig)
Exemple #13
0
def plotDOC(myAircraft):
    # make a square figure and axes
    fig         = figure(figsize=(15,15))
    ax          = axes([0.1,0.1,0.8,0.8])
   
    labels      = []
    fracs       = []
    colors      = []
    '''
    #===========================================================================
    # COC
    #===========================================================================
    labels.append('costCrew')
    fracs.append(myAircraft.costCrew.getValue())
    colors.append(giveColorForNetworkx(wingC))

    labels.append('costFuel')
    fracs.append(myAircraft.costFuel.getValue())
    colors.append(giveColorForNetworkx(wingC))
    
    labels.append('costMaintenance')
    fracs.append(myAircraft.costMaintenance.getValue())
    colors.append(giveColorForNetworkx(wingC))

    labels.append('costNavigation')
    fracs.append(myAircraft.costNavigation.getValue())
    colors.append(giveColorForNetworkx(wingC))

    labels.append('costLanding')
    fracs.append(myAircraft.costLanding.getValue())
    colors.append(giveColorForNetworkx(wingC))

    labels.append('costGround')
    fracs.append(myAircraft.costGround.getValue())
    colors.append(giveColorForNetworkx(wingC))

    #===========================================================================
    # COO
    #===========================================================================
    labels.append('costDepreciation')
    fracs.append(myAircraft.costDepreciation.getValue())
    colors.append(giveColorForNetworkx(aircraftC))

    labels.append('costInterest')
    fracs.append(myAircraft.costInterest.getValue())
    colors.append(giveColorForNetworkx(aircraftC))

    labels.append('costInsurance')
    fracs.append(myAircraft.costInsurance.getValue())
    colors.append(giveColorForNetworkx(aircraftC))
    '''
    #===========================================================================
    # TU Berlin DOC method
    #===========================================================================
    
    # C1 = costCrew + CostCap
    
    labels.append('costCrew')
    fracs.append(myAircraft.costCrew.getValue())
    colors.append(giveColorForNetworkx(wingC)) 

    labels.append('costCap')
    fracs.append(myAircraft.costCap.getValue())
    colors.append(giveColorForNetworkx(wingC))
    
    # C2 = costFuel + costLanding + costGround + costNavigation + costMaintenance
    
    labels.append('costFuel')
    fracs.append(myAircraft.costFuel.getValue())
    colors.append(giveColorForNetworkx(aircraftC))
    
    labels.append('costLanding')
    fracs.append(myAircraft.costLanding.getValue())
    colors.append(giveColorForNetworkx(aircraftC))

    labels.append('costGround')
    fracs.append(myAircraft.costGround.getValue())
    colors.append(giveColorForNetworkx(aircraftC))

    labels.append('costNavigation')
    fracs.append(myAircraft.costNavigation.getValue())
    colors.append(giveColorForNetworkx(aircraftC))
    
    labels.append('costMaintenance')
    fracs.append(myAircraft.costMaintenance.getValue())
    colors.append(giveColorForNetworkx(aircraftC))
    
    #===========================================================================
    # Plot
    #===========================================================================
    explode=[0.05]*len(labels)
    myPie = pie(fracs, explode=explode,labels=labels,colors=colors, autopct='%1.1f%%', shadow=True)
    
    legends = []
    for i in range(len(fracs)):
        out = '%-10s= %.2f[EU/bh]'%(labels[i],fracs[i])
        legends.append(out)  
    
    ax.legend(myPie[0],legends,shadow = True)
         
    saveFigure('DOC Breakdown')
    close(fig)