Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atmospheric model dependent upon applied pressures #52

Open
mjburton11 opened this issue Mar 14, 2016 · 6 comments
Open

Atmospheric model dependent upon applied pressures #52

mjburton11 opened this issue Mar 14, 2016 · 6 comments

Comments

@mjburton11
Copy link

@whoburg and @pgkirsch, we were getting some funny density readings (0.3 kg/m^3 @ 15000 ft) from this model. I think it was because T_atm can be lower than than its supposed to be and rho wanted to be lower to lower the weight.

        #----------------------------------------------------
        # Atmosphere model  
        gamma = Variable(r'\gamma', 1.4, '-', 'Heat capacity ratio of air')               
        p_sl = Variable('p_{sl}', 101325, 'Pa', 'Pressure at sea level')                  
        T_sl = Variable('T_{sl}', 288.15, 'K', 'Temperature at sea level')                
        L_atm = Variable('L_{atm}', 0.0065, 'K/m', 'Temperature lapse rate')              
        T_atm = VectorVariable(NSeg, 'T_{atm}', 'K', 'Air temperature')                   
        a_atm = VectorVariable(NSeg, 'a_{atm}', 'm/s', 'Speed of sound at altitude')      
        R_spec = Variable('R_{spec}', 287.058, 'J/kg/K', 'Specific gas constant of air')  
        TH = (g/R_spec/L_atm).value.magnitude  # dimensionless

        constraints.extend([T_sl >= T_atm + L_atm*h,     # Temp decreases w/ altitude     
                            rho == p_sl*T_atm**(TH-1)/R_spec/(T_sl**TH)])                 
            # http://en.wikipedia.org/wiki/Density_of_air#Altitude

Output

         \rho : [ 0.326     0.361     0.334     0.435    ... ]  [kg/m**3]   air density                       
            h : [ 5e+03     6.94e+03  5e+03     1.5e+04  ... ]  [ft]        Altitude   
      T_{atm} : [ 211       216       212       226      ... ]  [K]         Air temperature                   
@pgkirsch
Copy link

Yeah that model is not particularly robust -- it seems to be dependent on the objective function. Trying to fix this at some point in the not-too-distant future.

@mjburton11
Copy link
Author

Oh ok. Didn't realize you were already aware of this.

@bqpd
Copy link
Contributor

bqpd commented Mar 16, 2016

Should that model have rho <= ... just to make this weakness clearer?

@whoburg
Copy link
Collaborator

whoburg commented Mar 16, 2016

sounds good to me

@mjburton11
Copy link
Author

Interesting... this actually fixed the density except during the first cruise portion. Now if you compare h to rho you actually get meaning values except during the cruise portion (2nd leg).

\rho : [ 1.06      0.279     0.771     0.771    ... ]  [kg/m**3]   air density                       
   h : [ 5e+03     5e+03     1.5e+04   1.5e+04  ... ]  [ft]        altitude                          

@whoburg whoburg changed the title Atmospheric model inaccuracies Atmospheric model dependent upon applied pressures Mar 25, 2016
@whoburg
Copy link
Collaborator

whoburg commented Mar 25, 2016

The underlying issue is that the atmospheric model constraints need to hold with equality, and we want to relax those equalities into inequalities, but the correct relaxation depends on applied pressures external to the atmosphere model.

Let's leave this open in hopes of coming up with better ways of dealing with these posynomial/signomial equality constraints. One approach is to try to derive the correct relaxation prior to solving. Another is to implement a real signomial equality algorithm with trust regions. I think the latter might make sense for atmosphere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants