Final Results of Project 1

Matt and I started working on the Differential Equation \frac{dy}{dx}=(2y)/(x) .
dsolve(‘DY = ((2*y)/(x))’, ‘y’)

ans =

y^2/x+C1

My Blog post on (9/9/08) reveals all the mistakes Matt and I made trying to get  direction field line graphs in Matlab. 

(9/11/09)

     Most of this week I was frustrated because I did not know or understand Matlab syntax.  It made it difficult to progress at the speed I wanted to.  Matt and I kept trying to figure out how to get the initial equation we had picked to graph.  We actually had picked this equation because it looked like the easiest to start with -  we wanted to complete the whole list of the equations before us.  Irony prevailed – as we spent a whole class time practically unable to figure out what we were doing wrong to graph in Matlab. … Thankfully, Matt suggested just trying another equation.  In less than twenty minutes we actually got some results !!!  Now we need to discuss the graghs of the solutions.  But, what I learned humored me – and, made me appreciate Matt and working in groups – most likely I would have just kept working at the same problem  - and brute forced it.  He was able to recognize that we needed to take a different approach – to be more effective – and that what we needed was to look at the assignment from a different angle.  I seemed to have forgotten this technique because I was lost in the problems we were having.  He helped remind me to step back and see the bigger picture.  To just shift the focus a little.  Over the past day and a half, I have been reading some primers on Matlab, and also reading one of the suggested texts.  Right now – it kind of feels disorderly – but, I am trying to press through the uneasiness to understand that learning isn’t necessarily linear – just like I learned from Matt this week – it is difficult to see a big picture if you are standing too close to it – so, as I try to step back – the goal will be to see everything as a whole and how the numerical calculations of Euler’s Method connect with the graphical behavior we are seeing with our “new” first equation!

This is our “new” first equation :-)

