By the end of this section, you should be able to
Explain what a computer algebra system is and when to use Mathematica instead of MATLAB for system dynamics and control problems.
Use Mathematica to
Solve linear systems of equations that come from engineering models
Perform partial fraction expansion to prepare for inverse Laplace transforms
Solve linear ordinary differential equations that describe mechanical, electrical, thermal, and fluid systems
Use MATLAB to
Define transfer functions for dynamic systems
Use the residue function to perform partial fraction expansion and interpret poles and zeros
Plot impulse responses and time responses of transfer function models
Organize your notebooks, scripts, and figures in a clear folder structure so that your engineering calculations are reproducible and easy to review later in the course.
This section introduces the software tools you will use throughout Modeling to build, solve, and interpret dynamic system models: MATLAB and Mathematica. The goal here is fluency, so the software supports your engineering thinking and helps you check work quickly. You will learn when a computer algebra system is the better choice for symbolic tasks like exact algebra, Laplace transforms, partial fraction expansion, and closed-form solutions, and you will practice using Mathematica to solve linear systems of equations that come from engineering models and to solve linear ordinary differential equations for mechanical, electrical, thermal, and fluid systems. You will also strengthen practical MATLAB skills for transfer function modeling, including using the residue function for partial fraction expansion and interpreting poles and zeros, plus plotting impulse and time responses to connect math to system behavior. Along the way, you will build habits that make your work easier to review and reuse later, including organizing notebooks, scripts, and figures in a clear folder structure for reproducible calculations. Use the table of contents below to jump to Mathematica, MATLAB, or code resources depending on what you need for your next modeling task.
Mathematica (https://www.wolfram.com/mathematica/online/) is a computer algebra system that is especially helpful for symbolic work such as exact algebra, Laplace transforms, and closed-form solutions.
Key ideas and commands used in this section:
General syntax
All built-in functions are capitalized, for example Solve, Apart, Collect, DSolve.
Function arguments are inside square brackets [], not parentheses.
Code is organized in cells. You can evaluate a single cell without running the entire notebook.
Solving linear systems
Use Solve[{equations}, {variables}] to solve systems with unique or infinite solutions.
Partial fractions and inverse Laplace transforms
Use Apart[expr, s] to expand rational expressions into partial fractions with respect to s.
Combine Apart with InverseLaplaceTransform[expr, s, t] to move back to the time domain.
Collecting terms
Use Collect[expr, s] to express a polynomial in descending powers of s, which is helpful when matching standard forms in system dynamics.
MATLAB is a numerical computing environment that you will use for transfer functions, simulations, and plotting time and frequency responses.
In this section, you primarily use:
Residue function for partial fractions
Syntax: [r, p, k] = residue(num, den) where
num and den are vectors of coefficients of the numerator and denominator polynomials in descending powers of s
r holds the residues (numerators in partial fractions)
p holds the poles (roots of the denominator)
k holds any direct terms without denominators
Interpreting complex poles
Complex conjugate poles correspond to oscillatory modes in the time response. In later units you will connect these directly to natural frequency and damping ratio for second-order systems.
Transfer functions and impulse response
Use sys = tf(num, den) to define a transfer function object.
Use impulse(sys) to plot the impulse response that corresponds to the partial fraction expansion you obtained with residue.
See https://sites.google.com/view/jmm-matlab/home for much more extensive MATLAB resources