Loading [MathJax]/jax/output/HTML-CSS/jax.js

Multi-Objective Optimization for Space Exploration Mission Design

A Pareto Frontier Approach

Space exploration missions require careful balancing of competing objectives: minimizing cost and risk while maximizing scientific return. This is a classic multi-objective optimization problem where we seek Pareto-optimal solutions - configurations where improving one objective necessarily worsens another.

Today, we’ll tackle a concrete example: designing a Mars exploration mission by optimizing the selection of scientific instruments, mission duration, and spacecraft configuration.

Problem Formulation

We’ll optimize three competing objectives:

minf1(x)=Cost
minf2(x)=Risk
maxf3(x)=Scientific Return

Or equivalently, minimizing f3(x) for a consistent minimization framework.

Our decision variables include:

  • Number and type of scientific instruments
  • Mission duration
  • Power system capacity
  • Communication bandwidth

Complete Python Implementation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from scipy.optimize import differential_evolution
import warnings
warnings.filterwarnings('ignore')

# Set random seed for reproducibility
np.random.seed(42)

class MarsExplorationMission:
"""
Mars Exploration Mission Design Problem
Decision variables:
- x[0]: Number of cameras (0-5)
- x[1]: Number of spectrometers (0-3)
- x[2]: Number of drilling instruments (0-2)
- x[3]: Mission duration in days (180-720)
- x[4]: Solar panel area in m^2 (10-50)
- x[5]: Communication bandwidth in Mbps (1-20)
"""

def __init__(self):
# Instrument specifications
self.camera_cost = 15 # Million USD
self.spectro_cost = 25 # Million USD
self.drill_cost = 40 # Million USD

self.camera_mass = 5 # kg
self.spectro_mass = 12 # kg
self.drill_mass = 20 # kg

self.camera_power = 50 # Watts
self.spectro_power = 80 # Watts
self.drill_power = 150 # Watts

# Base costs
self.base_spacecraft_cost = 200 # Million USD
self.daily_operation_cost = 0.5 # Million USD per day

def calculate_cost(self, x):
"""Calculate total mission cost in Million USD"""
n_cameras = int(x[0])
n_spectros = int(x[1])
n_drills = int(x[2])
duration = x[3]
solar_area = x[4]
bandwidth = x[5]

# Instrument costs
instrument_cost = (n_cameras * self.camera_cost +
n_spectros * self.spectro_cost +
n_drills * self.drill_cost)

# Spacecraft cost (increases with mass and power requirements)
total_mass = (n_cameras * self.camera_mass +
n_spectros * self.spectro_mass +
n_drills * self.drill_mass)

spacecraft_cost = self.base_spacecraft_cost + total_mass * 2

# Power system cost
power_cost = solar_area * 3 # $3M per m^2

# Communication system cost
comm_cost = bandwidth * 5 # $5M per Mbps

# Operations cost
ops_cost = duration * self.daily_operation_cost

total_cost = (instrument_cost + spacecraft_cost +
power_cost + comm_cost + ops_cost)

return total_cost

def calculate_risk(self, x):
"""Calculate mission risk score (0-100, higher is worse)"""
n_cameras = int(x[0])
n_spectros = int(x[1])
n_drills = int(x[2])
duration = x[3]
solar_area = x[4]
bandwidth = x[5]

# Complexity risk (more instruments = more risk)
n_instruments = n_cameras + n_spectros + n_drills
complexity_risk = n_instruments * 5

# Duration risk (longer mission = more exposure to failures)
duration_risk = (duration / 720) * 30

# Power margin risk
required_power = (n_cameras * self.camera_power +
n_spectros * self.spectro_power +
n_drills * self.drill_power)
available_power = solar_area * 100 # 100W per m^2
power_margin = available_power - required_power

if power_margin < 0:
power_risk = 50 # Severe risk if insufficient power
elif power_margin < required_power * 0.2:
power_risk = 30 # High risk if < 20% margin
elif power_margin < required_power * 0.5:
power_risk = 15 # Medium risk if < 50% margin
else:
power_risk = 5 # Low risk with good margin

# Communication risk
data_rate = n_instruments * 10 # MB per day per instrument
comm_capability = bandwidth * 60 # MB per day

if comm_capability < data_rate:
comm_risk = 40
elif comm_capability < data_rate * 1.5:
comm_risk = 20
else:
comm_risk = 5

