Resources > Matlab > Solve math problems – numerical methods
Also see Resources > Matlab > Diffusion & Heat Transfer for more numerical method examples
For links below to PDF and text files, hit the browser “back” button to return here.
Topic |
MATLAB Examples |
Simultaneous linear equations
|
screen shot – for Workbook 7.4 |
Root of nonlinear equation |
M-file link. As example, solve van der Waal’s equation for molar volume using Newton’s method, fzero(), fminbnd(), interval halving or bisection, successive approximation, the SYMBOLIC toolbox and, since this happens to be a polynomial, roots(). |
Fit polynomial function to |
Fit a polynomial to data using polyfit, polyval and linear algebra
|
Fitting nonlinear equation to data using “nonlinear regression” (“least squares fit”)
(yes, this example can be inverted and linearized but the methods work on nonlinear equations) |
Problem solution with function lsqcurvefit. You must have the Optimization Toolbox installed in order to use lsqcurvefit. Problem solution with function fminsearch |
Differentiation and integration (quadrature) of data |
Integration of data (quadrature) Differentiation of data – RTD tracer experiment FreeMat users: search for Freemat note in file Differentiation of data from Batch Reactor |
Integrate one Ordinary |
Integrating one ODE using Euler’s method Using Matlab’s ode45 function > main file > derivative function file |
Integrate two coupled ODE’s See notes in cell above |
Integrating two ODEs using Euler’s method Using Matlab’s ode45 function > main file > derivative function file |
Integrate Partial Differential Equations (PDE) using the finite-difference method |
Transient 1D diffusion – code, plots and notes Transient 1D diffusion – code only
|