>> SOL= dsolve(‘DT = -T*(Y+1)’, ‘T(0)=2′,’Y')

 SOL =

 2*exp((-1/2*Y-1)*Y)

 

We were able to get some direction fields with this equation.  We tried to figure out what  the solution curves were.  The behavior of the slope lines did not seem to make any sense to us.  They looked like they were all pointing down at a large scale – but, they rotated at smaller scales around (.75) and lower.  I have never seen this before and cannot figure it out. 

(graph 1) 

(Matlab code)

>> [T,Y] = meshgrid(-1:0.1:1,-1:0.1:1);
>> S=-T*(Y+1);
>> L=sqrt(1+S.^2);
>> quiver(T,Y,1./L,S./L,0.5), axis tight (graph 1)

1st graph
(graph 2) (Matlb code)
>> [T,Y] = meshgrid(-0.5:0.05:0.5,-0.5:0.05:0.5);
>> S=-T*(Y+1);
>> L=sqrt(1+S.^2);
>> quiver(T,Y,1./L,S./L,0.5), axis tight
2nd graph

2nd graph

(graph 3) (Matlab code)
>> [T,Y] = meshgrid(-0.1:0.01:0.1,-0.1:0.01:0.1);
>> S=-T*(Y+1);
>> L=sqrt(1+S.^2);
>> quiver(T,Y,1./L,S./L,0.5), axis tight
3rd graph

3rd graph

We tried to look at different intervals to see what behavior the solutions were taking …we started out trying to see the “big picture” with large increments – things got strange at very small increments … I am  not able to explain this at this time

 This is a corrected direction field – this one matches our analytic results and is easier to see the behavior of the system.  Apparently we did not look in the right place on the plane.

>> [T,Y]=meshgrid(-5:.5:5, -5:.5:5);
>> S=-1*T.*(Y+1);
>> L=sqrt(1+S.^2);
>> quiver(T,Y, 1./L, S./L, 0.5),axis tight

 I can see the solution curves on this graph – I am still not sure what is happening at (behavior) (-1)?  Is seems to behave like an asymptote. 

 

 Next, we used Matlab with different parameters to get a further qualitative look at our equation.

 ezplot (SOL,[-.01, .01]), axis tight             (very small increments – look almost linear)  

 

ezplot (SOL,[-1, 1]), axis tight   (at a larger increment we start to see a curve)

 

ezplot (SOL,[-10, 10]), axis tight (now we see the big picture at a larger scale)

 

 

 

 

 

 

 

(9/18/08)
     Matt found another studen’t work (Joe Cross) on our same equation and was able to make some corrections to our work.  Today’s task was to work on Euler’s method.  I new we could use Excel to get very small increments for delta x – but, unsure how to get each cell to carry the calculations so that we did not have to input each increment manually.  Gary came over and showed us the method in Excel and even added some pretty colors to our graph.
This is Matt’s work …
Euler’s Method
\frac{dy}{dx}=\frac{f(x+\Delta x)-f(x)}{\Delta x}
Our equation here is \frac{dy}{dx}= -x(y+1) and if we set the two equal to each other, we get:
\frac{dy}{dx}=\frac{f(x+\Delta x)-f(x)}{\Delta x} = -x(y+1)
\frac{dy}{dx}=f(x+\Delta x)-f(x)= -x(y+1)*\Delta x
\frac{dy}{dx}=f(x+\Delta x)= f(x) -x(y+1)*\Delta x
Excel’s Calculations of Euler’s Method – analytical findings to match the qualitative behaviors

 

delta x x y                                                              
0.1 1 5
1.1 4.4
1.2 3.806
1.3 3.22928
1.4 2.6794736
1.5 2.164347296
1.6 1.689695202
1.7 1.259343969
1.8 0.875255495
1.9 0.537709506
2 0.245544699
2.1 -0.00356424
2.2 -0.21281575
2.3 -0.385996285
2.4 -0.527217139
2.5 -0.640685026
2.6 -0.730513769
2.7 -0.800580189
2.8 -0.854423538
2.9 -0.895184948
3 -0.925581313
3.1 -0.947906919
3.2 -0.964055774
3.3 -0.975557926
3.4 -0.983623811
3.5 -0.989191715
3.6 -0.992974615
3.7 -0.995503753
3.8 -0.997167365
3.9 -0.998243766
4 -0.998928697
4.1 -0.999357218
4.2 -0.999620759
4.3 -0.99978004
4.4 -0.999874623
4.5 -0.999929789
4.6 -0.999961384
4.7 -0.999979147
4.8 -0.999988948
4.9 -0.999994253
5 -0.999997069
5.1 -0.999998535
5.2 -0.999999282
5.3 -0.999999655
5.4 -0.999999838
5.5 -0.999999925
5.6 -0.999999966
5.7 -0.999999985
5.8 -0.999999994
5.9 -0.999999997
6 -0.999999999
6.1 -1
6.2 -1
6.3 -1
6.4 -1
6.5 -1
6.6 -1
6.7 -1
6.8 -1
6.9 -1
7 -1
7.1 -1
7.2 -1
7.3 -1
7.4 -1
7.5 -1
7.6 -1
7.7 -1
7.8 -1
7.9 -1
8 -1
8.1 -1
8.2 -1
8.3 -1
8.4 -1
8.5 -1
8.6 -1
8.7 -1
8.8 -1
8.9 -1
9 -1
9.1 -1
9.2 -1
9.3 -1
9.4 -1
9.5 -1
9.6 -1
9.7 -1
9.8 -1
9.9 -1
10 -1
10.1 -1
10.2 -1
10.3 -1
10.4 -1
10.5 -1
10.6 -1
10.7 -1
10.8 -1
10.9 -1
11 -1
11.1 -1
11.2 -1
11.3 -1
11.4 -1
11.5 -1
11.6 -1
11.7 -1
11.8 -1
11.9 -1
12 -1
12.1 -1
12.2 -1
12.3 -1
12.4 -1
12.5 -1
12.6 -1
12.7 -1
12.8 -1
12.9 -1
13 -1
13.1 -1
13.2 -1
13.3 -1
13.4 -1
13.5 -1
13.6 -1
13.7 -1
13.8 -1
13.9 -1
14 -1
14.1 -1
14.2 -1
14.3 -1
14.4 -1
14.5 -1
14.6 -1
14.7 -1
14.8 -1
14.9 -1
15 -1
15.1 -1
15.2 -1
15.3 -1
15.4 -1
15.5 -1
15.6 -1
15.7 -1
15.8 -1
15.9 -1
16 -1
16.1 -1
16.2 -1
16.3 -1
16.4 -1
16.5 -1
16.6 -1
16.7 -1
16.8 -1
16.9 -1
17 -1
17.1 -1
17.2 -1
17.3 -1
17.4 -1
17.5 -1
17.6 -1
17.7 -1
17.8 -1
17.9 -1
18 -1
18.1 -1
18.2 -1
18.3 -1
18.4 -1
18.5 -1
18.6 -1
18.7 -1
18.8 -1
18.9 -1
19 -1
19.1 -1
19.2 -1
19.3 -1
19.4 -1
19.5 -1
19.6 -1
19.7 -1
19.8 -1

This is a graph of the Euler Method that we inputed in Excel – it matches our corrected direction field graph.

I found this project very difficult from the aspect of Matlab.  I was very thankful to have Mat as a partner.  I was a little frustrated because I did not feel like I was contributing to the level that I wanted.  But, it has caused me to push myself further – not just to be of better assistance to my partner – but, it helped me recognize what I did not know and need to know to keep up with my peers and better myself and my career.  I found that at first nothing seemed to connect and make sense – but the more I stayed with it – it all tied in at the end to make a “big picture” :-)   Each portion added to the other – the qualitative and analytical was very helpful to me.  

 

 

 

 

Advertisement

1 Comment »

  1. 1
    Gary Davis Says:

    Anne, wow! There’s some heavy and valuable reflection here. You’ve done very well on all scores – the explanation of Euler’s method and its implementation on Excel, the – multiple – use of the direction fields – the exact solution. You’ve used LaTEX appropriately. The only one thing missing is a general overall coherent story of the mathematics. But, overall, very good.

    23/25


RSS Feed for this entry

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.