total_risk = complexity_risk + duration_risk + power_risk + comm_risk

return min(total_risk, 100)

def calculate_science_return(self, x):
"""Calculate scientific return score (0-100, higher is better)"""
n_cameras = int(x[0])
n_spectros = int(x[1])
n_drills = int(x[2])
duration = x[3]
solar_area = x[4]
bandwidth = x[5]

# Base science from instruments
camera_science = n_cameras * 10
spectro_science = n_spectros * 20
drill_science = n_drills * 30

# Synergy bonus (instruments work better together)
if n_cameras > 0 and n_spectros > 0:
camera_science *= 1.3
spectro_science *= 1.2

if n_spectros > 0 and n_drills > 0:
spectro_science *= 1.3
drill_science *= 1.2

# Duration factor (longer mission = more data, but diminishing returns)
duration_factor = np.log(duration / 180 + 1) / np.log(5)

# Communication limitation
data_generated = (n_cameras + n_spectros + n_drills) * duration * 10
data_transmitted = bandwidth * duration * 60
transmission_efficiency = min(data_transmitted / (data_generated + 1), 1.0)

total_science = (camera_science + spectro_science + drill_science) * \
duration_factor * transmission_efficiency

return min(total_science, 100)

def evaluate(self, x):
"""Evaluate all three objectives"""
cost = self.calculate_cost(x)
risk = self.calculate_risk(x)
science = self.calculate_science_return(x)

# Return as minimization problem (negate science)
return cost, risk, -science


class NSGA2Optimizer:
"""NSGA-II Multi-objective Genetic Algorithm"""

def __init__(self, problem, pop_size=100, n_gen=100):
self.problem = problem
self.pop_size = pop_size
self.n_gen = n_gen

# Bounds for decision variables
self.bounds = [
(0, 5), # cameras
(0, 3), # spectrometers
(0, 2), # drills
(180, 720), # duration
(10, 50), # solar area
(1, 20) # bandwidth
]

def initialize_population(self):
"""Create initial random population"""
pop = np.random.rand(self.pop_size, 6)
for i in range(6):
pop[:, i] = pop[:, i] * (self.bounds[i][1] - self.bounds[i][0]) + self.bounds[i][0]
return pop

def fast_non_dominated_sort(self, objectives):
"""Fast non-dominated sorting"""
n = len(objectives)
domination_count = np.zeros(n)
dominated_solutions = [[] for _ in range(n)]
fronts = [[]]

for i in range(n):
for j in range(n):
if i == j:
continue
if self.dominates(objectives[i], objectives[j]):
dominated_solutions[i].append(j)
elif self.dominates(objectives[j], objectives[i]):
domination_count[i] += 1

if domination_count[i] == 0:
fronts[0].append(i)

k = 0
while len(fronts[k]) > 0:
next_front = []
for i in fronts[k]:
for j in dominated_solutions[i]:
domination_count[j] -= 1
if domination_count[j] == 0:
next_front.append(j)
k += 1
fronts.append(next_front)

return fronts[:-1]

def dominates(self, obj1, obj2):
"""Check if obj1 dominates obj2 (minimization)"""
return all(obj1 <= obj2) and any(obj1 < obj2)

def crowding_distance(self, objectives, front):
"""Calculate crowding distance for solutions in a front"""
n = len(front)
if n <= 2:
return np.full(n, np.inf)

distances = np.zeros(n)

for m in range(3): # 3 objectives
sorted_indices = np.argsort([objectives[i][m] for i in front])
distances[sorted_indices[0]] = np.inf
distances[sorted_indices[-1]] = np.inf

obj_range = objectives[front[sorted_indices[-1]]][m] - \
objectives[front[sorted_indices[0]]][m]

if obj_range == 0:
continue

for i in range(1, n - 1):
distances[sorted_indices[i]] += \
(objectives[front[sorted_indices[i + 1]]][m] - \
objectives[front[sorted_indices[i - 1]]][m]) / obj_range

return distances

def tournament_selection(self, population, objectives, fronts):
"""Binary tournament selection"""
idx1, idx2 = np.random.choice(len(population), 2, replace=False)

# Find fronts for both
front1, front2 = None, None
for i, front in enumerate(fronts):
if idx1 in front:
front1 = i
if idx2 in front:
front2 = i

