3rd week block

•December 18, 2008 • Leave a Comment

Finally in the 3rd week block we completely turn to system of linear differential equations.  By useing esample on TEMATH  I enter code in MATLAB that would present vecter filed that were to be analized.

Our goal was to use the quardratic formula to atain the eigen values ofof the sytem of linear diffretial equations. these values would be used two solve for the slope of the faded line.

Here is is a vector field where we analized the faded line that lies on that

-y/x  slope this graph show vectors that almost look like they origionate and get pushed out from the center
vectorfileds1
This is a MATLAB plot with two negative eigen values it has the same faded area as the first plot, but the vector field points inward
two_negative_eigenvalues1

This last example was acheived by haveing two positive eigen values

  I use   dx/dt= 2x+2y

  and     dy/dt=x+3y

11-_eienvalue1

4th week

•December 17, 2008 • Leave a Comment

The Purpos of the Laplace Transform is to take our complex Differetial and convet them into simple algerbra equations. thes are some basic Laplace Transforms that Ugurtan and I used to do the first two example.

lplacetables

I got this table from google image oaf Laplace trancformhttp://www.math.oregonstate.edu/home/programs/undergrad/CalculusQuestStudyGuides/ode/laplace/lt/lt.html

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

We used Mat lab and cumputed the invers laplace transform to get this graphical solutions

sym s t; laplace(x(t) ,t,s)

=1/s

Now we use the inverslaplace

syms A B st; ilaplace(A/(B+s) ,s,t)

this = A/exp(B*t)

We used the ezplot fubnction to attain this graph and used the interger 1 for all A’s.

finalpro

After various effort we were able to find this graph use in this MAt lab code

syms A B st; ilaplace(s/(s^2+A^2) ,s,t)

The result was cos(t*(A^2)^1/2)) and since A was 1 this was an acceptable answer.

In thee process of finding the cos graph we did find a rather interesting graph. wich you can veiw below this one. 

finalprojectcosx

It’ to bad that Sin looks so simular to cos but it is different and it was a suprise at the time.

In this graph there is a line through the center of the X axis. the wave have less arc we got this graph by ploting the solution to

syms A B st; ilaplace(B/(B^2+s^2) ,s,t)

our result was  (B*sin(t*(B^2)^(1/2)))?(B^2)^(1/2) and again we used the ezplot function

nicedfinalpro

Second Week Block

•December 17, 2008 • Leave a Comment
  • Exploring Euler’s approximation and first order differetial equartions

excel

We used excel to produce 3 linear equation to represent a lorenz attractor.

We used  Eulers method to  approximate these three equations..

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

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

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

xyz-vs-t

We had Keep in mind that if we needed exact answers eulers mehtod was inaccurate. It was essetial in the case though, We need to get an 3 2d image of the Lorenz attractor.

Each of the graphs below describe a 2d view of a 3dimentional plot.

z-vs-xt1z-vs-yty-vs-xt

 

 

 After creating these beutiful graphs we used a matlab code that would help us to better understand a 3d representation of Lorenz system of equations. By creatining a M File in MATLAB  a single differential equation.

 

 

% Euler?s method for a single differential equation.
function[ t, y ] = euler ( f, t_range, y_initial, nstep )
% We set a range of time values, from t(1) to t(2).
t(1) = t_range(1);
% We define dt by dividing the time range into an equal number of specified steps.
dt = ( t_range(2) – t_range(1) ) / nstep;
% We set the initial value of y at the beginning time t(1)
.y(1) = y_initial;
% We use Euler?s method to update the value of y at new time steps.for i = 1 : nstep
end
% The following command plots y as a function of t.
plot(t,y)
This graph was the final reult
fig13
By add this simple code that stricly deal with vectors at the end of the previous code we are now able to veiw a 3d model of the lorenz equations
for i = 1 : nstept(i+1) = t(i) + dt;y(:,i+1) = y(:,i) + dt * feval ( f, t(i), y(:,i) );end
% The following command plots the components of y as functions of t.
plot(t,y)
% We also want a 3D plot of the vector components as they vary with t.
plot3(y(1,:),y(2,:),y(3,:)) 
Also we had to write the second M File to run the vector solution for a system of differential equations
function yprime = lorenz_system ( t, y )

