Block 4

December 9, 2008

For this last block of the semester, we looked at using Laplace transforms with linear differential equations.

(a) \frac{dx}{dt} + x = e^{-t}

so \L[x] = \frac{1}{(s+1)^2} = \frac{A}{1+s}

The inverse Laplace transform can now be used to solve the equation….

>> syms A s t; ilaplace(1/(s+1)^2 + A/(1+s))
ans =
t/exp(t) + A/exp(t)

(b) \frac{dy}{dx} + y = \cos{x}

so \L[y] = \frac{\frac{\cos{x}}{s} + A}{s+1}

The inverse Laplace transform can now be used to solve the equation….

(c)  \frac{d^2y}{dx^2} + 4*\frac{dy}{dx} = 4y = 0

so  \L[y] = \frac{(s+4)A + B}{(s+2)^2}

The inverse Laplace transform can now be used to solve the equation….

(d) \frac{d^2x}{dt^2} - 2*\frac{dx}{dt} + 5x = 0

so \L[x] = \frac{(s+2)A + B}{(s^2 -2s + 5)}

The inverse Laplace transform can now be used to solve the equation….

Block 3 part 2

November 4, 2008

In order to efficiently compare graphs and eigenvalues for different systems of linear differential equations, we wrote an M-file that we could use to reference and quickly produce a vector field and eigenvalues for numerous values for constants a,b,c, and d.

My understanding of the assignment for this block is to explore, as much as possible, the behavior and effects of these conditions, a b c d, and the eigenvalues on the shape or “flow” of the vector plot produced by all sorts of combinations.

In class we discussed all the various “flow” styles that are possible, by a system of linear differential equations. Below are many examples, at least one of each possible type, along with comments and observations I have made.

1. The first thing I realized was that the magnitude of the values of a, b, c, and 9 only effect the spacing and/or magnitude of the vectors. Therefore, in order to experiment with the shapes of the vector fields I needed not worry about using larg or small numbers. The graphs below were generated using mostly 1, -1, and 0.

2. Given 4 values for a b c d that are equal produces eigenvalues 0 and 0. The graph is a series of parallel vectors moving perpendicular to a common central line. If the values of a b c d are positive, the vectors move away from the line. If the values of a b c d are negative, the vectors move towards the line.

0000

3. When a b c d are in the sequence of neg. and pos. values (-,-,-,+) eigenvalues + and – are produced. The vector plot shows vectors moving inward from the horizontal, then turning to flow out along the vertical.

4. When a b c d are in the sequence of neg. and pos. values (+,+,+,-) eigenvalues 0 and – are produced. The vector plot of this is similar to the one above, but the vectors move in along the vertical and out along the horizontal.

1

5. Another shape produced in the vector field is a sort of spiral with eigenvalues that are imaginary numbers. This is produced by having values of a b c d where two of them are either + or – while another is the opposite of those two. The fourth is 0. For example : a b c d of (+,+,-,0) produces a plot with a flow that originates at a center and moves outwards.

01

Values of a b c d (-,-,+,0) form a similar spiral shaped vector field where the arrows move in toward the center.

02

6. By using alternating values of either a pos. number or a neg. number with zeros for a b c d you produce a vector field with arrows approaching or leaving a central line at an angle.  Using negative values makes the arrows move inwards while positive values produce arrows moving outwards.  If the set or a b c d have zeros first the central line will be horizontal.  If the zeros come after the + or – the central line will be vertical.

(-,0,-,0)  eigenvalues + and 0:
0-0

(0,-,0-) eigenvalues 0 and -:

0-02

(0,+,0,+) eigenvalues + and 0:

00

(+,0,+,0) eigenvalues 0 and -:


Block 3 part 1

October 23, 2008

Today we worked on solving for the crease lines given a system of linear DEs.

Given T[(x,y)] = (x+y,x).

First I solved for \lambda using the relationships

x + y = \lambda (x) and x = \lambda (y)

Solving for lambda gives the result

\lambda = \frac {1\pm \sqrt{5}}{2}

plug that back into the previous equations to get y.

y = \frac {2x}{1 \pm \sqrt{5}}

Oct. 16, 2008

October 16, 2008

I tried to do the Euler system M-file today. I ran into the same problem that we had before. The command line would disappear. I know that before we solved this problem by doing everything in the 2008 version of Matlab. Today however, I had the same problem with that version as well. This has been an ongoing and increasing problem over the course of this 2nd block assignment.

I feel like I have not accomplished much over the past three weeks, even though it has now been 4. However, I do feel that I have put in the time and effort, and that the lack of results at this point is vastly due to technical issues beyond my control.

Oct. 14, 2008

October 14, 2008

Finally!! Some progress with Matlab. I was able to use Matlab 2008 to somehow dissolve my problem of the command line disappearing on me. I saved the 2 M-files in Matlab and produced a plot with the commands and conditions as follows:

>> y_init = 0.1;
>> [ t, y ] = euler ( ‘test_example’, [ 0.1, 9.0 ], y_init, 200 );

This set the initial value of “y” to 0.1 and ran the function test example with time values from 0.1 to 9.0 with 200 steps.

Oct. 7, 2008

October 7, 2008

I began my efforts with Matlab having very little success.  I was confused by the code supplied in the example problem on the class website.  Turns out  much of my aggravation was at the fault of my computer.  At first, I would create the M-files, saving them as instructed in the example.  The trouble was that after I tried to command Matlab to reference the saved files, it would do nothing, as if I had not typed anything at all into the command line.  Also, at this point the command line would disappear, making it very difficult for me to instruct the program to do any further computations.

This problem made it so I could not get any further on the assignment, so I spent a significant amount of time trying to solve it.  When all was said and done, 2 class periods went by before we finally solved the dilemma.  We had been saving the M-files without any specification as to wich type of file it was.

ex:  we had been saving the file as “euler”

we should have saved the file as “euler.m”  to specify that it was a Matlab M-file

As a result the program was interpreting the files as simple text, rather than a sort of program that can be called on to carry out math, otherwise known as the M-file.  It is really funny how such a simple notation can cause you so much trouble.

Oct. 2, 2008

October 2, 2008

As of now, I am still working on playing with the Lorenz equations and how the results change with differing initial conditions and and parameters.

\frac{dx}{dt} = \sigma(y-x)

\frac{dy}{dt} = x(\rho-z)-y

\frac{dz}{dt} = xy-\beta

I started by solving for them with euler to get them in a format that I could use in Excel.

x(t+\Delta t) = \sigma\Delta t(y-x) + x(t)

y(t+\Delta t) = \Delta t(x(\rho-x)-y) + y(t)

z(t + \Delta t) = \Delta t(xy-\beta z) + z(t)

NOTE: POST ORIGINAL GRAPHS HERE

Sept. 18, 2008

September 18, 2008

I used Matlab to create a direction field display of my differential equation. This was done using a series of commands:

>> [x, y] = meshgrid(1:.1:4, 1:.1:3);
>> S = 2*y./x;
>> L=sqrt(1+S.^2);
>> quiver(x,y, ones(size(S)), S), axis tight

  • Command 1 sets up a grid with dimensions specified by (1:.1:4, 1:.1:3). The first set is setting values of “x” to go from 1 to 4 at intervals of .1.
  • Command 2 sets the points in the the grid space equal to \frac{2y}{x} producing slope arrows at each point.
  • Command 3 adjusts the size or length of the slope arrows to make the directional field easier to comprehend.
  • Command 4 is used to plot the direction field.

These command produce the following direction field, with values of x on the horizontal axis and values of y on the vertical axis.

The differential equation \frac{dy}{dx} = \frac{2y}{x} produces a direction field that is somewhat boring. The magnitude, shown by the size of the arrows, does increase as you travel towards the upper left of the gridspace. However, unlike an equation containing exponents etc, this direction field does not show any real changes in direction.

Finally, I used Matlab to solve my differential equation.  I had some difficulty doing this because I ran out of time in class and had to find a time where I could use a computer with a full version of Matlab installed.

To solve my equation I used the “dsolve” command.  This produces a symbolic solution to the differential equation.

>> dsolve(‘Dy = 2*y/x’, ‘x’)

ans = C1*x^2

Of course this gives you an answer containing the term C1.  This due to the fact that I asked the computer to solve the equation without giving it an initial condition.  If I were to specify an initial condition of y(0) = 0  then I could find an actual answer, rather than a symbolic one.

>> soll = dsolve(‘Dy = 2*y/x’, ‘y(0)=0′, ‘x’)

soll =0

A problem I ran into, however, was that if i tried any initial condition other than 0 I got an answer saying

soll =[ empty sym ].  I’m not sure what that means, but I can’t seem to fix it.

Had I been more successful, I could have used the “ezplot” command to form a graph of the solution over a specified range.

sept 16, 2008

September 16, 2008

I’ve been trying to form a directional field using my differential equation.  I’ve been getting warnings from the program saying that there are rank problems, and the quiver command has either displayed no results or a solid block rather than a field of directional arrows.  I made sure that the bounds I set for the process were not forcing the computer to divide by 0.  That did not fix the problem.

sept. 11, 2008

September 11, 2008

One method to solve a differential equation is to use Euler’s method and Microsoft Excel. Given my differential equation and knowing that

\frac{dy}{dx} = \frac{y(x+\Delta x)-y(x)}{\Delta x}

I was able to determine that

y(x+\Delta x) \approx y(x) + (\Delta x)(\frac{2y}{x})

I was then able to use Excel to make a table and a chart displaying this equation. I used initial values of x=1 and y=1.


Follow

Get every new post delivered to your Inbox.