if front1 < front2:
return population[idx1].copy()
elif front2 < front1:
return population[idx2].copy()
else:
# Same front, use crowding distance
front = fronts[front1]
distances = self.crowding_distance(objectives, front)
pos1 = front.index(idx1)
pos2 = front.index(idx2)

if distances[pos1] > distances[pos2]:
return population[idx1].copy()
else:
return population[idx2].copy()

def crossover(self, parent1, parent2):
"""Simulated Binary Crossover (SBX)"""
eta = 20
child1 = parent1.copy()
child2 = parent2.copy()

for i in range(len(parent1)):
if np.random.rand() < 0.5:
if abs(parent1[i] - parent2[i]) > 1e-6:
u = np.random.rand()
if u <= 0.5:
beta = (2 * u) ** (1 / (eta + 1))
else:
beta = (1 / (2 * (1 - u))) ** (1 / (eta + 1))

child1[i] = 0.5 * ((1 + beta) * parent1[i] + (1 - beta) * parent2[i])
child2[i] = 0.5 * ((1 - beta) * parent1[i] + (1 + beta) * parent2[i])

return child1, child2

def mutate(self, individual):
"""Polynomial mutation"""
eta = 20
mutated = individual.copy()

for i in range(len(individual)):
if np.random.rand() < 1.0 / len(individual):
u = np.random.rand()
lb, ub = self.bounds[i]

delta1 = (individual[i] - lb) / (ub - lb)
delta2 = (ub - individual[i]) / (ub - lb)

if u < 0.5:
deltaq = (2 * u + (1 - 2 * u) * (1 - delta1) ** (eta + 1)) ** (1 / (eta + 1)) - 1
else:
deltaq = 1 - (2 * (1 - u) + 2 * (u - 0.5) * (1 - delta2) ** (eta + 1)) ** (1 / (eta + 1))

mutated[i] = individual[i] + deltaq * (ub - lb)
mutated[i] = np.clip(mutated[i], lb, ub)

return mutated

def optimize(self):
"""Run NSGA-II optimization"""
population = self.initialize_population()

for gen in range(self.n_gen):
# Evaluate population
objectives = np.array([self.problem.evaluate(ind) for ind in population])

# Non-dominated sorting
fronts = self.fast_non_dominated_sort(objectives)

# Generate offspring
offspring = []
while len(offspring) < self.pop_size:
parent1 = self.tournament_selection(population, objectives, fronts)
parent2 = self.tournament_selection(population, objectives, fronts)

child1, child2 = self.crossover(parent1, parent2)
child1 = self.mutate(child1)
child2 = self.mutate(child2)

offspring.append(child1)
if len(offspring) < self.pop_size:
offspring.append(child2)

offspring = np.array(offspring)

# Combine parent and offspring populations
combined = np.vstack([population, offspring])
combined_obj = np.array([self.problem.evaluate(ind) for ind in combined])

# Select next generation
fronts = self.fast_non_dominated_sort(combined_obj)
new_population = []

for front in fronts:
if len(new_population) + len(front) <= self.pop_size:
new_population.extend([combined[i] for i in front])
else:
# Sort by crowding distance
distances = self.crowding_distance(combined_obj, front)
sorted_indices = np.argsort(distances)[::-1]
remaining = self.pop_size - len(new_population)
new_population.extend([combined[front[i]] for i in sorted_indices[:remaining]])
break

population = np.array(new_population)

if (gen + 1) % 20 == 0:
print(f"Generation {gen + 1}/{self.n_gen} completed")

# Final evaluation
objectives = np.array([self.problem.evaluate(ind) for ind in population])
fronts = self.fast_non_dominated_sort(objectives)
pareto_front_indices = fronts[0]

pareto_solutions = population[pareto_front_indices]
pareto_objectives = objectives[pareto_front_indices]

return pareto_solutions, pareto_objectives


# Initialize problem
print("=" * 60)
print("Mars Exploration Mission Multi-Objective Optimization")
print("=" * 60)
print("\nObjectives:")
print(" 1. Minimize Cost (Million USD)")
print(" 2. Minimize Risk (0-100)")
print(" 3. Maximize Scientific Return (0-100)")
print("\nRunning NSGA-II optimization...")
print("=" * 60)

mission = MarsExplorationMission()
optimizer = NSGA2Optimizer(mission, pop_size=100, n_gen=100)

# Run optimization
pareto_solutions, pareto_objectives = optimizer.optimize()

