NE 415 Notes¶
These draft notes support NE 415 - Introduction to Engineering Analysis.
- Prologue
- Lesson 1 - An Introduction to Python, Spyder, and Jupyter
- Lesson 2 - Basic Operators and Common, Built-In Functions
- Lesson 3 - One-Dimensional Data Processing with NumPy and Matplotlib
- Lesson 4 - Two-Dimensional Data Processing with NumPy and Matplotlib
- Lesson 5 - Monte Carlo First
- Objectives
- Why Monte Carlo first?
- Models, simulations, and observables
- Deterministic and stochastic views
- A first physical example: attenuation through a slab
- Random numbers as computational coins
- Probability is not observed frequency
- The Monte Carlo pattern
- A brief historical note
- A toy source-detector problem
- Rules for one neutron history
- Flowchart before code
- Python implementation
- Reading the output
- What changes the model? What changes the run?
- What we have already used
- Deterministic and Monte Carlo views of the same problem
- Looking ahead
- Lesson 6 - Random Variables and Distributions
- Lesson 7 - Sampling Discrete and Continuous Random Variables
- Lesson 8 - Statistics and Estimators
- Lesson 9 - Engineering the Simulation
- Introduction
- The simulation-engineering workflow
- Keep notebooks tidy and reproducible
- Design functions before writing long simulations
- Unit tests: small checks with known answers
- Defensive programming: fail early and clearly
- Random number generators and reproducibility
- Flowcharts: making the algorithm visible
- Repeatable runs
- Documentation habits for student projects
- Bridge to Lesson 10
- References and further reading
- Lesson 10 - From Balance Laws to Linear Systems
- Lesson 11 - Matrix and Vector Operations
- Why this chapter follows balance laws
- Vectors as ordered data
- Dot products as weighted sums
- Matrix-vector products: the row view
- Matrix-vector products: the column view
- The loop pattern behind matrix-vector multiplication
- Cost of a dense matrix-vector product
- Matrix-matrix products
- Array shapes and noncommutativity
- Transposes
- Permutation matrices
- Residuals revisited
- Exercises
- End-of-lecture summary
- Lesson 12 - One Matrix, Many Scenarios
- The repeated-solve pattern
- A small example with several sources
- Elimination: removing coupling step by step
- Augmented matrices for bookkeeping
- Back substitution
- From elimination to LU
- Pivoting
- Using SciPy for reusable solves
- Why not compute the inverse?
- Checking many solutions at once
- Exercises
- End-of-lecture summary
- Lesson 13 - Symbolic Computation with SymPy
- Why symbolic computation belongs here
- Symbols and expressions
- Equations are not assignments
- A two-cell symbolic balance model
- Matrix methods in SymPy
- Substitution and numerical evaluation
- Simplify, expand, factor, and collect
- Turning symbolic expressions into numerical functions
- Symbolic versus numerical workflows
- Exercises
- End-of-lecture summary
- Lesson 14 - Norms, Sparse Matrices, and Iterative Methods
- The basic question
- Vector norms
- Residual versus error
- Why sparsity appears
- Sparse matrices in SciPy
- Direct solves and fill-in
- Never form the inverse
- From physics to fixed-point iteration
- Jacobi and Gauss–Seidel as corrected residual updates
- Convergence as error multiplication
- Why this leads to subspaces
- Exercises
- End-of-lecture summary
- Lesson 15 - Orthogonality, Gram-Schmidt, and Projection
- Lesson 16 - One Eigenpair from Iteration
- Lesson 17 - The Whole Spectrum at Once
- Lesson 18 - Eigenvalue Applications
- What eigenvalues add to the story
- Discrete-time growth and decay
- Stability of an iterative method
- A transport-motivated mode calculation
- Continuous-time systems
- Coupled variables move as modes
- A simplified two-group reactor-physics eigenproblem
- Subcritical, critical, and supercritical interpretation
- Full-spectrum versus dominant-mode thinking
- Communicating an eigenvalue result
- Exercises
- End-of-lecture summary
- Lesson 19 - Numerical Differentiation
- Lesson 20 - Numerical Integration
- Lesson 21 - Nonlinear Equations
- Lesson 22 - Unconstrained Optimization
- Lesson 23 - Constrained Optimization
- Overview, Objectives, and Key Terms
- Start With the
minimizeConvention - Where
linprogDeviates - Picking the Right SciPy Tool
- Case Study 1: When Should We Count an Activated Sample?
- Boundaries, Active Constraints, and a Tiny Bit of Theory
- Example 2: Minimum-Cost Shielding With a Nonlinear Dose Response
- Example 3: A Linear Attenuation-Budget Model for
linprog - A Practical Decision Rule
- Reading Solver Output
- Further Reading
- Lesson 24 - Modeling Data with Least-Squares Fits
- Lesson 25 - Modeling Data with Interpolation
- Lesson 26 - Advection, Diffusion, and Reaction Models
- Overview, Objectives, and Key Terms
- The L10 Picture Still Works
- Count Beans Before Writing Derivatives
- The Integral Balance
- Mechanisms Are Easier When Units Lead
- From Integral Balance to Continuum Model
- One Parent Balance, Several Child Models
- Named-State Balances: U-238 to Pu-239 as a Linear Chain
- Geometry Changes the Weights, Not the Bookkeeping
- Finite Differences Enforce the Same Balance
- A Steady Diffusion-Reaction Row
- What To Carry Forward
- Lesson 27 - Solving ODEs Symbolically
- Overview, Objectives, and Key Terms
- From L26 to L27
- Symbols Are Not Functions
- A Reusable Symbolic Scaffold
- Example 1: Pure Reaction with a Constant Source
- Example 2: Steady Advection-Reaction in a Flow
- Ansatz: Guess a Shape, Reduce to Algebra
- PDE Example: Separation of Variables
- Boundary Conditions Select the Allowed Modes
- What SymPy Is Really Buying Us
- Lesson 28 - Solving IVPs with Euler's Method
- Lesson 29 - Solving Systems of IVPs
- Lesson 30 - Solving BVPs Numerically
- Appendix A01 - Algorithms, Flowcharts, and Pseudocode
- Appendix A02 - Conditional Statements and the Structure of Python Code
- Appendix A03 - More on Conditionals
- Appendix A04 - Loops in Python
- Appendix A05 - More on Loops
- Appendix A06 - Pythonic Containers
- Appendix A07 - Processing Text Data
- Appendix A08 - Basics of Functions
- Appendix A09 - More on Functions
- Appendix A10 - Recursive Functions
- Appendix A11 - Algorithm Complexity and Numerical Experiments
- Appendix A12 - Searching
- Appendix A13 - Sorting
- Appendix A14 - Modules and Packages
- Appendix A15 - Unit Tests and Defensive Programming