Category Archives: Mathematica
Mathematica — Euler’s method for systems, revisited
An earlier post discusses Mathematica code for Euler’s method. Here is some updated code. A couple preliminary notes: I like to clear all variables at the beginning. For systems it is fun to superimpose the plot on top of the … Continue reading
Mathematica for linear algebra
Here is some mathematica code to be used by my linear algebra students. The post will be periodically updated as the course progresses. Entering matrices Mathematica views matrices as lists of columns. Thus to enter the matrix we type in … Continue reading
Quick tips for using Manipulate in Mathematica
We’ve been using the Manipulate function in class a lot. Here are a couple of quick tips and examples. The basic idea is to take something you Mathematica to do and add a parameter. For example, suppose you want to … Continue reading
Comparing numerical methods
Here is a simple example of comparing different numerical methods for ODEs. We focus on the example subject to the initial condition . We know that the exact solution is . Let’s compare Euler’s method, the trapezoid method, and the … Continue reading
Mathematica – Euler’s method for systems
Here is a description of how to implement Euler’s method for a system. We focus on a simple example: where and First, let’s put in the functions which define the system Next, we make a StreamPlot of the vectorfield Now … Continue reading
Euler’s method with Mathematica
We use Euler’s method to find an approximate solution to with initial value First, we set (The semi colon just suppresses the output.) Next we define the function Now we set up the recursion relation. We want the initial values … Continue reading
A quick introduction to plotting with Mathematica
Here are some notes for the 16 September workshop introducing our Math Skills Center tutors and Calculus III students to Mathematica: Plotting with Mathematica The emphasis is on two- and three-dimensional plots.
Mathematica: Stream plots for differential equations
It is very easy to use Mathematica to make stream plots for differential equations. Stream plots for a single equation Consider the example Points on a solution curve to this equation will take the form . Thus the slope will … Continue reading
Mathematica: Plotting functions
Here’s a quick introduction to plotting with Mathematica: Basic plotting The basic plot command takes the form Plot[function of variable,{variable,starting value,ending value}] For example, the input Plot[Sin[t],{t,0,2Pi}] should yield the following plot We can change the vertical and horizontal range … Continue reading