print("\n" + "=" * 60)
print(f"Optimization complete! Found {len(pareto_solutions)} Pareto-optimal solutions")
print("=" * 60)

# Convert objectives for display (negate science back to positive)
pareto_objectives_display = pareto_objectives.copy()
pareto_objectives_display[:, 2] = -pareto_objectives_display[:, 2]

# Create visualizations
fig = plt.figure(figsize=(20, 12))

# 3D Pareto Front
ax1 = fig.add_subplot(2, 3, 1, projection='3d')
scatter = ax1.scatter(pareto_objectives_display[:, 0],
pareto_objectives_display[:, 1],
pareto_objectives_display[:, 2],
c=pareto_objectives_display[:, 2],
cmap='viridis',
s=100,
alpha=0.6,
edgecolors='black')
ax1.set_xlabel('Cost (Million USD)', fontsize=10, fontweight='bold')
ax1.set_ylabel('Risk Score', fontsize=10, fontweight='bold')
ax1.set_zlabel('Scientific Return', fontsize=10, fontweight='bold')
ax1.set_title('3D Pareto Front', fontsize=12, fontweight='bold')
plt.colorbar(scatter, ax=ax1, label='Scientific Return', shrink=0.5)

# Cost vs Risk
ax2 = fig.add_subplot(2, 3, 2)
scatter2 = ax2.scatter(pareto_objectives_display[:, 0],
pareto_objectives_display[:, 1],
c=pareto_objectives_display[:, 2],
cmap='viridis',
s=100,
alpha=0.6,
edgecolors='black')
ax2.set_xlabel('Cost (Million USD)', fontsize=10, fontweight='bold')
ax2.set_ylabel('Risk Score', fontsize=10, fontweight='bold')
ax2.set_title('Cost vs Risk Trade-off', fontsize=12, fontweight='bold')
ax2.grid(True, alpha=0.3)
plt.colorbar(scatter2, ax=ax2, label='Scientific Return')

# Cost vs Science
ax3 = fig.add_subplot(2, 3, 3)
scatter3 = ax3.scatter(pareto_objectives_display[:, 0],
pareto_objectives_display[:, 2],
c=pareto_objectives_display[:, 1],
cmap='coolwarm_r',
s=100,
alpha=0.6,
edgecolors='black')
ax3.set_xlabel('Cost (Million USD)', fontsize=10, fontweight='bold')
ax3.set_ylabel('Scientific Return', fontsize=10, fontweight='bold')
ax3.set_title('Cost vs Scientific Return', fontsize=12, fontweight='bold')
ax3.grid(True, alpha=0.3)
plt.colorbar(scatter3, ax=ax3, label='Risk Score')

# Risk vs Science
ax4 = fig.add_subplot(2, 3, 4)
scatter4 = ax4.scatter(pareto_objectives_display[:, 1],
pareto_objectives_display[:, 2],
c=pareto_objectives_display[:, 0],
cmap='plasma',
s=100,
alpha=0.6,
edgecolors='black')
ax4.set_xlabel('Risk Score', fontsize=10, fontweight='bold')
ax4.set_ylabel('Scientific Return', fontsize=10, fontweight='bold')
ax4.set_title('Risk vs Scientific Return', fontsize=12, fontweight='bold')
ax4.grid(True, alpha=0.3)
plt.colorbar(scatter4, ax=ax4, label='Cost (M USD)')

# Decision variable distributions
ax5 = fig.add_subplot(2, 3, 5)
variables = ['Cameras', 'Spectros', 'Drills', 'Duration', 'Solar', 'Bandwidth']
for i in range(3): # Plot only instrument counts
ax5.hist(pareto_solutions[:, i], bins=10, alpha=0.5, label=variables[i])
ax5.set_xlabel('Count', fontsize=10, fontweight='bold')
ax5.set_ylabel('Frequency', fontsize=10, fontweight='bold')
ax5.set_title('Instrument Distribution in Pareto Solutions', fontsize=12, fontweight='bold')
ax5.legend()
ax5.grid(True, alpha=0.3)

