Shocking!
Objective: We want to design a Hypersonic Waverider release at mach 10 and a hundred thousand feet in altitude with the goal to travel the furthest. Based on these initial conditions we would like to calculate and track its trajectory. In order to achieve this, we would need to have a deep understand of Normal and Oblique Shock Theory.
Normal Shock Theory
This theory is based on a natural pneonoune, where the fastest way of communication between fluid particles is the speed of sound (sonic). This is means that when you travel below the speed of sound these fluid elements are able to move out of the way. However you go above the sonic speeds. This fluid particles are force out of the way. Imagine when you are travel through a busy train station during the holiday season and are forcefully pushing past people. That is essential what happens when an vehicle travels at or above sonic speeds. A normal shock is a shock where the shock wave that is normal or perpendicular (90) to the flow direction. The shock wave stands like a wall in front of the vehicle, causing the flow to slow from supersonic (Speeds over Mach 1 = speed of sound) before this "wall" to subsonic (speeds below Mach 1). All this kinetic energy is rapidly this transferred into heat and pressure. However, critically the Total(Stagnation) Temperature and Pressure drops; going back to the train station analogy as you push past people you are using your total energy in other energy of the system. However because of the friction pushing past other this cause the environments/your body temperature to raise.
Oblique Shock Theory
This theory is not a complete seperate thoery to the Normal Shock Theory but rather a sub-branch. The best way to understand this would be to split the flow into two directions one that is normal to the flow the other is that adjcent to the flow. The angle of which you mulitple the magnitudes to get the normal and adjcent components is the angle beta. The normal compoment of the flow its velocity, temperature, and pressure are not effect as this flow are traveling in the direction along the "wall" this doesn't expereince the effects described in Normal Shock Theory. The adjcent flow which will needs to forcefully force its way though "wall", thus leading to drop in velocity, total temperature and total pressure.
Design Philosophy
A waverider is hypersonic vehicle designed to "ride" its own shock wave. Instead of the shock wave being a nuisance (drag), we use Oblique Shock Theory to trap high pressure under the "wing" to generate lift. It is critical to try and obtain the formation of Oblique Shocks over Normal Shocks as it is much more effiencent from less total energy loss. A normal shock causes far more drag and pressure loss compared to its oblique counterpart a critical adoption to achieve one of our objectives. Taking the knowledge from these two theories lets try to form a geometry of our "wave rider".
To conceptualize the formation of a Caret Waverider, one must first imagine a simple, three-dimensional wedge placed within a supersonic flow field. As the air strikes the leading edge, the wedge generates a steady, planar oblique shock. In this inverse design method, we treat this shock plane not just as a physical phenomenon, but as the predefined bottom boundary of our vehicle's geometry. The physics of this choice is strategic: a shock wave induces a dramatic increase in static pressure. Since lift is generated by a net pressure differential between the lower and upper surfaces, the goal is to "trap" this high-pressure air directly beneath the vehicle. By carving a shape where the leading edge lies precisely on the shock wave, we create a specialized compression surface. This surface acts as a physical container—an inverted "V" shape—that prevents the high-pressure air from leaking around the sides. To complete the geometry, the upper surface is designed to be perfectly parallel to the incoming freestream flow. This ensures that the top of the vehicle creates no aerodynamic disturbance, expansion waves, or parasitic shocks. The result is a vehicle that essentially "glides" with extreme efficiency, riding atop its own shock wave to maximize the lift-to-drag ratio.


Trajectory and Optimizations
Now that we have the geometry of this waverider we are now task to map the trajectory with given known initial conditions (altitude, weight, initial velocity, no thermal limit (ignore material failures)). We can now build a simulation to find the key initial condition we are looking to optimize which is angle attack. This simulation acts as a "tale of two flights," seamlessly stitching together two completely different physics worlds. In the first phase, when the vehicle is moving at supersonic speeds, the code treats it like a surfboard riding on top of its own shock wave. Due to the exterme airspeeds the lift generated is so great such that it wants to throw the glider up into space, we implemented a "Stability System"; this autopilot monitors the climb rate and automatically nudges the nose down if it gets too steep, forcing the vehicle to convert that massive energy into forward distance rather than useless altitude.
However, the moment the vehicle slows down below the speed of sound, the physics engine effectively switches. The shock wave disappears, and the vehicle transforms from a sleek surfboard into a boring blunt wedge. To handle this, we added a "Subsonic Glide Computer" that immediately ignores your initial settings and pulls the nose up to the single most efficient angle to stretch the glide. Crucially, we also added a "Base Drag" penalty—acknowledging that the flat back of the vehicle creates a massive vacuum wake like a parachute—which ensures the vehicle realistically bleeds off energy and eventually lands, rather than bouncing indefinitely like a perpetual motion machine.
if mach > 1.05:
# === SUPERSONIC ===
# Use Fixed Angle, but limit ballooning
current_alpha = aoa_fixed
if gamma_path > 1.5: current_alpha = -1.0
else:
# === SUBSONIC (GLIDE OPTIMIZER) ===
K = 1 / np.pi
Cl_opt = np.sqrt(CD_SUBSONIC_BASE / K)
alpha_opt = Cl_opt / 0.08
current_alpha = alpha_opt
# --- AERODYNAMICS ---
if mach > 1.05:
theta = WEDGE_ANGLE + current_alpha
if theta < 0.01: theta = 0.01
beta = solve_beta(mach, theta, gamma_shock)
p_ratio = 1 + (2*gamma_shock/(gamma_shock+1)) * (mach**2 * np.sin(beta)**2 - 1)
p2 = p_ratio * P_inf
L = (p2 - P_inf) * S_REF * np.cos(np.radians(current_alpha))
D = (p2 - P_inf) * S_REF * np.sin(np.radians(current_alpha)) + (0.5 * rho * v**2 * S_REF * 2 * CF)
else:
q = 0.5 * rho * v**2
Cl = 0.08 * current_alpha
Cd = CD_SUBSONIC_BASE + (Cl**2) / np.pi
L = q * S_REF * Cl
D = q * S_REF * Cd
# --- EOM ---
g_rad = np.radians(gamma_path)
dv = (-D - MASS * G * np.sin(g_rad)) / MASS * DT
dg = (L - MASS * G * np.cos(g_rad)) / (MASS * v) * DT
v += dv
gamma_path += np.degrees(dg)
h += v * np.sin(np.radians(gamma_path)) * DT
x += v * np.cos(np.radians(gamma_path)) * DT
