From 90bf3f9eff40d492e3d6b1abf7def15b217f9796 Mon Sep 17 00:00:00 2001 From: Vivien Date: Fri, 5 Jul 2019 11:54:36 +0200 Subject: [PATCH 01/37] =?UTF-8?q?d=C3=A9placement=20des=20constantes=20hor?= =?UTF-8?q?s=20des=20fonctions=20et=20debut=20d'autotest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Engineering_tools.py | 196 ++++++++++++++++++++++++++----------------- 1 file changed, 118 insertions(+), 78 deletions(-) diff --git a/Engineering_tools.py b/Engineering_tools.py index 21d3397..a3f38ae 100755 --- a/Engineering_tools.py +++ b/Engineering_tools.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# - * - coding: utf-8 - * - """ Created on Sun May 12 20:08:52 2019 @@ -7,16 +7,25 @@ Created on Sun May 12 20:08:52 2019 import numpy as np from numpy import linalg as LA - + + +# Constants +T_SIDE = 86164.10 # sidereal day (s) +R_T = 6378e3 # earth radius (m) + +MU = 3.9860e14 # earth standard gravitational parameter (=G * M_earth) (m3.s-2) +R_T = 6378e3 # earth radius (m) +G0 = 9.81 # standard gravity (m.s-2) +R = 287 # specific gas constant (J.Kg-1.K-1) + + def initial_vel(latitude,retrograde=False): """ Initial velocity (m.s-1) depending on the launch point latitude (°) """ - T_side = 86164.10 # sidereal day (s) - R_T = 6378e3 # earth raduis (m) - initial_velocity = (2*np.pi/T_side)*R_T*np.cos(np.deg2rad(np.abs(latitude))) + initial_velocity = (2 * np.pi / T_SIDE) * R_T * np.cos(np.deg2rad(np.abs(latitude))) if retrograde: return -initial_velocity else: @@ -31,10 +40,7 @@ def final_target_vel(h, a): orbit absolute injection velocity (m.s-1) """ - mu = 3.9860e14 # earth standard gravitatinal parameter (=G*M_earth) (m3.s-2) - R_T = 6378e3 # earth raduis (m) - - return np.sqrt(2*mu*((1/(R_T+h))-(1/(2*a)))) + return np.sqrt(2 * MU * ((1 / (R_T + h))-(1 / (2 * a)))) def staging_optim(isp1,isp2,eps1,eps2,Vc,Mp): """ @@ -51,9 +57,9 @@ def staging_optim(isp1,isp2,eps1,eps2,Vc,Mp): NB: structure mass structural coefficient = -------------------------------- - structure mass + propellant mass + structure mass + propellant mass - ctritical velocity = final velocity - initial velocity + losses + ctritical velocity = final velocity - initial velocity + losses """ # Notation : @@ -62,18 +68,17 @@ def staging_optim(isp1,isp2,eps1,eps2,Vc,Mp): # q1 = M1/Mt # q2 = M2/Mt # qp = Mp/Mt -# omega = qp + q2 +# omega = qp + q2 - g0 = 9.81 # standard gravity (m.s-2) omega_tab=np.linspace(0.001,0.9,100) # array of omega to test qp_tab=[] for omega in omega_tab: - q2 = omega+eps1*(1-omega) - q2 = np.power(q2,isp1/isp2)*np.exp(Vc/(g0*isp2)) - q2 = 1/q2 + q2 = omega + eps1 * (1-omega) + q2 = np.power(q2,isp1 / isp2) * np.exp(Vc / (G0 * isp2)) + q2 = 1 / q2 q2 = 1-q2 - q2 *= omega/(1-eps2) + q2 *= omega / (1-eps2) qp = omega-q2 qp_tab.append(qp) @@ -81,8 +86,8 @@ def staging_optim(isp1,isp2,eps1,eps2,Vc,Mp): omega=omega_tab[qp_tab.index(qp)] q2=omega-qp q1=1-q2-qp - M1=(Mp/qp)*q1 - M2=(Mp/qp)*q2 + M1=(Mp / qp) * q1 + M2=(Mp / qp) * q2 return M1, M2 @@ -97,11 +102,9 @@ def standard_atmosphere(altitude): density (Kg.m-3) """ - assert altitude < 84852 , str(altitude)+' is higher than max altitude of the ISA model' - - g0 = 9.81 # standard gravity (m.s-2) - r = 287 # specific gas constant (J.Kg-1.K-1) # ISA model + assert altitude < 84852 , str(altitude) + ' is higher than max altitude of the ISA model' + h0_tab = np.array([0, 11e3, 20e3, 32e3, 47e3, 51e3, 71e3, 84852]) # base altitude (m) a_tab = np.array([-6.5e-3, 0, 1e-3, 2.8e-3, 0, -2.8e-3, -2.0e-3]) # lapse rate (K.m-1) # the base properties of each range are tabulated to reduce computational cost @@ -109,24 +112,24 @@ def standard_atmosphere(altitude): P0_tab = np.array([101325, 22632, 5474.9, 868.02, 110.91, 66.939, 3.9564]) # base pressure (Pa) index = 0 - while altitude > h0_tab[index+1]: - index += 1 + while altitude > h0_tab[index + 1]: + index += 1 a = a_tab[index] T0 = T0_tab[index] P0 = P0_tab[index] - T = T0+a*(altitude-h0_tab[index]) # Toussaint equation + T = T0 + a * (altitude-h0_tab[index]) # Toussaint equation if T == T0 : # isohermal region - P = P0*np.exp(-g0*(altitude-h0_tab[index])/(r*T)) + P = P0 * np.exp(-G0 * (altitude-h0_tab[index]) / (R * T)) else : # gradient region - P = P0*np.power(T/T0,-g0/(a*r)) + P = P0 * np.power(T / T0,-G0 / (a * R)) - rho = P/(r*T) + rho = P / (R * T) return T,P,rho -def laval_nozzle(Pt,Tt,Pamb,Ath,Ae,gamma,r,tolerance=1e-5): +def laval_nozzle(Pt,Tt,Pamb,Ath,Ae,gamma,R,tolerance=1e-5): """ Compute the thrust assuming a started nozzle inputs: @@ -136,96 +139,95 @@ def laval_nozzle(Pt,Tt,Pamb,Ath,Ae,gamma,r,tolerance=1e-5): Ath : throat section area (m2) Ae : exit section area (m2) gamma : ratio of specific heats (adimentional) - r : specific gas constant (J.Kg-1.K-1) + R : specific gas constant (J.Kg-1.K-1) tolerance : outputs: Thrust (N) Specific impulse (s) - N.B : Thrust = mass flow rate * exit velocity + (exit pressure - ambiant pressure) * exit area + N.B : Thrust = mass flow rate * exit velocity + (exit pressure - ambiant pressure) * exit area """ assert gamma > 1, 'gamma must be > 1' - g0 = 9.81 # standard gravity (m.s-2) - A_ratio = lambda M,gamma: (1/M)*np.power((2/(gamma+1))*(1+((gamma-1)/2)*M*M),(gamma+1)/(2*gamma-2)) + A_ratio = lambda M,gamma: (1 / M) * np.power((2 / (gamma + 1)) * (1 + ((gamma-1) / 2) * M * M),(gamma + 1) / (2 * gamma-2)) # compute the nozzle exit section area corresponding to the adapted regime - Madapted = np.sqrt((2/(gamma-1))*(np.power(Pamb/Pt,(1-gamma)/gamma)-1)) - Aadapted = Ath*A_ratio(Madapted,gamma) + Madapted = np.sqrt((2 / (gamma-1)) * (np.power(Pamb / Pt,(1-gamma) / gamma)-1)) + Aadapted = Ath * A_ratio(Madapted,gamma) if Aadapted > Ae: # the nozzle is under-expanded # compute the exit Mach number iteratively using dichotomy algorithm - A_ratio_target = Ae/Ath + A_ratio_target = Ae / Ath Me_upper = Madapted Me_lower = 1 - Me = (Me_upper+Me_lower)/2 + Me = (Me_upper + Me_lower) / 2 error = A_ratio_target-A_ratio(Me,gamma) while np.abs(error) > tolerance: if error > 0: Me_lower = Me else: Me_upper = Me - Me = (Me_upper+Me_lower)/2 + Me = (Me_upper + Me_lower) / 2 error = A_ratio_target-A_ratio(Me,gamma) - Te = Tt/(1+((gamma-1)/2)*Me*Me) # exit static temperature - Pe = Pt*np.power(Tt/Te,gamma/(1-gamma)) # exit static pressure + Te = Tt / (1 + ((gamma-1) / 2) * Me * Me) # exit static temperature + Pe = Pt * np.power(Tt / Te,gamma / (1-gamma)) # exit static pressure elif Aadapted < Ae: # the nozzle is over-expanded Mshock = 1 step = 1 - A_ratio_target = Ae/Ath + A_ratio_target = Ae / Ath Me_upper = 1 Me_lower = 0 - Me = (Me_upper+Me_lower)/2 + Me = (Me_upper + Me_lower) / 2 error = A_ratio_target-A_ratio(Me,gamma) while np.abs(error) > tolerance: if error < 0: Me_lower = Me else: Me_upper = Me - Me = (Me_upper+Me_lower)/2 + Me = (Me_upper + Me_lower) / 2 error = A_ratio_target-A_ratio(Me,gamma) - Te = Tt/(1+((gamma-1)/2)*Me*Me) - Pe = Pt*np.power(Tt/Te,gamma/(1-gamma)) - while (Pe-Pamb)*1e-5 > tolerance: + Te = Tt / (1 + ((gamma-1) / 2) * Me * Me) + Pe = Pt * np.power(Tt / Te,gamma / (1-gamma)) + while (Pe-Pamb) * 1e-5 > tolerance: Mshock_old = Mshock - Mshock += step + Mshock += step Pe_old = Pe - Pt_ratio = np.power(((gamma+1)*Mshock*Mshock)/((gamma-1)*Mshock*Mshock+2),gamma/(gamma-1))*np.power((gamma+1)/(2*gamma*Mshock*Mshock-gamma+1),1/(gamma-1)) - Pi = Pt*Pt_ratio - Ai = Ath/Pt_ratio - A_ratio_target = Ae/Ai + Pt_ratio = np.power(((gamma + 1) * Mshock * Mshock) / ((gamma-1) * Mshock * Mshock + 2),gamma / (gamma-1)) * np.power((gamma + 1) / (2 * gamma * Mshock * Mshock-gamma + 1),1 / (gamma-1)) + Pi = Pt * Pt_ratio + Ai = Ath / Pt_ratio + A_ratio_target = Ae / Ai Me_upper = 1 Me_lower = 0 - Me = (Me_upper+Me_lower)/2 + Me = (Me_upper + Me_lower) / 2 error = A_ratio_target-A_ratio(Me,gamma) while np.abs(error) > tolerance: if error < 0: Me_lower = Me else: Me_upper = Me - Me = (Me_upper+Me_lower)/2 + Me = (Me_upper + Me_lower) / 2 error = A_ratio_target-A_ratio(Me,gamma) - Te = Tt/(1+((gamma-1)/2)*Me*Me) - Pe = Pi*np.power(Tt/Te,gamma/(1-gamma)) - if (Pe > Pamb) and (A_ratio(Mshock,gamma) > Ae/Ath): + Te = Tt / (1 + ((gamma-1) / 2) * Me * Me) + Pe = Pi * np.power(Tt / Te,gamma / (1-gamma)) + if (Pe > Pamb) and (A_ratio(Mshock,gamma) > Ae / Ath): # the normal shock is outside the divergent and all the flow inside is supersonic - A_ratio_target = Ae/Ath + A_ratio_target = Ae / Ath Me_upper = Mshock Me_lower = 1 - Me = (Me_upper+Me_lower)/2 + Me = (Me_upper + Me_lower) / 2 error = A_ratio_target-A_ratio(Me,gamma) while np.abs(error) > tolerance: if error > 0: Me_lower = Me else: Me_upper = Me - Me = (Me_upper+Me_lower)/2 + Me = (Me_upper + Me_lower) / 2 error = A_ratio_target-A_ratio(Me,gamma) - Te = Tt/(1+((gamma-1)/2)*Me*Me) # exit static temperature - Pe = Pt*np.power(Tt/Te,gamma/(1-gamma)) # exit static pressure + Te = Tt / (1 + ((gamma-1) / 2) * Me * Me) # exit static temperature + Pe = Pt * np.power(Tt / Te,gamma / (1-gamma)) # exit static pressure break if Pe < Pamb: Pe = Pe_old @@ -234,15 +236,15 @@ def laval_nozzle(Pt,Tt,Pamb,Ath,Ae,gamma,r,tolerance=1e-5): else: # the nozzle is adapted Me = Madapted - Te = Tt/(1+((gamma-1)/2)*Me*Me) # exit static temperature + Te = Tt / (1 + ((gamma-1) / 2) * Me * Me) # exit static temperature Pe = Pamb - Ve = Me*np.sqrt(gamma*r*Te) # exit velocity + Ve = Me * np.sqrt(gamma * R * Te) # exit velocity # maximum mass flow rate in the case of a started nozzle - Q = np.power(2/(gamma+1),(gamma+1)/(2*(gamma-1)))*np.sqrt(gamma/(Tt*r))*Pt*Ath - Thrust = Q*Ve+(Pe-Pamb)*Ae - isp = Thrust/(Q*g0) + Q = np.power(2 / (gamma + 1),(gamma + 1) / (2 * (gamma-1))) * np.sqrt(gamma / (Tt * R)) * Pt * Ath + Thrust = Q * Ve + (Pe-Pamb) * Ae + isp = Thrust / (Q * G0) return Thrust,isp @@ -292,7 +294,6 @@ def state_to_orbital_elem(r,v): orbel={'a':0,'e':0,'i':0,'capital_omega':0,'small_omega':0,'nu':0} - mu = 3.9860e14 # earth standard gravitatinal parameter (=G*M_earth) (m3.s-2) small = 1e-10 h = np.cross(r,v) # angular momentum @@ -308,19 +309,19 @@ def state_to_orbital_elem(r,v): n = np.array([1,0,0]) nm = 0 else: - n = n/nm + n = n / nm nm = 1 dotrv = np.dot(r,v) - e = ((vm*vm-mu/rm)*r-dotrv*v)/mu + e = ((vm * vm-MU / rm) * r-dotrv * v) / MU em = LA.norm(e) if em < small: e = n em = 0 else: - e = e/em + e = e / em orbel['e'] = em - orbel['a'] = (hm*hm/mu)/(1-em*em) - aux = h[2]/hm + orbel['a'] = (hm * hm / MU) / (1-em * em) + aux = h[2] / hm if np.abs(aux) > 1: aux = np.sign(aux) # all the angles are first computed in rad orbel['i'] = np.arccos(aux) @@ -328,20 +329,20 @@ def state_to_orbital_elem(r,v): aux = n[0] if np.abs(aux) > 1: aux = np.sign(aux) orbel['capital_omega'] = np.arccos(aux) - if n[1] < 0: orbel['capital_omega'] = 2*np.pi-orbel['capital_omega'] + if n[1] < 0: orbel['capital_omega'] = 2 * np.pi-orbel['capital_omega'] if em > small: aux = np.dot(e,n) if np.abs(aux) > 1: aux = np.sign(aux) orbel['small_omega'] = np.arccos(aux) - if e[2] < 0: orbel['small_omega'] = 2*np.pi-orbel['small_omega'] - aux = np.dot(e,r)/rm + if e[2] < 0: orbel['small_omega'] = 2 * np.pi-orbel['small_omega'] + aux = np.dot(e,r) / rm if np.abs(aux) > 1: aux = np.sign(aux) orbel['nu'] = np.arccos(aux) if em > small: - if dotrv < 0: orbel['nu'] = 2*np.pi-orbel['nu'] + if dotrv < 0: orbel['nu'] = 2 * np.pi-orbel['nu'] else: ha = np.cross(e,r) - if np.dot(h,ha) < 0: orbel['nu'] = 2*np.pi-orbel['nu'] + if np.dot(h,ha) < 0: orbel['nu'] = 2 * np.pi-orbel['nu'] # convert the angles to deg orbel['i'] = np.rad2deg(orbel['i']) orbel['capital_omega'] = np.rad2deg(orbel['capital_omega']) @@ -393,3 +394,42 @@ def ox_rich_staged_combust(): def full_flow_staged_combust(): """ """ + + +if __name__ == "__main__": + + import unittest + + + + # Basic auto test + + print('initial_vel') + latitude = 30 + v_velocity = initial_vel(latitude) + print('{0}({1}) = {2} '.format(initial_vel.__name__, latitude,v_velocity)) + print('') + + print('final_target_vel') + v_eject_altitude = 100 + v_orbit_semi_major_axis = 100 + try: + v_f_velocity = final_target_vel(v_eject_altitude,v_orbit_semi_major_axis) + print('{0}({1},{2}) = {3} '.format(final_target_vel.__name__, v_eject_altitude,v_orbit_semi_major_axis ,v_velocity)) + except Exception as e: + print(e) + print('') + + print('staging_optim') + v_isp1 = 300 + v_isp2 = 300 + v_eps1 = 0.8 + v_eps2 = 0.7 + v_Vc = 100 + v_Mp = 3000 + try: + v_m1, v_m2 = staging_optim(v_isp1,v_isp2,v_eps1,v_eps2,v_Vc,v_Mp) + print('{0:.2f}, {1:.2f} = {2}({3}, {4}, {5}, {6}, {7}, {8})'.format(v_m1, v_m2, staging_optim.__name__,v_isp1,v_isp2,v_eps1,v_eps2,v_Vc,v_Mp)) + except Exception as e: + print(e) + \ No newline at end of file -- GitLab From 533a4ff93ecdb5ccd7e558b2abdcba53437cee0a Mon Sep 17 00:00:00 2001 From: Vivien Date: Fri, 5 Jul 2019 15:19:11 +0200 Subject: [PATCH 02/37] ajout du job test et d'un script de test de Engineering tools --- .gitlab-ci.yml | 12 +++++ Engineering_tools.py | 109 +++++++++++++++++++++++--------------- Test_Engineering_tools.py | 37 +++++++++++++ 3 files changed, 116 insertions(+), 42 deletions(-) create mode 100644 Test_Engineering_tools.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9356cb1..792d9fd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,10 @@ stages: - build - test + + + + job_build: before_script: - echo "deb http://ftp.debian.org/debian jessie main" > /etc/apt/sources.list @@ -21,3 +25,11 @@ job_build: script: - echo "build" - ./etagement.py + + +job_test: + + stage: test + script: + - echo "test" + - ./Test_Engineering_tools.py \ No newline at end of file diff --git a/Engineering_tools.py b/Engineering_tools.py index a3f38ae..699f20f 100755 --- a/Engineering_tools.py +++ b/Engineering_tools.py @@ -39,8 +39,10 @@ def final_target_vel(h, a): output: orbit absolute injection velocity (m.s-1) """ - - return np.sqrt(2 * MU * ((1 / (R_T + h))-(1 / (2 * a)))) + + v_square = 2 * MU * ((1 / (R_T + h)) - (1 / (2 * a))) + assert v_square >= 0, 'error: square root only on positiv values' + return np.sqrt(v_square) def staging_optim(isp1,isp2,eps1,eps2,Vc,Mp): """ @@ -74,18 +76,18 @@ def staging_optim(isp1,isp2,eps1,eps2,Vc,Mp): omega_tab=np.linspace(0.001,0.9,100) # array of omega to test qp_tab=[] for omega in omega_tab: - q2 = omega + eps1 * (1-omega) + q2 = omega + eps1 * (1 - omega) q2 = np.power(q2,isp1 / isp2) * np.exp(Vc / (G0 * isp2)) q2 = 1 / q2 - q2 = 1-q2 - q2 *= omega / (1-eps2) - qp = omega-q2 + q2 = 1 - q2 + q2 *= omega / (1 - eps2) + qp = omega - q2 qp_tab.append(qp) qp=max(qp_tab) omega=omega_tab[qp_tab.index(qp)] - q2=omega-qp - q1=1-q2-qp + q2=omega - qp + q1=1 - q2 - qp M1=(Mp / qp) * q1 M2=(Mp / qp) * q2 @@ -118,12 +120,12 @@ def standard_atmosphere(altitude): a = a_tab[index] T0 = T0_tab[index] P0 = P0_tab[index] - T = T0 + a * (altitude-h0_tab[index]) # Toussaint equation + T = T0 + a * (altitude - h0_tab[index]) # Toussaint equation if T == T0 : # isohermal region - P = P0 * np.exp(-G0 * (altitude-h0_tab[index]) / (R * T)) + P = P0 * np.exp(-G0 * (altitude - h0_tab[index]) / (R * T)) else : # gradient region - P = P0 * np.power(T / T0,-G0 / (a * R)) + P = P0 * np.power(T/T0, -G0/(a*R)) rho = P / (R * T) @@ -151,10 +153,10 @@ def laval_nozzle(Pt,Tt,Pamb,Ath,Ae,gamma,R,tolerance=1e-5): assert gamma > 1, 'gamma must be > 1' - A_ratio = lambda M,gamma: (1 / M) * np.power((2 / (gamma + 1)) * (1 + ((gamma-1) / 2) * M * M),(gamma + 1) / (2 * gamma-2)) - + A_ratio = lambda M,gamma: (1 / M) * np.power((2 / (gamma + 1)) * (1 + ((gamma - 1) / 2) * M * M), (gamma + 1) / (2 * gamma - 2)) + # compute the nozzle exit section area corresponding to the adapted regime - Madapted = np.sqrt((2 / (gamma-1)) * (np.power(Pamb / Pt,(1-gamma) / gamma)-1)) + Madapted = np.sqrt((2 / (gamma - 1)) * (np.power(Pamb / Pt,(1 - gamma) / gamma) - 1)) Aadapted = Ath * A_ratio(Madapted,gamma) if Aadapted > Ae: # the nozzle is under-expanded @@ -163,16 +165,16 @@ def laval_nozzle(Pt,Tt,Pamb,Ath,Ae,gamma,R,tolerance=1e-5): Me_upper = Madapted Me_lower = 1 Me = (Me_upper + Me_lower) / 2 - error = A_ratio_target-A_ratio(Me,gamma) + error = A_ratio_target - A_ratio(Me,gamma) while np.abs(error) > tolerance: if error > 0: Me_lower = Me else: Me_upper = Me Me = (Me_upper + Me_lower) / 2 - error = A_ratio_target-A_ratio(Me,gamma) - Te = Tt / (1 + ((gamma-1) / 2) * Me * Me) # exit static temperature - Pe = Pt * np.power(Tt / Te,gamma / (1-gamma)) # exit static pressure + error = A_ratio_target - A_ratio(Me,gamma) + Te = Tt / (1 + ((gamma - 1) / 2) * Me * Me) # exit static temperature + Pe = Pt * np.power(Tt / Te,gamma / (1 - gamma)) # exit static pressure elif Aadapted < Ae: # the nozzle is over-expanded Mshock = 1 @@ -181,53 +183,53 @@ def laval_nozzle(Pt,Tt,Pamb,Ath,Ae,gamma,R,tolerance=1e-5): Me_upper = 1 Me_lower = 0 Me = (Me_upper + Me_lower) / 2 - error = A_ratio_target-A_ratio(Me,gamma) + error = A_ratio_target - A_ratio(Me,gamma) while np.abs(error) > tolerance: if error < 0: Me_lower = Me else: Me_upper = Me Me = (Me_upper + Me_lower) / 2 - error = A_ratio_target-A_ratio(Me,gamma) - Te = Tt / (1 + ((gamma-1) / 2) * Me * Me) - Pe = Pt * np.power(Tt / Te,gamma / (1-gamma)) - while (Pe-Pamb) * 1e-5 > tolerance: + error = A_ratio_target - A_ratio(Me,gamma) + Te = Tt / (1 + ((gamma - 1) / 2) * Me * Me) + Pe = Pt * np.power(Tt / Te,gamma / (1 - gamma)) + while (Pe - Pamb) * 1e-5 > tolerance: Mshock_old = Mshock Mshock += step Pe_old = Pe - Pt_ratio = np.power(((gamma + 1) * Mshock * Mshock) / ((gamma-1) * Mshock * Mshock + 2),gamma / (gamma-1)) * np.power((gamma + 1) / (2 * gamma * Mshock * Mshock-gamma + 1),1 / (gamma-1)) + Pt_ratio = np.power(((gamma + 1) * Mshock * Mshock) / ((gamma - 1) * Mshock * Mshock + 2),gamma / (gamma - 1)) * np.power((gamma + 1) / (2 * gamma * Mshock * Mshock - gamma + 1),1 / (gamma - 1)) Pi = Pt * Pt_ratio Ai = Ath / Pt_ratio A_ratio_target = Ae / Ai Me_upper = 1 Me_lower = 0 Me = (Me_upper + Me_lower) / 2 - error = A_ratio_target-A_ratio(Me,gamma) + error = A_ratio_target - A_ratio(Me,gamma) while np.abs(error) > tolerance: if error < 0: Me_lower = Me else: Me_upper = Me Me = (Me_upper + Me_lower) / 2 - error = A_ratio_target-A_ratio(Me,gamma) - Te = Tt / (1 + ((gamma-1) / 2) * Me * Me) - Pe = Pi * np.power(Tt / Te,gamma / (1-gamma)) + error = A_ratio_target - A_ratio(Me,gamma) + Te = Tt / (1 + ((gamma - 1) / 2) * Me * Me) + Pe = Pi * np.power(Tt / Te,gamma / (1 - gamma)) if (Pe > Pamb) and (A_ratio(Mshock,gamma) > Ae / Ath): # the normal shock is outside the divergent and all the flow inside is supersonic A_ratio_target = Ae / Ath Me_upper = Mshock Me_lower = 1 Me = (Me_upper + Me_lower) / 2 - error = A_ratio_target-A_ratio(Me,gamma) + error = A_ratio_target - A_ratio(Me,gamma) while np.abs(error) > tolerance: if error > 0: Me_lower = Me else: Me_upper = Me Me = (Me_upper + Me_lower) / 2 - error = A_ratio_target-A_ratio(Me,gamma) - Te = Tt / (1 + ((gamma-1) / 2) * Me * Me) # exit static temperature - Pe = Pt * np.power(Tt / Te,gamma / (1-gamma)) # exit static pressure + error = A_ratio_target - A_ratio(Me,gamma) + Te = Tt / (1 + ((gamma - 1) / 2) * Me * Me) # exit static temperature + Pe = Pt * np.power(Tt / Te,gamma / (1 - gamma)) # exit static pressure break if Pe < Pamb: Pe = Pe_old @@ -236,14 +238,14 @@ def laval_nozzle(Pt,Tt,Pamb,Ath,Ae,gamma,R,tolerance=1e-5): else: # the nozzle is adapted Me = Madapted - Te = Tt / (1 + ((gamma-1) / 2) * Me * Me) # exit static temperature + Te = Tt / (1 + ((gamma - 1) / 2) * Me * Me) # exit static temperature Pe = Pamb Ve = Me * np.sqrt(gamma * R * Te) # exit velocity # maximum mass flow rate in the case of a started nozzle - Q = np.power(2 / (gamma + 1),(gamma + 1) / (2 * (gamma-1))) * np.sqrt(gamma / (Tt * R)) * Pt * Ath - Thrust = Q * Ve + (Pe-Pamb) * Ae + Q = np.power(2 / (gamma + 1),(gamma + 1) / (2 * (gamma - 1))) * np.sqrt(gamma / (Tt * R)) * Pt * Ath + Thrust = Q * Ve + (Pe - Pamb) * Ae isp = Thrust / (Q * G0) return Thrust,isp @@ -312,7 +314,7 @@ def state_to_orbital_elem(r,v): n = n / nm nm = 1 dotrv = np.dot(r,v) - e = ((vm * vm-MU / rm) * r-dotrv * v) / MU + e = ((vm * vm - MU / rm) * r - dotrv * v) / MU em = LA.norm(e) if em < small: e = n @@ -320,7 +322,7 @@ def state_to_orbital_elem(r,v): else: e = e / em orbel['e'] = em - orbel['a'] = (hm * hm / MU) / (1-em * em) + orbel['a'] = (hm * hm / MU) / (1 - em * em) aux = h[2] / hm if np.abs(aux) > 1: aux = np.sign(aux) # all the angles are first computed in rad @@ -329,20 +331,20 @@ def state_to_orbital_elem(r,v): aux = n[0] if np.abs(aux) > 1: aux = np.sign(aux) orbel['capital_omega'] = np.arccos(aux) - if n[1] < 0: orbel['capital_omega'] = 2 * np.pi-orbel['capital_omega'] + if n[1] < 0: orbel['capital_omega'] = 2 * np.pi - orbel['capital_omega'] if em > small: aux = np.dot(e,n) if np.abs(aux) > 1: aux = np.sign(aux) orbel['small_omega'] = np.arccos(aux) - if e[2] < 0: orbel['small_omega'] = 2 * np.pi-orbel['small_omega'] + if e[2] < 0: orbel['small_omega'] = 2 * np.pi - orbel['small_omega'] aux = np.dot(e,r) / rm if np.abs(aux) > 1: aux = np.sign(aux) orbel['nu'] = np.arccos(aux) if em > small: - if dotrv < 0: orbel['nu'] = 2 * np.pi-orbel['nu'] + if dotrv < 0: orbel['nu'] = 2 * np.pi - orbel['nu'] else: ha = np.cross(e,r) - if np.dot(h,ha) < 0: orbel['nu'] = 2 * np.pi-orbel['nu'] + if np.dot(h,ha) < 0: orbel['nu'] = 2 * np.pi - orbel['nu'] # convert the angles to deg orbel['i'] = np.rad2deg(orbel['i']) orbel['capital_omega'] = np.rad2deg(orbel['capital_omega']) @@ -412,7 +414,7 @@ if __name__ == "__main__": print('final_target_vel') v_eject_altitude = 100 - v_orbit_semi_major_axis = 100 + v_orbit_semi_major_axis = 5000 try: v_f_velocity = final_target_vel(v_eject_altitude,v_orbit_semi_major_axis) print('{0}({1},{2}) = {3} '.format(final_target_vel.__name__, v_eject_altitude,v_orbit_semi_major_axis ,v_velocity)) @@ -432,4 +434,27 @@ if __name__ == "__main__": print('{0:.2f}, {1:.2f} = {2}({3}, {4}, {5}, {6}, {7}, {8})'.format(v_m1, v_m2, staging_optim.__name__,v_isp1,v_isp2,v_eps1,v_eps2,v_Vc,v_Mp)) except Exception as e: print(e) + print('') + + + print('standard_atmosphere') + v_altitude = 10000 + v_t, v_p, v_rho = standard_atmosphere(v_altitude) + print('{0:.2f}, {1:.2f}, {2:.2f} = {3}({4})'.format(v_t, v_p, v_rho, standard_atmosphere.__name__, v_altitude)) + print('') + + + print('laval_nozzle') + v_Pt = 20e5 # total pressure in the combustion chambre (Pa) + v_Tt = 2000 # total temperature in the combustion chambre (K) + v_Ath = 0.4 # throat section area (m2) + v_Ae = 1.6 # exit section area (m2) + v_gamma = 1.4 # ratio of specific heats + v_pamb = 1e5 + v_thrust, v_isp = laval_nozzle(v_Pt, v_Tt, v_pamb, v_Ath, v_Ae, v_gamma, R, tolerance=1e-5) + + print('{0:.2f}, {1:.2f} = {2}({3})'.format(v_thrust, v_isp, laval_nozzle.__name__, *(v_Pt, v_Tt, v_pamb, v_Ath, v_Ae, v_gamma, R))) + + + \ No newline at end of file diff --git a/Test_Engineering_tools.py b/Test_Engineering_tools.py new file mode 100644 index 0000000..5ce1548 --- /dev/null +++ b/Test_Engineering_tools.py @@ -0,0 +1,37 @@ + +from Engineering_tools import * + +import unittest + + + +class TestEngineeringTools(unittest.TestCase): + + def test_initial_vel(self): + latitude = 30 + v_velocity = initial_vel(latitude) + self.assertTrue(v_velocity is not None) + + + def test_final_target_vel(self): + v_eject_altitude = 100 + v_orbit_semi_major_axis = 5000 + + v_f_velocity = final_target_vel(v_eject_altitude,v_orbit_semi_major_axis) + + self.assertTrue(v_f_velocity is not None) + + + def test_staging_optim(self): + v_isp1 = 300 + v_isp2 = 300 + v_eps1 = 0.8 + v_eps2 = 0.7 + v_Vc = 100 + v_Mp = 3000 + v_m1, v_m2 = staging_optim(v_isp1,v_isp2,v_eps1,v_eps2,v_Vc,v_Mp) + + self.assertTrue(v_m1 is not None and v_m2 is not None) + +if __name__ == '__main__': + unittest.main() \ No newline at end of file -- GitLab From 96b506345016e30b31c05de05b7cd860e7570807 Mon Sep 17 00:00:00 2001 From: Vivien Date: Fri, 5 Jul 2019 15:37:05 +0200 Subject: [PATCH 03/37] global before script --- .gitlab-ci.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 792d9fd..f033276 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,22 +4,22 @@ stages: +before_script: + - echo "deb http://ftp.debian.org/debian jessie main" > /etc/apt/sources.list + - echo "deb http://ftp.debian.org/debian testing main" >> /etc/apt/sources.list + - echo 'APT::Default-Release "jessie";' >> /etc/apt/apt.conf.d/00local + - apt-get -qq update + - apt-cache policy python3 + - apt-get remove -y binutils + - apt-get -t testing install -y python3 + - apt-get -qq -t testing install -y python3-venv python3-pip python3-tk + - python3 -V + - python3 -m venv venv + - . venv/bin/activate + - pip3 install -r requirements.txt job_build: - before_script: - - echo "deb http://ftp.debian.org/debian jessie main" > /etc/apt/sources.list - - echo "deb http://ftp.debian.org/debian testing main" >> /etc/apt/sources.list - - echo 'APT::Default-Release "jessie";' >> /etc/apt/apt.conf.d/00local - - apt-get -qq update - - apt-cache policy python3 - - apt-get remove -y binutils - - apt-get -t testing install -y python3 - - apt-get -qq -t testing install -y python3-venv python3-pip python3-tk - - python3 -V - - python3 -m venv venv - - . venv/bin/activate - - pip3 install -r requirements.txt stage: build script: -- GitLab From c512569727d434c60e97b6589a61ce4d768902b7 Mon Sep 17 00:00:00 2001 From: Vivien Date: Fri, 5 Jul 2019 16:13:10 +0200 Subject: [PATCH 04/37] test --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f033276..89850e1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,4 @@ stages: - - build - test -- GitLab From 52672381a310690a2e749c9172a477d022005d6a Mon Sep 17 00:00:00 2001 From: Vivien Date: Fri, 5 Jul 2019 16:14:52 +0200 Subject: [PATCH 05/37] test --- .gitlab-ci.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 89850e1..d1b1b6d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,13 +17,7 @@ before_script: - . venv/bin/activate - pip3 install -r requirements.txt - -job_build: - - stage: build - script: - - echo "build" - - ./etagement.py + job_test: -- GitLab From 718c9256a51986865ac3886b3982cfaa5458e25a Mon Sep 17 00:00:00 2001 From: Vivien Date: Fri, 5 Jul 2019 16:18:13 +0200 Subject: [PATCH 06/37] test --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d1b1b6d..c4c7f89 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,6 +17,7 @@ before_script: - . venv/bin/activate - pip3 install -r requirements.txt + @@ -25,4 +26,5 @@ job_test: stage: test script: - echo "test" + - chmod u+rwx Test_Engineering_tools.py - ./Test_Engineering_tools.py \ No newline at end of file -- GitLab From 68e92a66d5b37b5325267f5a39501052b103255f Mon Sep 17 00:00:00 2001 From: Vivien Date: Fri, 5 Jul 2019 16:33:03 +0200 Subject: [PATCH 07/37] test --- .gitlab-ci.yml | 1 - Test_Engineering_tools.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c4c7f89..c87da62 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,7 +19,6 @@ before_script: - job_test: diff --git a/Test_Engineering_tools.py b/Test_Engineering_tools.py index 5ce1548..07bffc2 100644 --- a/Test_Engineering_tools.py +++ b/Test_Engineering_tools.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python from Engineering_tools import * -- GitLab From 5eaee272c6150a9cda5fd6f7ef2cc686a0068822 Mon Sep 17 00:00:00 2001 From: Vivien Date: Fri, 5 Jul 2019 16:37:47 +0200 Subject: [PATCH 08/37] test --- .gitlab-ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c87da62..ab90ee6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,5 @@ stages: + - build - test @@ -18,6 +19,12 @@ before_script: - pip3 install -r requirements.txt +job_build: + + stage: build + script: + - echo "build" + - ./etagement.py job_test: -- GitLab From a3791c109feb3c1c2c69641ba065455eb6a3d412 Mon Sep 17 00:00:00 2001 From: Vivien Date: Fri, 5 Jul 2019 16:44:21 +0200 Subject: [PATCH 09/37] test --- Test_Engineering_tools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Test_Engineering_tools.py b/Test_Engineering_tools.py index 07bffc2..1deeff5 100644 --- a/Test_Engineering_tools.py +++ b/Test_Engineering_tools.py @@ -15,8 +15,8 @@ class TestEngineeringTools(unittest.TestCase): def test_final_target_vel(self): - v_eject_altitude = 100 - v_orbit_semi_major_axis = 5000 + v_eject_altitude = 5000 + v_orbit_semi_major_axis = 100 v_f_velocity = final_target_vel(v_eject_altitude,v_orbit_semi_major_axis) -- GitLab From 205a2a443696e7a587cfa1d31270ad2ff3c449a5 Mon Sep 17 00:00:00 2001 From: Vivien Date: Sat, 6 Jul 2019 10:00:26 +0200 Subject: [PATCH 10/37] ajout de valeur correcte pour le test de 'final target vel' --- Engineering_tools.py | 9 ++++----- Test_Engineering_tools.py | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Engineering_tools.py b/Engineering_tools.py index 699f20f..9b0dfef 100755 --- a/Engineering_tools.py +++ b/Engineering_tools.py @@ -10,9 +10,7 @@ from numpy import linalg as LA # Constants -T_SIDE = 86164.10 # sidereal day (s) -R_T = 6378e3 # earth radius (m) - +T_SIDE = 86164.10 # sidereal day (s) MU = 3.9860e14 # earth standard gravitational parameter (=G * M_earth) (m3.s-2) R_T = 6378e3 # earth radius (m) G0 = 9.81 # standard gravity (m.s-2) @@ -41,6 +39,7 @@ def final_target_vel(h, a): """ v_square = 2 * MU * ((1 / (R_T + h)) - (1 / (2 * a))) + print(((1 / (R_T + h)) - (1 / (2 * a)))) assert v_square >= 0, 'error: square root only on positiv values' return np.sqrt(v_square) @@ -413,8 +412,8 @@ if __name__ == "__main__": print('') print('final_target_vel') - v_eject_altitude = 100 - v_orbit_semi_major_axis = 5000 + v_eject_altitude = 63 + v_orbit_semi_major_axis = 637800000 try: v_f_velocity = final_target_vel(v_eject_altitude,v_orbit_semi_major_axis) print('{0}({1},{2}) = {3} '.format(final_target_vel.__name__, v_eject_altitude,v_orbit_semi_major_axis ,v_velocity)) diff --git a/Test_Engineering_tools.py b/Test_Engineering_tools.py index 1deeff5..95cb76b 100644 --- a/Test_Engineering_tools.py +++ b/Test_Engineering_tools.py @@ -15,8 +15,8 @@ class TestEngineeringTools(unittest.TestCase): def test_final_target_vel(self): - v_eject_altitude = 5000 - v_orbit_semi_major_axis = 100 + v_eject_altitude = 100 + v_orbit_semi_major_axis = 637800000 v_f_velocity = final_target_vel(v_eject_altitude,v_orbit_semi_major_axis) -- GitLab From 309d99a47ea12ce9635515295ad72df31aae703f Mon Sep 17 00:00:00 2001 From: Vivien Date: Sat, 6 Jul 2019 10:10:05 +0200 Subject: [PATCH 11/37] comment the TestEngineeringTools py --- Test_Engineering_tools.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Test_Engineering_tools.py b/Test_Engineering_tools.py index 95cb76b..2352aa5 100644 --- a/Test_Engineering_tools.py +++ b/Test_Engineering_tools.py @@ -7,6 +7,12 @@ import unittest class TestEngineeringTools(unittest.TestCase): +''' This is a prototype of test bench for Engineering_tools functions + Each function can be tested using a set of specific parameters. + The results can be evaluated and the success of test is defined by asser**** + function call. + +''' def test_initial_vel(self): latitude = 30 -- GitLab From 58ff2ac0a247c3a221ad888493ac5f8671ecd822 Mon Sep 17 00:00:00 2001 From: Vivien Date: Sat, 6 Jul 2019 10:18:26 +0200 Subject: [PATCH 12/37] correct comment --- Test_Engineering_tools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Test_Engineering_tools.py b/Test_Engineering_tools.py index 2352aa5..b60b47d 100644 --- a/Test_Engineering_tools.py +++ b/Test_Engineering_tools.py @@ -7,12 +7,12 @@ import unittest class TestEngineeringTools(unittest.TestCase): -''' This is a prototype of test bench for Engineering_tools functions +""" This is a prototype of test bench for Engineering_tools functions Each function can be tested using a set of specific parameters. The results can be evaluated and the success of test is defined by asser**** function call. -''' +""" def test_initial_vel(self): latitude = 30 -- GitLab From 29bcea500a70baecf31c68427f6d3a3996f1730f Mon Sep 17 00:00:00 2001 From: Vivien Date: Sat, 6 Jul 2019 10:28:05 +0200 Subject: [PATCH 13/37] correct comment --- Test_Engineering_tools.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Test_Engineering_tools.py b/Test_Engineering_tools.py index b60b47d..b7eeaa3 100644 --- a/Test_Engineering_tools.py +++ b/Test_Engineering_tools.py @@ -4,16 +4,16 @@ from Engineering_tools import * import unittest - - -class TestEngineeringTools(unittest.TestCase): -""" This is a prototype of test bench for Engineering_tools functions +""" + This is a prototype of test bench for Engineering_tools functions Each function can be tested using a set of specific parameters. The results can be evaluated and the success of test is defined by asser**** function call. - """ +class TestEngineeringTools(unittest.TestCase): + + def test_initial_vel(self): latitude = 30 v_velocity = initial_vel(latitude) -- GitLab From 7eb4e291b2fe4ad4c93b62cfe9bf810086d3c652 Mon Sep 17 00:00:00 2001 From: Vivien Date: Sun, 7 Jul 2019 21:15:26 +0200 Subject: [PATCH 14/37] add sphinx doc generation --- Engineering_tools.py | 3 ++ docs/Makefile | 19 +++++++++++++ docs/make.bat | 35 +++++++++++++++++++++++ docs/source/conf.py | 56 +++++++++++++++++++++++++++++++++++++ req2.txt | 40 ++++++++++++++++++++++++++ requirement.txt | 40 ++++++++++++++++++++++++++ requirements.txt | 45 ++++++++++++++++++++++++----- test_standard_atmosphere.py | 4 ++- 8 files changed, 234 insertions(+), 8 deletions(-) create mode 100644 docs/Makefile create mode 100644 docs/make.bat create mode 100644 docs/source/conf.py create mode 100644 req2.txt create mode 100644 requirement.txt diff --git a/Engineering_tools.py b/Engineering_tools.py index 9b0dfef..36b8650 100755 --- a/Engineering_tools.py +++ b/Engineering_tools.py @@ -20,6 +20,9 @@ R = 287 # specific gas constant (J.Kg-1.K-1) def initial_vel(latitude,retrograde=False): """ Initial velocity (m.s-1) depending on the launch point latitude (°) + + :param latitude: the launch point latitude in ° + :return: the initial velocity in m.s-1 """ diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..69fe55e --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,19 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..4d9eb83 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% + +:end +popd diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..280850a --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,56 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# http://www.sphinx-doc.org/en/master/config + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +import os +import sys +sys.path.insert(0, os.path.abspath('../../')) + + +# -- Project information ----------------------------------------------------- + +project = 'meca_vol' +copyright = '2019, Adastra team' +author = 'Adastra team' + +# The full version, including alpha/beta/rc tags +release = '0.0.0' + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc' +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'sphinx_rtd_theme' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] diff --git a/req2.txt b/req2.txt new file mode 100644 index 0000000..b92860c --- /dev/null +++ b/req2.txt @@ -0,0 +1,40 @@ +alabaster==0.7.12 +asn1crypto==0.24.0 +Babel==2.6.0 +certifi==2018.8.24 +cffi==1.11.5 +chardet==3.0.4 +colorama==0.4.1 +conda==4.5.11 +cryptography==2.3.1 +docutils==0.14 +idna==2.7 +imagesize==1.1.0 +Jinja2==2.10.1 +MarkupSafe==1.1.1 +menuinst==1.4.14 +numpy==1.16.4 +packaging==19.0 +pycosat==0.6.3 +pycparser==2.18 +Pygments==2.4.0 +pyOpenSSL==18.0.0 +pyparsing==2.4.0 +PySocks==1.6.8 +pytz==2019.1 +pywin32==223 +requests==2.19.1 +ruamel-yaml==0.15.46 +six==1.11.0 +snowballstemmer==1.2.1 +Sphinx==2.0.1 +sphinx-rtd-theme==0.4.3 +sphinxcontrib-applehelp==1.0.1 +sphinxcontrib-devhelp==1.0.1 +sphinxcontrib-htmlhelp==1.0.2 +sphinxcontrib-jsmath==1.0.1 +sphinxcontrib-qthelp==1.0.2 +sphinxcontrib-serializinghtml==1.1.3 +urllib3==1.23 +win-inet-pton==1.0.1 +wincertstore==0.2 diff --git a/requirement.txt b/requirement.txt new file mode 100644 index 0000000..b92860c --- /dev/null +++ b/requirement.txt @@ -0,0 +1,40 @@ +alabaster==0.7.12 +asn1crypto==0.24.0 +Babel==2.6.0 +certifi==2018.8.24 +cffi==1.11.5 +chardet==3.0.4 +colorama==0.4.1 +conda==4.5.11 +cryptography==2.3.1 +docutils==0.14 +idna==2.7 +imagesize==1.1.0 +Jinja2==2.10.1 +MarkupSafe==1.1.1 +menuinst==1.4.14 +numpy==1.16.4 +packaging==19.0 +pycosat==0.6.3 +pycparser==2.18 +Pygments==2.4.0 +pyOpenSSL==18.0.0 +pyparsing==2.4.0 +PySocks==1.6.8 +pytz==2019.1 +pywin32==223 +requests==2.19.1 +ruamel-yaml==0.15.46 +six==1.11.0 +snowballstemmer==1.2.1 +Sphinx==2.0.1 +sphinx-rtd-theme==0.4.3 +sphinxcontrib-applehelp==1.0.1 +sphinxcontrib-devhelp==1.0.1 +sphinxcontrib-htmlhelp==1.0.2 +sphinxcontrib-jsmath==1.0.1 +sphinxcontrib-qthelp==1.0.2 +sphinxcontrib-serializinghtml==1.1.3 +urllib3==1.23 +win-inet-pton==1.0.1 +wincertstore==0.2 diff --git a/requirements.txt b/requirements.txt index dc9d951..b92860c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,40 @@ -cycler==0.10.0 -kiwisolver==1.1.0 -matplotlib==3.0.3 -numpy==1.16.3 -pandas==0.24.2 +alabaster==0.7.12 +asn1crypto==0.24.0 +Babel==2.6.0 +certifi==2018.8.24 +cffi==1.11.5 +chardet==3.0.4 +colorama==0.4.1 +conda==4.5.11 +cryptography==2.3.1 +docutils==0.14 +idna==2.7 +imagesize==1.1.0 +Jinja2==2.10.1 +MarkupSafe==1.1.1 +menuinst==1.4.14 +numpy==1.16.4 +packaging==19.0 +pycosat==0.6.3 +pycparser==2.18 +Pygments==2.4.0 +pyOpenSSL==18.0.0 pyparsing==2.4.0 -python-dateutil==2.8.0 +PySocks==1.6.8 pytz==2019.1 -six==1.12.0 +pywin32==223 +requests==2.19.1 +ruamel-yaml==0.15.46 +six==1.11.0 +snowballstemmer==1.2.1 +Sphinx==2.0.1 +sphinx-rtd-theme==0.4.3 +sphinxcontrib-applehelp==1.0.1 +sphinxcontrib-devhelp==1.0.1 +sphinxcontrib-htmlhelp==1.0.2 +sphinxcontrib-jsmath==1.0.1 +sphinxcontrib-qthelp==1.0.2 +sphinxcontrib-serializinghtml==1.1.3 +urllib3==1.23 +win-inet-pton==1.0.1 +wincertstore==0.2 diff --git a/test_standard_atmosphere.py b/test_standard_atmosphere.py index 2ca63bd..c699762 100755 --- a/test_standard_atmosphere.py +++ b/test_standard_atmosphere.py @@ -34,4 +34,6 @@ plt.plot(data['rho'],data['altitude']*1e-3) plt.xscale('log') plt.title('Density Vs Altitude') plt.xlabel('Density (Kg.m-3)') -plt.ylabel('Altitude (km)') \ No newline at end of file +plt.ylabel('Altitude (km)') + +plt.show() \ No newline at end of file -- GitLab From 1acce435b73812b84f6ea9246e1ca340e312b5aa Mon Sep 17 00:00:00 2001 From: Vivien Date: Sun, 7 Jul 2019 21:15:53 +0200 Subject: [PATCH 15/37] remove req2 --- req2.txt | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 req2.txt diff --git a/req2.txt b/req2.txt deleted file mode 100644 index b92860c..0000000 --- a/req2.txt +++ /dev/null @@ -1,40 +0,0 @@ -alabaster==0.7.12 -asn1crypto==0.24.0 -Babel==2.6.0 -certifi==2018.8.24 -cffi==1.11.5 -chardet==3.0.4 -colorama==0.4.1 -conda==4.5.11 -cryptography==2.3.1 -docutils==0.14 -idna==2.7 -imagesize==1.1.0 -Jinja2==2.10.1 -MarkupSafe==1.1.1 -menuinst==1.4.14 -numpy==1.16.4 -packaging==19.0 -pycosat==0.6.3 -pycparser==2.18 -Pygments==2.4.0 -pyOpenSSL==18.0.0 -pyparsing==2.4.0 -PySocks==1.6.8 -pytz==2019.1 -pywin32==223 -requests==2.19.1 -ruamel-yaml==0.15.46 -six==1.11.0 -snowballstemmer==1.2.1 -Sphinx==2.0.1 -sphinx-rtd-theme==0.4.3 -sphinxcontrib-applehelp==1.0.1 -sphinxcontrib-devhelp==1.0.1 -sphinxcontrib-htmlhelp==1.0.2 -sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.2 -sphinxcontrib-serializinghtml==1.1.3 -urllib3==1.23 -win-inet-pton==1.0.1 -wincertstore==0.2 -- GitLab From 353257ec2d568fcbc4971b77b279fbb98bffab9f Mon Sep 17 00:00:00 2001 From: Vivien Date: Sun, 7 Jul 2019 21:17:58 +0200 Subject: [PATCH 16/37] maj cli for sphinx doc --- .gitlab-ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ab90ee6..0a64771 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,6 @@ stages: - build + - doc - test @@ -19,6 +20,13 @@ before_script: - pip3 install -r requirements.txt +job-doc: + stage: doc + script: + - echo "Documentation" + - sphinx-apidoc -o docs/source . + - sphinx-build -b html docs/source docs/build + job_build: stage: build -- GitLab From 45f63121f721289d00ee7ccbca825d51c330c925 Mon Sep 17 00:00:00 2001 From: Vivien Date: Sun, 7 Jul 2019 21:23:12 +0200 Subject: [PATCH 17/37] maj requirements.txt --- requirements.txt | 46 ++++++++-------------------------------------- 1 file changed, 8 insertions(+), 38 deletions(-) diff --git a/requirements.txt b/requirements.txt index b92860c..e9f817d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,40 +1,10 @@ -alabaster==0.7.12 -asn1crypto==0.24.0 -Babel==2.6.0 -certifi==2018.8.24 -cffi==1.11.5 -chardet==3.0.4 -colorama==0.4.1 -conda==4.5.11 -cryptography==2.3.1 -docutils==0.14 -idna==2.7 -imagesize==1.1.0 -Jinja2==2.10.1 -MarkupSafe==1.1.1 -menuinst==1.4.14 -numpy==1.16.4 -packaging==19.0 -pycosat==0.6.3 -pycparser==2.18 -Pygments==2.4.0 -pyOpenSSL==18.0.0 +cycler==0.10.0 +kiwisolver==1.1.0 +matplotlib==3.0.3 +numpy==1.16.3 +pandas==0.24.2 pyparsing==2.4.0 -PySocks==1.6.8 +python-dateutil==2.8.0 pytz==2019.1 -pywin32==223 -requests==2.19.1 -ruamel-yaml==0.15.46 -six==1.11.0 -snowballstemmer==1.2.1 -Sphinx==2.0.1 -sphinx-rtd-theme==0.4.3 -sphinxcontrib-applehelp==1.0.1 -sphinxcontrib-devhelp==1.0.1 -sphinxcontrib-htmlhelp==1.0.2 -sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.2 -sphinxcontrib-serializinghtml==1.1.3 -urllib3==1.23 -win-inet-pton==1.0.1 -wincertstore==0.2 +six==1.12.0 +Sphinx==2.0.1 \ No newline at end of file -- GitLab From 61df1a58380de0da05bbacf69ae3fd13363d242f Mon Sep 17 00:00:00 2001 From: Vivien Date: Sun, 7 Jul 2019 21:23:35 +0200 Subject: [PATCH 18/37] rmv requirement.txt --- requirement.txt | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 requirement.txt diff --git a/requirement.txt b/requirement.txt deleted file mode 100644 index b92860c..0000000 --- a/requirement.txt +++ /dev/null @@ -1,40 +0,0 @@ -alabaster==0.7.12 -asn1crypto==0.24.0 -Babel==2.6.0 -certifi==2018.8.24 -cffi==1.11.5 -chardet==3.0.4 -colorama==0.4.1 -conda==4.5.11 -cryptography==2.3.1 -docutils==0.14 -idna==2.7 -imagesize==1.1.0 -Jinja2==2.10.1 -MarkupSafe==1.1.1 -menuinst==1.4.14 -numpy==1.16.4 -packaging==19.0 -pycosat==0.6.3 -pycparser==2.18 -Pygments==2.4.0 -pyOpenSSL==18.0.0 -pyparsing==2.4.0 -PySocks==1.6.8 -pytz==2019.1 -pywin32==223 -requests==2.19.1 -ruamel-yaml==0.15.46 -six==1.11.0 -snowballstemmer==1.2.1 -Sphinx==2.0.1 -sphinx-rtd-theme==0.4.3 -sphinxcontrib-applehelp==1.0.1 -sphinxcontrib-devhelp==1.0.1 -sphinxcontrib-htmlhelp==1.0.2 -sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.2 -sphinxcontrib-serializinghtml==1.1.3 -urllib3==1.23 -win-inet-pton==1.0.1 -wincertstore==0.2 -- GitLab From df1abffcf67cf2842e651c9401cdb58cc2f3e806 Mon Sep 17 00:00:00 2001 From: Vivien Date: Sun, 7 Jul 2019 21:36:08 +0200 Subject: [PATCH 19/37] try to cach the python dependencies between jobs --- .gitlab-ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0a64771..9c38cfb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,8 +2,16 @@ stages: - build - doc - test + +# Change pip's cache directory to be inside the project directory since we can +# only cache local items. +variables: + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" - +cache: + paths: + - .cache/pip + - venv/ before_script: - echo "deb http://ftp.debian.org/debian jessie main" > /etc/apt/sources.list @@ -24,6 +32,7 @@ job-doc: stage: doc script: - echo "Documentation" + - pip3 install sphinx_rtd_theme - sphinx-apidoc -o docs/source . - sphinx-build -b html docs/source docs/build -- GitLab From 1910e7b1cc0f43843b01b315ee2c49c34d643bac Mon Sep 17 00:00:00 2001 From: Vivien Date: Sun, 7 Jul 2019 21:44:14 +0200 Subject: [PATCH 20/37] ajout de index.rst --- docs/source/index.rst | 21 +++++++++++++++++++++ requirement.txt | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 docs/source/index.rst create mode 100644 requirement.txt diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..c5a52dc --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,21 @@ +.. meca_vol documentation master file, created by + sphinx-quickstart on Sun Jul 7 20:22:14 2019. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to meca_vol's documentation! +==================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: +name: +Test_Engineering_tools + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/requirement.txt b/requirement.txt new file mode 100644 index 0000000..b92860c --- /dev/null +++ b/requirement.txt @@ -0,0 +1,40 @@ +alabaster==0.7.12 +asn1crypto==0.24.0 +Babel==2.6.0 +certifi==2018.8.24 +cffi==1.11.5 +chardet==3.0.4 +colorama==0.4.1 +conda==4.5.11 +cryptography==2.3.1 +docutils==0.14 +idna==2.7 +imagesize==1.1.0 +Jinja2==2.10.1 +MarkupSafe==1.1.1 +menuinst==1.4.14 +numpy==1.16.4 +packaging==19.0 +pycosat==0.6.3 +pycparser==2.18 +Pygments==2.4.0 +pyOpenSSL==18.0.0 +pyparsing==2.4.0 +PySocks==1.6.8 +pytz==2019.1 +pywin32==223 +requests==2.19.1 +ruamel-yaml==0.15.46 +six==1.11.0 +snowballstemmer==1.2.1 +Sphinx==2.0.1 +sphinx-rtd-theme==0.4.3 +sphinxcontrib-applehelp==1.0.1 +sphinxcontrib-devhelp==1.0.1 +sphinxcontrib-htmlhelp==1.0.2 +sphinxcontrib-jsmath==1.0.1 +sphinxcontrib-qthelp==1.0.2 +sphinxcontrib-serializinghtml==1.1.3 +urllib3==1.23 +win-inet-pton==1.0.1 +wincertstore==0.2 -- GitLab From 77035387e8e9635b565d5756b3935821e0e2344d Mon Sep 17 00:00:00 2001 From: Vivien Date: Sun, 7 Jul 2019 21:44:36 +0200 Subject: [PATCH 21/37] rmv requirement.txt --- requirement.txt | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 requirement.txt diff --git a/requirement.txt b/requirement.txt deleted file mode 100644 index b92860c..0000000 --- a/requirement.txt +++ /dev/null @@ -1,40 +0,0 @@ -alabaster==0.7.12 -asn1crypto==0.24.0 -Babel==2.6.0 -certifi==2018.8.24 -cffi==1.11.5 -chardet==3.0.4 -colorama==0.4.1 -conda==4.5.11 -cryptography==2.3.1 -docutils==0.14 -idna==2.7 -imagesize==1.1.0 -Jinja2==2.10.1 -MarkupSafe==1.1.1 -menuinst==1.4.14 -numpy==1.16.4 -packaging==19.0 -pycosat==0.6.3 -pycparser==2.18 -Pygments==2.4.0 -pyOpenSSL==18.0.0 -pyparsing==2.4.0 -PySocks==1.6.8 -pytz==2019.1 -pywin32==223 -requests==2.19.1 -ruamel-yaml==0.15.46 -six==1.11.0 -snowballstemmer==1.2.1 -Sphinx==2.0.1 -sphinx-rtd-theme==0.4.3 -sphinxcontrib-applehelp==1.0.1 -sphinxcontrib-devhelp==1.0.1 -sphinxcontrib-htmlhelp==1.0.2 -sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.2 -sphinxcontrib-serializinghtml==1.1.3 -urllib3==1.23 -win-inet-pton==1.0.1 -wincertstore==0.2 -- GitLab From db599c9d670ce6260e3087a7e8fc4e37075ef392 Mon Sep 17 00:00:00 2001 From: Vivien Date: Sun, 7 Jul 2019 23:42:36 +0200 Subject: [PATCH 22/37] =?UTF-8?q?ajout=20des=20docs=20g=C3=A9n=C3=A9r?= =?UTF-8?q?=C3=A9=20en=20artefact?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9c38cfb..66cc190 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,7 +35,10 @@ job-doc: - pip3 install sphinx_rtd_theme - sphinx-apidoc -o docs/source . - sphinx-build -b html docs/source docs/build - + artifacts: + paths: + - docs/build/ + job_build: stage: build -- GitLab From 6b1c5774d14e4afd658393ae28ebd3ebd1d295e2 Mon Sep 17 00:00:00 2001 From: Vivien Date: Mon, 8 Jul 2019 00:04:04 +0200 Subject: [PATCH 23/37] try create pages --- .gitlab-ci.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 66cc190..dff1a12 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,16 +28,21 @@ before_script: - pip3 install -r requirements.txt -job-doc: - stage: doc +pages: + stage: build script: - echo "Documentation" - pip3 install sphinx_rtd_theme - sphinx-apidoc -o docs/source . - sphinx-build -b html docs/source docs/build + - mv docs/build/ public/ + artifacts: paths: - - docs/build/ + - public + only: + - master + job_build: -- GitLab From e978556480bb99f7ff92a63713ae8648abf35294 Mon Sep 17 00:00:00 2001 From: Vivien Date: Mon, 8 Jul 2019 00:04:58 +0200 Subject: [PATCH 24/37] correct --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dff1a12..9d8c14e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,8 +40,8 @@ pages: artifacts: paths: - public - only: - - master + only: + - master job_build: -- GitLab From 450c4b9bbe5ded9768425096a2a875a6e8529b80 Mon Sep 17 00:00:00 2001 From: Vivien Date: Mon, 8 Jul 2019 00:13:37 +0200 Subject: [PATCH 25/37] correc pages --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9d8c14e..84d4637 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,7 +29,6 @@ before_script: pages: - stage: build script: - echo "Documentation" - pip3 install sphinx_rtd_theme -- GitLab From e6c61ca855127ffe3b6a126093f9db5b9ab72312 Mon Sep 17 00:00:00 2001 From: Vivien23 Date: Mon, 8 Jul 2019 09:23:16 +0200 Subject: [PATCH 26/37] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 84d4637..d7f996a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,8 +39,7 @@ pages: artifacts: paths: - public - only: - - master + job_build: -- GitLab From 942f2bfd1930329780d7e47835c990ed10a72920 Mon Sep 17 00:00:00 2001 From: Vivien23 Date: Mon, 8 Jul 2019 09:43:41 +0200 Subject: [PATCH 27/37] Update .gitlab-ci.yml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d7f996a..6092c71 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,7 +34,7 @@ pages: - pip3 install sphinx_rtd_theme - sphinx-apidoc -o docs/source . - sphinx-build -b html docs/source docs/build - - mv docs/build/ public/ + - cp -a docs/build/ public/ artifacts: paths: -- GitLab From ccfd67d0c127a03d902a2375c419e15c12c77bf6 Mon Sep 17 00:00:00 2001 From: Vivien Date: Mon, 8 Jul 2019 19:29:44 +0200 Subject: [PATCH 28/37] ajout du generateur de rst --- docs/Makefile | 5 +++++ docs/make.bat | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/docs/Makefile b/docs/Makefile index 69fe55e..78f01ab 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -3,9 +3,13 @@ # You can set these variables from the command line. SPHINXOPTS = +SPHIXAPIDOC = sphinx-apidoc SPHINXBUILD = sphinx-build SOURCEDIR = source BUILDDIR = build +PYTHONDIR = ../ + +sphinx-apidoc -o docs/source . # Put it first so that "make" without argument is like "make help". help: @@ -16,4 +20,5 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile + @$(SPHIXAPIDOC) -o $@ "$(SOURCEDIR)" "$(PYTHONDIR)" @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/docs/make.bat b/docs/make.bat index 4d9eb83..cd8aa83 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -9,6 +9,8 @@ if "%SPHINXBUILD%" == "" ( ) set SOURCEDIR=source set BUILDDIR=build +set SPHIXAPIDOC=sphinx-apidoc +set PYTHONDIR=../ if "%1" == "" goto help @@ -25,6 +27,8 @@ if errorlevel 9009 ( exit /b 1 ) +%SPHIXAPIDOC% -o %SOURCEDIR% %PYTHONDIR% + %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% goto end -- GitLab From 49dabc063c9940d2de3df51bb4907a3ce548bc42 Mon Sep 17 00:00:00 2001 From: Vivien Date: Wed, 10 Jul 2019 12:12:22 +0200 Subject: [PATCH 29/37] maj code docstring for documentation --- Engineering_tools.py | 177 ++++++++++++++---------------------- docs/source/conf.py | 5 +- test_laval_nozzle.py | 22 +++-- test_standard_atmosphere.py | 46 +++++----- 4 files changed, 107 insertions(+), 143 deletions(-) diff --git a/Engineering_tools.py b/Engineering_tools.py index 36b8650..390236c 100755 --- a/Engineering_tools.py +++ b/Engineering_tools.py @@ -8,6 +8,7 @@ Created on Sun May 12 20:08:52 2019 import numpy as np from numpy import linalg as LA +import sympy # Constants T_SIDE = 86164.10 # sidereal day (s) @@ -32,48 +33,52 @@ def initial_vel(latitude,retrograde=False): else: return initial_velocity -def final_target_vel(h, a): """ inputs: h: injection altitude (m) - a: orbit semi major axis (m) + a: output: - orbit absolute injection velocity (m.s-1) + + """ +def final_target_vel(h, a): + """ + + .. math:: \\sqrt {2 \\cdot MU \\cdot (\\frac {1}{R_T + h} - \\frac {1}{2 * a})} + + :param h: injection altitude (m) + :type h: float + :param a: orbit semi major axis (m) + :type a: float + :return: orbit absolute injection velocity (m.s-1) + :rtype: float """ v_square = 2 * MU * ((1 / (R_T + h)) - (1 / (2 * a))) print(((1 / (R_T + h)) - (1 / (2 * a)))) assert v_square >= 0, 'error: square root only on positiv values' return np.sqrt(v_square) - + def staging_optim(isp1,isp2,eps1,eps2,Vc,Mp): + + """Optimise mass loading in the case of two stage rocket + + .. math:: structural_coefficient = \\frac {strcture_mass} {structure_mass + propellant_mass} + + :param isp1: specific impulse of the first stage (s) + :type isp1: float + :param isp2: specific impulse of the second stage (s) + :type isp2: float + :param eps1: structural coefficient of the first stage + :type eps1: float + :param eps2: structural coefficient of the second stage + :type eps2: float + :param Vc: target critical velocity (m.s-1) + :type Vc: float + :param Mp: payload mass (Kg) + :type Mp: float + :return: mass of the first and second stage (Kg) + :rtype: float """ - Optimise mass loading in the case of two stage rocket - inputs: - isp1, isp2 : specific impulse of the 1st and 2nd stage (s) - eps1, eps2 : structural coefficient of the 1st and 2nd stage (adimentional) - Vc : target critical velocity (m.s-1) - Mp : payload mass (Kg) - outputs: - M1 : mass of the 1st stage - M2 : mass of the 2nd stage - - NB: - structure mass - structural coefficient = -------------------------------- - structure mass + propellant mass - - ctritical velocity = final velocity - initial velocity + losses - """ - -# Notation : -# -# Mt = total mass -# q1 = M1/Mt -# q2 = M2/Mt -# qp = Mp/Mt -# omega = qp + q2 - omega_tab=np.linspace(0.001,0.9,100) # array of omega to test qp_tab=[] @@ -96,14 +101,13 @@ def staging_optim(isp1,isp2,eps1,eps2,Vc,Mp): return M1, M2 def standard_atmosphere(altitude): - """ - Compute atmospheric properties according to the International Standaard Atmosphere (ISA) model - input: - altitude (m) - outputs: - temperature (K) - pressure (Pa) - density (Kg.m-3) + """ Compute atmospheric properties according to the International \ + Standard Atmosphere (ISA) model + + :param altitude: altitude in meter + :type altitude: float + :return: T, P, rho : temperature (K), pressure (Pa), density (Kg.m-3) + :rtype: float, float, float """ # ISA model @@ -132,25 +136,32 @@ def standard_atmosphere(altitude): rho = P / (R * T) return T,P,rho - + def laval_nozzle(Pt,Tt,Pamb,Ath,Ae,gamma,R,tolerance=1e-5): + """Compute the thrust assuming a started nozzle + + .. math:: Thrust = mass flow rate * exit velocity + (exit pressure - ambiant pressure) * exit area + + :param Pt: total pressure in the combustion chambre (Pa) + :type Pt: [type] + :param Tt: total temperature in the combustion chambre (K) + :type Tt: [type] + :param Pamb: ambient pressure (Pa) + :type Pamb: [type] + :param Ath: throat section area (m2) + :type Ath: [type] + :param Ae: exit section area (m2) + :type Ae: [type] + :param gamma: ratio of specific heats (adimentional) + :type gamma: [type] + :param R: specific gas constant (J.Kg-1.K-1) + :type R: [type] + :param tolerance: [description], defaults to 1e-5 + :type tolerance: [type], optional + :return: Thrust (N), Specific impulse (s) + :rtype: [type] """ - Compute the thrust assuming a started nozzle - inputs: - Pt : total pressure in the combustion chambre (Pa) - Tt : total temperature in the combustion chambre (K) - Pamb : ambient pressure (Pa) - Ath : throat section area (m2) - Ae : exit section area (m2) - gamma : ratio of specific heats (adimentional) - R : specific gas constant (J.Kg-1.K-1) - tolerance : - outputs: - Thrust (N) - Specific impulse (s) - - N.B : Thrust = mass flow rate * exit velocity + (exit pressure - ambiant pressure) * exit area - """ + assert gamma > 1, 'gamma must be > 1' @@ -402,61 +413,7 @@ def full_flow_staged_combust(): if __name__ == "__main__": - import unittest - - - - # Basic auto test - - print('initial_vel') - latitude = 30 - v_velocity = initial_vel(latitude) - print('{0}({1}) = {2} '.format(initial_vel.__name__, latitude,v_velocity)) - print('') - - print('final_target_vel') - v_eject_altitude = 63 - v_orbit_semi_major_axis = 637800000 - try: - v_f_velocity = final_target_vel(v_eject_altitude,v_orbit_semi_major_axis) - print('{0}({1},{2}) = {3} '.format(final_target_vel.__name__, v_eject_altitude,v_orbit_semi_major_axis ,v_velocity)) - except Exception as e: - print(e) - print('') - - print('staging_optim') - v_isp1 = 300 - v_isp2 = 300 - v_eps1 = 0.8 - v_eps2 = 0.7 - v_Vc = 100 - v_Mp = 3000 - try: - v_m1, v_m2 = staging_optim(v_isp1,v_isp2,v_eps1,v_eps2,v_Vc,v_Mp) - print('{0:.2f}, {1:.2f} = {2}({3}, {4}, {5}, {6}, {7}, {8})'.format(v_m1, v_m2, staging_optim.__name__,v_isp1,v_isp2,v_eps1,v_eps2,v_Vc,v_Mp)) - except Exception as e: - print(e) - print('') - - - print('standard_atmosphere') - v_altitude = 10000 - v_t, v_p, v_rho = standard_atmosphere(v_altitude) - print('{0:.2f}, {1:.2f}, {2:.2f} = {3}({4})'.format(v_t, v_p, v_rho, standard_atmosphere.__name__, v_altitude)) - print('') - - - print('laval_nozzle') - v_Pt = 20e5 # total pressure in the combustion chambre (Pa) - v_Tt = 2000 # total temperature in the combustion chambre (K) - v_Ath = 0.4 # throat section area (m2) - v_Ae = 1.6 # exit section area (m2) - v_gamma = 1.4 # ratio of specific heats - v_pamb = 1e5 - v_thrust, v_isp = laval_nozzle(v_Pt, v_Tt, v_pamb, v_Ath, v_Ae, v_gamma, R, tolerance=1e-5) - - print('{0:.2f}, {1:.2f} = {2}({3})'.format(v_thrust, v_isp, laval_nozzle.__name__, *(v_Pt, v_Tt, v_pamb, v_Ath, v_Ae, v_gamma, R))) - + pass \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 280850a..10694a9 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -31,7 +31,9 @@ release = '0.0.0' # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.autodoc' + 'sphinx.ext.autodoc', + #'sphinx.ext.imgmath' + 'sphinx.ext.mathjax' ] # Add any paths that contain templates here, relative to this directory. @@ -42,6 +44,7 @@ templates_path = ['_templates'] # This pattern also affects html_static_path and html_extra_path. exclude_patterns = [] +master_doc = 'index' # -- Options for HTML output ------------------------------------------------- diff --git a/test_laval_nozzle.py b/test_laval_nozzle.py index a6d925a..432782d 100755 --- a/test_laval_nozzle.py +++ b/test_laval_nozzle.py @@ -23,14 +23,16 @@ Pamb_tab = np.linspace(1e5,100,100) # array of the ambient pressure (Pa) for Pamb in Pamb_tab: data.loc[len(data)] = (Pamb,)+laval_nozzle(Pt,Tt,Pamb,Ath,Ae,gamma,r) -plt.figure('Laval Nozzle Thrust') -plt.plot(data['Pamb']*1e-5,data['Thrust']*1e-3) -plt.title('Thrust Vs Ambient Pressure') -plt.xlabel('Ambient Pressure (bar)') -plt.ylabel('Thrust (kN)') -plt.figure('Laval Nozzle Isp') -plt.plot(data['Pamb']*1e-5,data['isp']) -plt.title('Isp Vs Ambient Pressure') -plt.xlabel('Ambient Pressure (bar)') -plt.ylabel('Isp (s)') +if __name__ == '__main__': + plt.figure('Laval Nozzle Thrust') + plt.plot(data['Pamb']*1e-5,data['Thrust']*1e-3) + plt.title('Thrust Vs Ambient Pressure') + plt.xlabel('Ambient Pressure (bar)') + plt.ylabel('Thrust (kN)') + + plt.figure('Laval Nozzle Isp') + plt.plot(data['Pamb']*1e-5,data['isp']) + plt.title('Isp Vs Ambient Pressure') + plt.xlabel('Ambient Pressure (bar)') + plt.ylabel('Isp (s)') diff --git a/test_standard_atmosphere.py b/test_standard_atmosphere.py index c699762..3faae58 100755 --- a/test_standard_atmosphere.py +++ b/test_standard_atmosphere.py @@ -15,25 +15,27 @@ data = pd.DataFrame(columns=['altitude','T','P','rho']) for h in altitude: data.loc[len(data)] = (h,)+standard_atmosphere(h) - -plt.figure('ISA Temperature') -plt.plot(data['T'],data['altitude']*1e-3) -plt.title('Temperature Vs Altitude') -plt.xlabel('Temperature (K)') -plt.ylabel('Altitude (km)') - -plt.figure('ISA Pressure') -plt.plot(data['P'],data['altitude']*1e-3) -plt.xscale('log') -plt.title('Pressure Vs Altitude') -plt.xlabel('Pressure (Pa)') -plt.ylabel('Altitude (km)') - -plt.figure('ISA Density') -plt.plot(data['rho'],data['altitude']*1e-3) -plt.xscale('log') -plt.title('Density Vs Altitude') -plt.xlabel('Density (Kg.m-3)') -plt.ylabel('Altitude (km)') - -plt.show() \ No newline at end of file + + +if __name__ == '__main__': + plt.figure('ISA Temperature') + plt.plot(data['T'],data['altitude']*1e-3) + plt.title('Temperature Vs Altitude') + plt.xlabel('Temperature (K)') + plt.ylabel('Altitude (km)') + + plt.figure('ISA Pressure') + plt.plot(data['P'],data['altitude']*1e-3) + plt.xscale('log') + plt.title('Pressure Vs Altitude') + plt.xlabel('Pressure (Pa)') + plt.ylabel('Altitude (km)') + + plt.figure('ISA Density') + plt.plot(data['rho'],data['altitude']*1e-3) + plt.xscale('log') + plt.title('Density Vs Altitude') + plt.xlabel('Density (Kg.m-3)') + plt.ylabel('Altitude (km)') + + plt.show() \ No newline at end of file -- GitLab From 8e5ddeed5c1a775894ce29d16f91344be9e6b0a6 Mon Sep 17 00:00:00 2001 From: Vivien Date: Wed, 10 Jul 2019 15:45:10 +0200 Subject: [PATCH 30/37] maj comment --- Engineering_tools.py | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/Engineering_tools.py b/Engineering_tools.py index 390236c..24184d7 100755 --- a/Engineering_tools.py +++ b/Engineering_tools.py @@ -26,20 +26,12 @@ def initial_vel(latitude,retrograde=False): :return: the initial velocity in m.s-1 """ - initial_velocity = (2 * np.pi / T_SIDE) * R_T * np.cos(np.deg2rad(np.abs(latitude))) if retrograde: return -initial_velocity else: return initial_velocity - """ - inputs: - h: injection altitude (m) - a: - output: - - """ def final_target_vel(h, a): """ @@ -264,13 +256,16 @@ def laval_nozzle(Pt,Tt,Pamb,Ath,Ae,gamma,R,tolerance=1e-5): return Thrust,isp def adiabatic_flame(mech,T,P,X): - """ - Compute adiatabic flame temperature - inputs: - mech : chemical mechanism in cti format - T : initial temperature (K) - P : pressure (Pa) - X : initial chemical composition + """Compute adiabatic flame temperature + + :param mech: chemical mechanism in cti format + :type mech: [type] + :param T: initial temperature (K) + :type T: [type] + :param P: pressure (Pa) + :type P: [type] + :param X: initial chemical composition + :type X: [type] """ # work in progress -- GitLab From 4355c51a5454941db28085f2a7375e8da88cda67 Mon Sep 17 00:00:00 2001 From: Vivien Date: Fri, 19 Jul 2019 15:35:19 +0200 Subject: [PATCH 31/37] --- Data_structure.py | 149 ++++++++++++++++++++++++++++++------------- Engineering_tools.py | 4 +- 2 files changed, 106 insertions(+), 47 deletions(-) diff --git a/Data_structure.py b/Data_structure.py index f1741d2..898e27a 100755 --- a/Data_structure.py +++ b/Data_structure.py @@ -7,79 +7,83 @@ Created on Sun May 12 19:51:18 2019 import Engineering_tools as et +RETROGRADE_ORBIT = 90 + class Rocket(): - """ - """ - - def __init__(self,stage1,stage2,payload,launch_coordinates): - """ - stage1 and stage2 are instances of the class Stage, + + def __init__(self, stage1, stage2, payload, launch_coordinates): + """stage1 and stage2 are instances of the class Stage, payload is an instance of the class Payload, - launch_coordiantes = {latitude(deg),logitude(deg)} + launch_coordinates = {latitude(deg), longitude(deg)} + + :param stage1: [description] + :type stage1: [type] + :param stage2: [description] + :type stage2: [type] + :param payload: [description] + :type payload: Payload + :param launch_coordinates: [description] + :type launch_coordinates: [type] """ self.stage1 = stage1 self.stage2 = stage2 self.payload = payload self.injection_velocity = et.final_target_vel(self.payload.perigee_altitude, - self.payload.target_orbit['a']) + self.payload.target_orbit.a) self.launch_coordinates = launch_coordinates - if self.payload.target_orbit['i'] > 90: # retrograade orbit + if self.payload.target_orbit.i > RETROGRADE_ORBIT: # retrograade orbit self.initial_velocity = et.initial_vel(self.launch_coordinates['latitude'],retrograde=True) else: - self.initial_velocity = et.initial_vel(self.launch_coordinates['latitude']) + self.initial_velocity = et.initial_vel(self.launch_coordinates['longitude']) - def target_Vc(self,losses): - """ - Compute the target critical velocity - losses : velocity losses approximation (m.s-1) + def target_Vc(self, p_losses): + """Compute the target critical velocity losses : velocity losses approximation (m.s-1) + + :param p_losses: [description] + :type p_losses: [type] """ - self.target_Vc = self.injection_velocity-self.initial_velocity+losses + self.target_Vc = self.injection_velocity - self.initial_velocity + p_losses + def __str__(self): + return 'Rocket' class Stage(): - """ - """ - def __init__(self,stage_number,number_of_engines): + def __init__(self, stage_number, number_of_engines = 9, avionics_mass=0): """ stage_number : 1 or 2 """ self.stage_number = stage_number - - - avionics_mass = 0 + self.number_of_engines = number_of_engines + self.avionics_mass = 0 - number_of_engines = 9 - - def tank_mass(self,) + def tank_mass(self): + pass + + def __str__(self): + return 'Stage' class Payload(): - """ - """ - - def __init__(self,mass,target_orbit): - """ - mass in kg - target_orbit = {'a','e','i','capital_omega','small_omega','nu'} - where: - a : semi_major axis (m) - e : eccentricity (adimentional) - i : inclination (deg) - capital_omega : argument of the ascending node (deg) - small_omega : argument of the perigee (deg) - nu : true anomaly (deg) - """ + + def __init__(self, mass, target_orbit): + """ Payload + :param mass: [description] + :type mass: [type] + :param target_orbit: [description] + :type target_orbit: TargetOrbit + """ + self.mass = mass self.target_orbit = target_orbit - self.perigee_altitude = target_orbit['a']*(1-target_orbit['e']) + self.perigee_altitude = target_orbit.a * (1 - target_orbit.e) -# def propagate_orbit(): -# """ -# """ + def __str__(self): + return 'Payload' + class Engine(): """ @@ -87,10 +91,65 @@ class Engine(): cycle_type='' - def __init__(self,oxidiser,fuel,thermo_cycle,exit_section_area): + def __init__(self, oxidiser, fuel, thermo_cycle, exit_section_area): """ """ self.oxidiser = oxidiser self.fuel = fuel self.thermo_cycle = thermo_cycle - self.exit_section_area = exit_section_area \ No newline at end of file + self.exit_section_area = exit_section_area + + def __str__(self): + return 'Engine' + +class TargetOrbit(): + + def __init__(self, a, e, i, capital_omega, small_omega, nu): + """[summary] + + :param a: semi_major axis (m) + :type a: [type] + :param e: eccentricity (adimentional) + :type e: [type] + :param i: inclination (deg) + :type i: [type] + :param capital_omega: argument of the ascending node (deg) + :type capital_omega: [type] + :param small_omega: argument of the perigee (deg) + :type small_omega: [type] + :param nu: [description] + :type nu: [type] + """ + self.a = a + self.e = e + self.i = i + self.capital_omega = capital_omega + self.small_omega = small_omega + self.nu = nu + + def __str__(self): + return ("TargetOrbit object\n" + "Semi major axis : {}\n" + "Exccentricity : {}\n" + "Inclination : {}\n" + "Argument of ascending node : {}\n" + "Argument of periapsis : {}\n" + "nu ? : {}\n").format(self.a,self.e,self.i,self.capital_omega,self.small_omega,self.nu) + + +if __name__ == '__main__': + + v_semiMajorAxis = 400000 # 400 km + v_eccentricity = 15 + v_inclination = 20 + v_ascendingNode = 5 + v_perigee = 5 + v_nu = 0 + + v_targetOrbit = TargetOrbit(v_semiMajorAxis, v_eccentricity, v_inclination, v_ascendingNode, v_perigee, v_nu) + print(v_targetOrbit) + v_payload = Payload(400, v_targetOrbit) + + + Rocket(Stage(1), Stage(2), v_payload, {'latitude':47,'longitude':2}) + \ No newline at end of file diff --git a/Engineering_tools.py b/Engineering_tools.py index 24184d7..bfaae6f 100755 --- a/Engineering_tools.py +++ b/Engineering_tools.py @@ -46,7 +46,7 @@ def final_target_vel(h, a): """ v_square = 2 * MU * ((1 / (R_T + h)) - (1 / (2 * a))) - print(((1 / (R_T + h)) - (1 / (2 * a)))) + print('{} > {}'.format((R_T + h), (2 * a))) assert v_square >= 0, 'error: square root only on positiv values' return np.sqrt(v_square) @@ -132,7 +132,7 @@ def standard_atmosphere(altitude): def laval_nozzle(Pt,Tt,Pamb,Ath,Ae,gamma,R,tolerance=1e-5): """Compute the thrust assuming a started nozzle - .. math:: Thrust = mass flow rate * exit velocity + (exit pressure - ambiant pressure) * exit area + .. math:: Thrust = massFlowRate \cdot exitVelocity + (exitPressure - ambiantPressure) \cdot exitArea :param Pt: total pressure in the combustion chambre (Pa) :type Pt: [type] -- GitLab From 7ec229d5a40657a15f1639e396d5587a0dc261c0 Mon Sep 17 00:00:00 2001 From: Vivien Date: Sat, 20 Jul 2019 13:43:00 +0200 Subject: [PATCH 32/37] add env --- Data_structure.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Data_structure.py b/Data_structure.py index 898e27a..2c887fd 100755 --- a/Data_structure.py +++ b/Data_structure.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on Sun May 12 19:51:18 2019 -- GitLab From 110546156c69f4dfe26cdfed888f1bb0fad546cd Mon Sep 17 00:00:00 2001 From: Vivien Date: Sat, 20 Jul 2019 18:32:48 +0200 Subject: [PATCH 33/37] supp import simpy --- Engineering_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engineering_tools.py b/Engineering_tools.py index bfaae6f..f61a37f 100755 --- a/Engineering_tools.py +++ b/Engineering_tools.py @@ -8,7 +8,7 @@ Created on Sun May 12 20:08:52 2019 import numpy as np from numpy import linalg as LA -import sympy + # Constants T_SIDE = 86164.10 # sidereal day (s) -- GitLab From 0c1bf1c69a475aa6cfba967b0e2a0fddbf79b3b6 Mon Sep 17 00:00:00 2001 From: Vivien Date: Sat, 20 Jul 2019 18:43:10 +0200 Subject: [PATCH 34/37] test data structure --- .gitlab-ci.yml | 3 ++- Engineering_tools.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6092c71..a3169fc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -56,4 +56,5 @@ job_test: script: - echo "test" - chmod u+rwx Test_Engineering_tools.py - - ./Test_Engineering_tools.py \ No newline at end of file + - ./Test_Engineering_tools.py + - ./Engineering_tools.py \ No newline at end of file diff --git a/Engineering_tools.py b/Engineering_tools.py index f61a37f..ce63feb 100755 --- a/Engineering_tools.py +++ b/Engineering_tools.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # - * - coding: utf-8 - * - """ Created on Sun May 12 20:08:52 2019 -- GitLab From ddb3d108c0f573027e82db07904017adcbbfabc0 Mon Sep 17 00:00:00 2001 From: Vivien Date: Sat, 20 Jul 2019 18:54:43 +0200 Subject: [PATCH 35/37] chmod on data struct --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a3169fc..84bbc00 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -56,5 +56,6 @@ job_test: script: - echo "test" - chmod u+rwx Test_Engineering_tools.py + - chmod u+rwx Engineering_tools.py - ./Test_Engineering_tools.py - ./Engineering_tools.py \ No newline at end of file -- GitLab From 0f6c1dabe3120ccdd2084794040286165531848f Mon Sep 17 00:00:00 2001 From: Vivien23 Date: Sat, 7 Sep 2019 18:38:48 +0200 Subject: [PATCH 36/37] Update Test_Engineering_tools.py --- Test_Engineering_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Test_Engineering_tools.py b/Test_Engineering_tools.py index b7eeaa3..dad89bc 100644 --- a/Test_Engineering_tools.py +++ b/Test_Engineering_tools.py @@ -21,7 +21,7 @@ class TestEngineeringTools(unittest.TestCase): def test_final_target_vel(self): - v_eject_altitude = 100 + v_eject_altitude = 100000 v_orbit_semi_major_axis = 637800000 v_f_velocity = final_target_vel(v_eject_altitude,v_orbit_semi_major_axis) -- GitLab From 5959dc2f6bdc91627228afcdfee2c42fa7b7841e Mon Sep 17 00:00:00 2001 From: Vivien23 Date: Sat, 7 Sep 2019 18:59:38 +0200 Subject: [PATCH 37/37] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 84bbc00..0d93248 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -57,5 +57,4 @@ job_test: - echo "test" - chmod u+rwx Test_Engineering_tools.py - chmod u+rwx Engineering_tools.py - - ./Test_Engineering_tools.py - - ./Engineering_tools.py \ No newline at end of file + - ./Test_Engineering_tools.py \ No newline at end of file -- GitLab