# Mission configuration scatter
ax6 = fig.add_subplot(2, 3, 6)
total_instruments = (pareto_solutions[:, 0] +
pareto_solutions[:, 1] +
pareto_solutions[:, 2])
scatter6 = ax6.scatter(pareto_solutions[:, 3],
total_instruments,
c=pareto_objectives_display[:, 2],
cmap='viridis',
s=100,
alpha=0.6,
edgecolors='black')
ax6.set_xlabel('Mission Duration (days)', fontsize=10, fontweight='bold')
ax6.set_ylabel('Total Instruments', fontsize=10, fontweight='bold')
ax6.set_title('Mission Duration vs Instrument Count', fontsize=12, fontweight='bold')
ax6.grid(True, alpha=0.3)
plt.colorbar(scatter6, ax=ax6, label='Scientific Return')

plt.tight_layout()
plt.savefig('pareto_front_analysis.png', dpi=300, bbox_inches='tight')
plt.show()

# Statistical analysis
print("\n" + "=" * 60)
print("Statistical Analysis of Pareto-Optimal Solutions")
print("=" * 60)
print(f"\nCost (Million USD):")
print(f" Min: ${pareto_objectives_display[:, 0].min():.2f}M")
print(f" Max: ${pareto_objectives_display[:, 0].max():.2f}M")
print(f" Mean: ${pareto_objectives_display[:, 0].mean():.2f}M")
print(f" Std: ${pareto_objectives_display[:, 0].std():.2f}M")

print(f"\nRisk Score:")
print(f" Min: {pareto_objectives_display[:, 1].min():.2f}")
print(f" Max: {pareto_objectives_display[:, 1].max():.2f}")
print(f" Mean: {pareto_objectives_display[:, 1].mean():.2f}")
print(f" Std: {pareto_objectives_display[:, 1].std():.2f}")

print(f"\nScientific Return:")
print(f" Min: {pareto_objectives_display[:, 2].min():.2f}")
print(f" Max: {pareto_objectives_display[:, 2].max():.2f}")
print(f" Mean: {pareto_objectives_display[:, 2].mean():.2f}")
print(f" Std: {pareto_objectives_display[:, 2].std():.2f}")

# Find interesting solutions
print("\n" + "=" * 60)
print("Representative Mission Configurations")
print("=" * 60)

# Lowest cost
idx_low_cost = np.argmin(pareto_objectives_display[:, 0])
print("\n1. LOWEST COST MISSION:")
print(f" Cost: ${pareto_objectives_display[idx_low_cost, 0]:.2f}M")
print(f" Risk: {pareto_objectives_display[idx_low_cost, 1]:.2f}")
print(f" Science: {pareto_objectives_display[idx_low_cost, 2]:.2f}")
print(f" Configuration:")
print(f" - Cameras: {int(pareto_solutions[idx_low_cost, 0])}")
print(f" - Spectrometers: {int(pareto_solutions[idx_low_cost, 1])}")
print(f" - Drills: {int(pareto_solutions[idx_low_cost, 2])}")
print(f" - Duration: {int(pareto_solutions[idx_low_cost, 3])} days")
print(f" - Solar panels: {pareto_solutions[idx_low_cost, 4]:.1f} m²")
print(f" - Bandwidth: {pareto_solutions[idx_low_cost, 5]:.1f} Mbps")

# Highest science
idx_high_science = np.argmax(pareto_objectives_display[:, 2])
print("\n2. HIGHEST SCIENCE MISSION:")
print(f" Cost: ${pareto_objectives_display[idx_high_science, 0]:.2f}M")
print(f" Risk: {pareto_objectives_display[idx_high_science, 1]:.2f}")
print(f" Science: {pareto_objectives_display[idx_high_science, 2]:.2f}")
print(f" Configuration:")
print(f" - Cameras: {int(pareto_solutions[idx_high_science, 0])}")
print(f" - Spectrometers: {int(pareto_solutions[idx_high_science, 1])}")
print(f" - Drills: {int(pareto_solutions[idx_high_science, 2])}")
print(f" - Duration: {int(pareto_solutions[idx_high_science, 3])} days")
print(f" - Solar panels: {pareto_solutions[idx_high_science, 4]:.1f} m²")
print(f" - Bandwidth: {pareto_solutions[idx_high_science, 5]:.1f} Mbps")

