0% found this document useful (0 votes)
22 views8 pages

Comparing Python, MATLAB, and Mathcad

This document compares Python, MATLAB, and Mathcad by providing sample code for several common computational tasks: polynomial fitting, integration, solving stiff differential equations, systems of nonlinear equations, and interpolation. It also includes sample code for solving the 2D unsteady heat equation using finite differences in Python and MATLAB. The document concludes by discussing IPython notebooks, which provide an interactive web-based interface for writing and sharing Python code, equations, and results.

Uploaded by

jmorlier
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views8 pages

Comparing Python, MATLAB, and Mathcad

This document compares Python, MATLAB, and Mathcad by providing sample code for several common computational tasks: polynomial fitting, integration, solving stiff differential equations, systems of nonlinear equations, and interpolation. It also includes sample code for solving the 2D unsteady heat equation using finite differences in Python and MATLAB. The document concludes by discussing IPython notebooks, which provide an interactive web-based interface for writing and sharing Python code, equations, and results.

Uploaded by

jmorlier
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Comparing Python, MATLAB, and Mathcad

Sample Code in Python, Matlab, and Mathcad

Polynomial fit
Integrate function
Stiff ODE system
System of 6 nonlinear equations
Interpolation

2D heat equation: MATLAB/Python only

IPython Notebooks

Thanks to David Lignell for providing the comparison code

Code: fit polynomial to data


Python

Matlab

Python

Mathcad

Code: integrate function


Python

Matlab

Python
2 files
(optional)

Mathcad

Code: Stiff ODE system


Python

Matlab

2Python
files

Mathcad

Code: interpolation
Python

Matlab

Python

2 files

Mathcad

Code: system of nonlinear equations


Python

Matlab

Python

2 files

Flow through 3 parallel pipes given total flow, pipe props

Mathcad

Code: 2D unsteady heat equation


Python

Matlab

Finite difference, Euler integration

IPython Notebook

A wrapper with full Python


functionality
Web interface (and others)
Workbook

Edit and output dynamically


Document as you go, with formatting
Print/share
Embed images and movies, etc.
Direct code loading

Interactive e-books are written in


IPython notebook
Symbolic solver with formatted
output

You might also like