Skip to content

Latest commit

 

History

History
49 lines (31 loc) · 3.83 KB

File metadata and controls

49 lines (31 loc) · 3.83 KB

From First Principles to Engineering Workflows with Symbolic Math Toolbox

Open in MATLAB Online

Application examples that show how to get started with Symbolic Math Toolbox™ for first-principles analysis and to re-use this work in downstream numerical workflows. Start by deriving closed-form models, perform parameter sweeps and linearize, then generate MATLAB® functions, Simulink® function blocks, or Simscape™ equations for use in engineering workflows.

Each example is self-contained and runs as a MATLAB Live Script.

Follow for updates when new examples are added.

Examples

Example Domain Description Other Toolboxes
SpacecraftAttitudeSlew Aerospace Spacecraft slew maneuver planning — Euler's equations to eigenaxis dynamics, bang-bang and trapezoidal profiles via dsolve, parametric slew time, sensitivity to inertia/actuator degradation with vpa verification, and multi-target scheduling Aerospace Toolbox
DCMotorSpeedAdaptive Automotive Adaptive DC motor speed control — symbolic state feedback gains as functions of load inertia, from 4-state drivetrain model through pole placement to Simulink deployment Control System Toolbox™, Simulink
BlackScholesGreeks Financial Black-Scholes Greeks from first principles — PDE verification, exact first- and second-order Greeks, near-ATM Taylor approximations, digital option limits, multi-asset cross-Greeks via Jacobian, and Monte Carlo with exact sensitivities Financial Toolbox™
ISACWaveformDesign Wireless OFDM ISAC waveform design — cross-ambiguity function, Cramér-Rao bound, and Shannon throughput as closed-form functions of pilot fraction, with Zadoff-Chu pilot sequence design Communications Toolbox™, Signal Processing Toolbox™

The Common Pattern

Each example follows the same workflow:

  1. Model from first principles — declare physical parameters as symbolic variables and derive the governing equations
  2. Analyze symbolically — simplify, solve, differentiate, or integrate to obtain closed-form results (transfer functions, sensitivities, design equations, stability conditions)
  3. Export code and models — substitute known numeric parameters and generate executable MATLAB functions or C code
  4. Validate numerically — the generated functions are used directly in simulations, Monte Carlo engines, Simulink models, etc

The symbolic derivation and the deployed code stay in sync, so changing an assumption upstream can be automatically propagated downstream.

Getting Started

Requirements

  • MATLAB R2024b or later (R2025a+ for some examples)
  • Symbolic Math Toolbox (all examples)
  • Additional toolboxes as listed in the table above and in each example's README

Running an Example

  1. Open MATLAB and navigate to the example's directory
  2. Open the .m file as a Live Script
  3. Run section by section, or run all — each example is self-contained

Some examples generate additional .m files at runtime via matlabFunction. These are written to the example's directory and are gitignored.

License

See license.txt for details. Copyright (c) 2026, The MathWorks, Inc.