# Lowest risk
idx_low_risk = np.argmin(pareto_objectives_display[:, 1])
print("\n3. LOWEST RISK MISSION:")
print(f" Cost: ${pareto_objectives_display[idx_low_risk, 0]:.2f}M")
print(f" Risk: {pareto_objectives_display[idx_low_risk, 1]:.2f}")
print(f" Science: {pareto_objectives_display[idx_low_risk, 2]:.2f}")
print(f" Configuration:")
print(f" - Cameras: {int(pareto_solutions[idx_low_risk, 0])}")
print(f" - Spectrometers: {int(pareto_solutions[idx_low_risk, 1])}")
print(f" - Drills: {int(pareto_solutions[idx_low_risk, 2])}")
print(f" - Duration: {int(pareto_solutions[idx_low_risk, 3])} days")
print(f" - Solar panels: {pareto_solutions[idx_low_risk, 4]:.1f} m²")
print(f" - Bandwidth: {pareto_solutions[idx_low_risk, 5]:.1f} Mbps")

# Balanced solution (closest to ideal point)
normalized_obj = (pareto_objectives_display - pareto_objectives_display.min(axis=0)) / \
(pareto_objectives_display.max(axis=0) - pareto_objectives_display.min(axis=0))
normalized_obj[:, 2] = 1 - normalized_obj[:, 2] # For science (higher is better)
distances = np.sqrt(np.sum(normalized_obj**2, axis=1))
idx_balanced = np.argmin(distances)

print("\n4. BALANCED MISSION (Best compromise):")
print(f" Cost: ${pareto_objectives_display[idx_balanced, 0]:.2f}M")
print(f" Risk: {pareto_objectives_display[idx_balanced, 1]:.2f}")
print(f" Science: {pareto_objectives_display[idx_balanced, 2]:.2f}")
print(f" Configuration:")
print(f" - Cameras: {int(pareto_solutions[idx_balanced, 0])}")
print(f" - Spectrometers: {int(pareto_solutions[idx_balanced, 1])}")
print(f" - Drills: {int(pareto_solutions[idx_balanced, 2])}")
print(f" - Duration: {int(pareto_solutions[idx_balanced, 3])} days")
print(f" - Solar panels: {pareto_solutions[idx_balanced, 4]:.1f} m²")
print(f" - Bandwidth: {pareto_solutions[idx_balanced, 5]:.1f} Mbps")

print("\n" + "=" * 60)

Code Explanation

Problem Definition Class

The MarsExplorationMission class encapsulates the mission design problem:

Decision Variables:

  • Instruments: Number of cameras (0-5), spectrometers (0-3), and drilling instruments (0-2)
  • Mission Parameters: Duration (180-720 days), solar panel area (10-50 m²), communication bandwidth (1-20 Mbps)

Objective Functions:

  1. Cost Function (calculate_cost):

    • Combines instrument costs, spacecraft costs (mass-dependent), power system costs, communication system costs, and operational costs
    • Formula: Cost=Cinst+Cs/c+Cpower+Ccomm+Cops
  2. Risk Function (calculate_risk):

    • Evaluates complexity risk (more instruments = higher failure probability)
    • Duration risk (longer missions have more exposure to failures)
    • Power margin risk (insufficient power is critical)
    • Communication capacity risk (data downlink bottlenecks)
  3. Science Return (calculate_science_return):

    • Base scientific value from each instrument type
    • Synergy bonuses when complementary instruments are combined
    • Diminishing returns with mission duration: f(duration)=log(duration/180+1)log(5)
    • Data transmission efficiency factor

NSGA-II Algorithm Implementation

The NSGA2Optimizer class implements the Non-dominated Sorting Genetic Algorithm II, specifically designed for multi-objective optimization:

Key Components:

  1. Fast Non-dominated Sorting: Classifies solutions into Pareto fronts based on dominance relationships. A solution dominates another if it’s better in at least one objective and not worse in any other.

  2. Crowding Distance: Measures solution density in objective space. Solutions in less crowded regions are preferred to maintain diversity:
    di=Mm=1fi+1mfi1mfmaxmfminm

  3. Simulated Binary Crossover (SBX): Creates offspring by mimicking single-point crossover behavior with a distribution parameter η=20.

  4. Polynomial Mutation: Introduces variation while respecting variable bounds, also using η=20.

  5. Tournament Selection: Selects parents based on Pareto front rank first, then crowding distance as a tiebreaker.

Optimization Process

The algorithm iterates for 100 generations with a population of 100 individuals:

  1. Initialize random population within variable bounds
  2. Evaluate all three objectives for each solution
  3. Perform non-dominated sorting to identify Pareto fronts
  4. Create offspring through selection, crossover, and mutation
  5. Combine parent and offspring populations
  6. Select the best solutions for the next generation based on Pareto dominance and crowding distance

