Incident shock polar diagrams for different pre-shock Mach numbers#

 1% -------------------------------------------------------------------------
 2% EXAMPLE: SHOCK_POLAR
 3%
 4% Compute shock polar plots at standard conditions (T = 300 K, p = 1 atm),
 5% and a set of initial shock front Mach numbers = [2, 3, 5, 14]
 6%   
 7% See wiki or setListspecies method from ChemicalSystem class for predefined
 8% sets of species
 9%
10% @author: Alberto Cuadra Lara
11%                 
12% Last update October 06 2025
13% -------------------------------------------------------------------------
14
15% Import packages
16import combustiontoolbox.databases.NasaDatabase
17import combustiontoolbox.core.*
18import combustiontoolbox.shockdetonation.*
19
20% Get Nasa database
21DB = NasaDatabase();
22
23% Define chemical system
24system = ChemicalSystem(DB);
25system.FLAG_ION = true;
26
27% Initialize mixture
28mix = Mixture(system);
29
30% Define chemical state
31set(mix, {'N2', 'O2', 'Ar', 'CO2'}, [78.084, 20.9476, 0.9365, 0.0319] / 20.9476);
32
33% Define properties
34mixArray1 = setProperties(mix, 'temperature', 300, 'pressure', 1.01325, 'M1', [2, 3, 5, 14]);
35
36% Initialize solver
37solver = ShockSolver('problemType', 'SHOCK_POLAR');
38
39% Solve problem
40[mixArray1, mixArray2] = solver.solveArray(mixArray1);
41
42% Generate report
43report(solver, mixArray1, mixArray2);