h1

3rd Assignment: Systems of linear differential Equations

MY THIRD WEEK BLOCK PROBLEM

BY JEFFREY FLEURANTIN

INTRODUCTION

In the third 3 week block, Laquita and I are working on systems of 2 linear Differential Equations. Laquita and I compromised that we would be working closer together. Laquita took notes during lecturers while I took notes on the board and summarized our days work. We both equally contributed together in completing our matlab and other diagrams and etc…:

\frac{dx}{dt} = ax +by

\frac{dy}{dt} = cx +dy

[a, b c, d, are constants]

On the first day of the third 3 week block the professor wrote on the board:

Arnold’s Cat Map

T[(x,y)] = (2x +y, x +y) How do we get a picture of what T does to vectors?

When we plugged in the (x,y) coordinates for the equation above of each corner coordinates, the square transformed into a parallogram.

—————————————————————————————————————————————-

PART 1: MATLAB

PROFESSOR’S EXAMPLE

We followed the professor’s model on Matlab to better understand the assignment. So we typed in the following Matlab code.

MATLAB CODE

>> [x,y] =meshgrid(-1:1/10:1,-1:1/10:1);
>> u=2*x+y;
>> v=x+y;
>> quiver(x,y,u,v,1)

Fig. 1

Observation:

As you can see above, there is a formation of a line. All the vectors are moving towards the outside of the graph, away from the line. The closer they are to the line the smaller the vectors.

—————————————————————————————————————————————-

MY FIRST MATLAB EXAMPLE

So now we altered the Matlab code above to identify any changes in the graph. We input 5 instead of 1 in the quiver command.

MATLAB CODE:

>> [x,y] =meshgrid(-1:1/10:1,-1:1/10:1);
>> u=2*x+y;
>> v=x+y;
>> quiver(x,y,u,v,5)

Fig. 2

OBSERVATION: In Figure 2, the formation of the line is more visible and defined. It is also easier to see the path of the vectors because they seem to be overlapping each other which sort of creates a 3D meshgrid.

—————————————————————————————————————————————-

MY SECOND MATLAB EXAMPLE

So now we altered the Matlab code above, again. We input 20 instead of 5 in the quiver command to identify further changes.

MATHLAB CODE

>> [x,y] =meshgrid(-1:1/10:1,-1:1/10:1);
>> u=2*x+y;
>> v=x+y;
>> quiver(x,y,u,v,20)

————————————————————————————————————————————

PART 2: MATHEMATICA

PROFESSOR MATHEMATICA EXAMPLE

Because Mathematica creates better graphs than matlab, we will now use Mathimatica to generate similar graphs that we created with Matlab. So first we followed the Professor’s example on the web blog to start. We typed in the following codes in Mathematica and generated a graph.

MATHEMATICA CODE for graph:

Needs["VectorFieldPlots`"];

VectorFieldPlot[{2*x + y, x + y}, {x, -1, 1}, {y, -1, 1}, PlotPoints -> 20, ScaleFactor -> 0.2, Axes->True]

OBSERVATION:

————————————————————————————————————————————

Professor’s 2nd Mathematica Example

This is the code from Mathematica:

Needs["VectorFieldPlots`"];

A1 = VectorFieldPlot[{2*x + y, x + y}, {x, -1, 1}, {y, -1, 1}, PlotPoints -> 20, ScaleFactor -> 0.2, Axes -> True];
A2 = Plot[-x*(1 + Sqrt[5])/2, {x, -1, 1}];
A3 = Plot[x*(-1 + Sqrt[5])/2, {x, -1.5, 1.5}];
Show[A1, A2, A3]

————————————————————————————————————————————

1st  Mathematica Example:

Needs["VectorFieldPlots`"];

A1 = VectorFieldPlot[{2*x + y, x + y}, {x, -1, 1}, {y, -1, 1},
PlotPoints -> 20, ScaleFactor -> 0.2, Axes -> True];
A2 = Plot[x*(-(4/3) + 1/3 (3 + Sqrt[10]))/2, {x, -1, 1}];
A3 = Plot[x*(-(4/3) + 1/3 (3 - Sqrt[10]))/2, {x, -1.5, 1.5}];
Show[A1, A2, A3]

Eigenvalues[A]

{3 + Sqrt[10], 3 – Sqrt[10]}
Eigenvectors[A]

{3 + Sqrt[10], 3 – Sqrt[10]}

{{-(4/3) + 1/3 (3 + Sqrt[10]), 1}, {.10, 1}}

mathmatica-3-pic

Observation:  This is a failed Mathematica example because the vector fields are not in sync with the two equation lines.

————————————————————————————————————————————

2nd  Mathematica Example:

Needs["VectorFieldPlots`"];
VectorFieldPlot[{y, -x}, {x, -1, 1}, {y, -1, 1}, PlotPoints -> 10,
ScaleFactor -> 0.4, Axes -> True]
matex4

Observations:   This example is better than the previous example because the vector fields are moving along and about the two lines.  Most of the vectors curve as the approach the edge of the line.

——————————————————————————————————————————————

Needs["VectorFieldPlots`"];
VectorFieldPlot[{y, -x}, {x, -1, 1}, {y, -1, 1}, PlotPoints -> 20,
ScaleFactor -> 0.2, Axes -> True]

matex12

Observation:  This graph above was created by inputting the vector field plots above in mathematica on a scale factor of 0.2.  The vector fields are heading in a cirlcluar clockwise motion and are fairly small and bunched up together.

_______________________________________________________________________________________________

Needs["VectorFieldPlots`"];
VectorFieldPlot[{y, -x}, {x, -1, 1}, {y, -1, 1}, PlotPoints -> 10,
ScaleFactor -> 0.2, Axes -> True]

matex2

Observation:  We use the previous graph inputs above as a base and change the plot points from 20 to 10.  As you can see it produced less vector fields and spaced them out more.

_____________________________________________________________________________________________________

Needs["VectorFieldPlots`"];
VectorFieldPlot[{y, -x}, {x, -1, 1}, {y, -1, 1}, PlotPoints -> 10,
ScaleFactor -> 0.4, Axes -> True]

matex3

Observation: While using the previous mathematica inputs we altered the scale factor from o.2 to 0.4.  This made the vector field lines longer.

____________________________________________________________________________________________________________

Needs["VectorFieldPlots`"];
VectorFieldPlot[{-x + y, -x - y}, {x, -1, 1}, {y, -1, 1},
PlotPoints -> 20, ScaleFactor -> 0.2, Axes -> True]

matex5

Observation: Now we changed our vector field plot a little to read {-x +y, -x-y}  and kept our plot points 20 and our scale factor 0.2.  This produced a graph that was heading in a clockwise motion.

______________________________________________________________________________________________________________________

Needs["VectorFieldPlots`"];
VectorFieldPlot[{x + y, -x + y}, {x, -1, 1}, {y, -1, 1},
PlotPoints -> 20, ScaleFactor -> 0.2, Axes -> True]

matex6

Observation:By changing the vector field plot from {-x + y, -x-y} to {x+y, -x+y}, we generated a graph that seems to start in the second quandrant with vector fields facing the positive y axis and as they vectors  move they begin to head in a clockwise direction.

_________________________________________________________________________________________________

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.