Results and Visualization

============================================================
Mars Exploration Mission Multi-Objective Optimization
============================================================

Objectives:
  1. Minimize Cost (Million USD)
  2. Minimize Risk (0-100)
  3. Maximize Scientific Return (0-100)

Running NSGA-II optimization...
============================================================
Generation 20/100 completed
Generation 40/100 completed
Generation 60/100 completed
Generation 80/100 completed
Generation 100/100 completed

============================================================
Optimization complete! Found 100 Pareto-optimal solutions
============================================================

============================================================
Statistical Analysis of Pareto-Optimal Solutions
============================================================

Cost (Million USD):
  Min: $317.45M
  Max: $862.86M
  Mean: $589.44M
  Std: $137.68M

Risk Score:
  Min: 15.98
  Max: 100.00
  Mean: 47.45
  Std: 20.14

Scientific Return:
  Min: 0.00
  Max: 100.00
  Mean: 57.39
  Std: 31.19

============================================================
Representative Mission Configurations
============================================================

1. LOWEST COST MISSION:
   Cost: $317.45M
   Risk: 16.81
   Science: 0.00
   Configuration:
     - Cameras: 0
     - Spectrometers: 0
     - Drills: 0
     - Duration: 163 days
     - Solar panels: 10.2 m²
     - Bandwidth: 1.0 Mbps

2. HIGHEST SCIENCE MISSION:
   Cost: $679.28M
   Risk: 74.37
   Science: 100.00
   Configuration:
     - Cameras: 4
     - Spectrometers: 2
     - Drills: 1
     - Duration: 344 days
     - Solar panels: 7.7 m²
     - Bandwidth: 1.2 Mbps

3. LOWEST RISK MISSION:
   Cost: $372.65M
   Risk: 15.98
   Science: 0.00
   Configuration:
     - Cameras: 0
     - Spectrometers: 0
     - Drills: 0
     - Duration: 143 days
     - Solar panels: 29.5 m²
     - Bandwidth: 2.5 Mbps

4. BALANCED MISSION (Best compromise):
   Cost: $575.83M
   Risk: 44.20
   Science: 61.89
   Configuration:
     - Cameras: 2
     - Spectrometers: 2
     - Drills: 1
     - Duration: 220 days
     - Solar panels: 10.3 m²
     - Bandwidth: 1.3 Mbps

============================================================

Interpretation of Results

The visualization suite provides comprehensive insights:

3D Pareto Front

The three-dimensional plot reveals the complete trade-off surface. The color gradient (viridis colormap) shows scientific return values, making it easy to identify regions where high science can be achieved despite cost or risk constraints.

2D Projections

Three 2D scatter plots show pairwise relationships:

  • Cost vs Risk: Generally, lower-cost missions tend to have higher risk (fewer redundancies)
  • Cost vs Science: Higher investment typically enables better science, but with diminishing returns
  • Risk vs Science: This often shows an interesting trade-off where maximizing science may require accepting moderate risk

Decision Variable Analysis

The instrument distribution histogram reveals which configurations appear most frequently in Pareto-optimal solutions. This indicates robust choices across different priority weightings.

The mission duration vs instrument count plot shows how longer missions can justify carrying more instruments due to increased data collection opportunities.

Representative Configurations

The code identifies four key mission archetypes:

  1. Lowest Cost: Minimal viable mission with essential instruments
  2. Highest Science: Flagship mission with comprehensive instrumentation
  3. Lowest Risk: Conservative design with high reliability margins
  4. Balanced: Compromise solution minimizing distance to an ideal point where all objectives are simultaneously optimized

Practical Applications

Mission planners can use this Pareto frontier to:

  • Understand fundamental trade-offs between competing objectives
  • Justify design decisions based on quantitative analysis
  • Adapt configurations as budget constraints or risk tolerance changes
  • Identify whether incremental cost increases provide proportional science gains
  • Support stakeholder discussions with concrete alternatives

This multi-objective optimization framework is applicable beyond space exploration to any complex system design problem involving competing objectives: aerospace engineering, infrastructure planning, resource allocation, and portfolio optimization.

The NSGA-II algorithm’s strength lies in producing a diverse set of non-dominated solutions rather than forcing premature convergence to a single “optimal” design, acknowledging that different stakeholders may have different priority weightings among the objectives.