yprime = [ 10.0* (y(2)-y(1)); y(1)*(28.0-y(3))-y(2);y(1)*y(2)-8*y(3)/3 ];

This graph was the final reult and it looked very simular to the model Demonstrated in class 

3_dlorenz5

 

 

 

 

 

First 3 week Block Problems

•September 4, 2008 • 1 Comment

The Bulk of the work I did in the first three week block was in class and about 35% was done out of class. Amusingly we all entered this class not knowing much about any way of approaching the task at hand; using the Euler method, MATLAB, and getting it all in latex format. For some of us getting use to the word press network was a challenge as well. This Obstacle required anyone with enough will to inquire their own problem solving skills. Though none of us knew how to really workout these problem I knew that I had intermediate experience with MATLAB, So by working on teams a lot  more got accomplish, My obscure approach  was to simply help others get there work done  while attaining  the skill and knowledge I needed to accomplish my task.

Learning the Euler method and completing the Excel:  I used the equation {2y/x}

Euler’s method:
\frac{dx}{dy}\<span style="font-family:Courier New;">approx\frac{</span>f(x+\Delta x)- f(x)}{\Deltax}
solving  for  {2y/x}
[(f(x+delta x)- f(x))/delta x]  =  ((( 2y/delta x)/x)+ f(x))
Then I entered  this new equation into Excel
Excel values
delta x                x                           y
euler_equ2

Along with these two commands Bounds 
independent variable x   = B4+A$4                  0< x < 25
Dependent variable y    = (C4)+((2*C4*A$4)/(B4))   y(0) = 5
This is a graphical plot of my solutioneuler
  
My goal was to try and compare with MatLab plot with the same bounds, but my equations for {2y/x} in  Matlab did not work

The first equation that Catlin and I targeted was  {-x* (y+1)} d
We were slow to start just running  through the do’s and don’ts of Matlab, we attain an ezplot  but by the next class
 dsolve(‘Dy = -x*(y+1)’,'x’)
 ans = -1+exp(-1/2*x^2)*C1
 B= dsolve(‘Dy = -x*(y+1)’,'y(0)= 3′,’x')
 B = -1+3/2*exp(-1/2*x^2)

The ezplot is a quick plot of (vectorname, between the bounds of [# #]
 ezplot(B,[-5 5])
I ezplot

N the first instance we ploted this same graph with it’s bounds from (0 – 2) we saw an reversed s, or a line with a – slpoe in the positive X-axis direction.

after ataining our 2d plot. I was working with Jay votta an we used the  Chap 6 Qualiative approach to differtianl equations work sheet to make a Directiional field plot. Are MATLAB equatoions were as follows 

[x, y] = meshgrid(-2:.5:2, -2:.5:2);
S = (-x*y – x);
quiver(x, y, ones(size(S)), S), axis tight
quiver-11

Now this graph was great, but it wasn’t an accurate representation of our 2d Directional feild By playing with the bounds were able to see very diferent graphical solutions This graph gave the most varient information so I decided to keep this as a result, the next graph also shows a very different graph from the origonal.

 [x, y] = meshgrid(-.9:.5:.9, -.9:.5:.9);
S = (-x*y – x);
quiver(x, y, ones(size(S)), S), axis tight

quivercurves1

[x, y] = meshgrid(-.05:.01:.05, -.05:.01:.05);
S = (-x*y – x);
quiver(x, y, ones(size(S)), S), axis tight

quiveralt3

Increasingly more solid graph can be made by make Meshes out of the vector’s unit vector.

 
Follow

Get every new post delivered to your Inbox.