Matt and I started working on the Differential Equation .
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 – andthat 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, andalso reading one of the suggested texts. Right now – it kindof 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)
The first section of this project was to create slope (or direction) fields. A slope field is a technique that gives us a qualitative view to better understand the behavior of the solutions for the differential equation. Given an initial condition to a first order differential equation (equations that only involve the first derivative) we can see how the solution curve to the differential equation is behaving over a given period of time. This measurement of change over a period of time is also known as integration.
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. We didn’t know it at the time, but we needed to find an interval where something was occuring. We tried different intervals until we found something interesting.
First Slope Field Attempt
(Matlab code)
>> [T,Y] = meshgrid(-1:0.1:1,-1:0.1:1); the meshgrid command followed by the parenthesis sets the (x, y) axis at intervals of [-1 to 1] for the x and the y axis. we set the increments on each axis t(0.1)
>> S=-T*(Y+1); this next line of Matlab code defines our equation for S
>> L=sqrt(1+S.^2); this line of code sets the arrows in our slope field to the same length to keep our view neat and organized
>> quiver(T,Y,1./L,S./L,0.5), axis tight (graph 1) the quiver command produces the slope field for us
>> S=-T*(Y+1);
>> L=sqrt(1+S.^2);
>> quiver(T,Y,1./L,S./L,0.5), axis tight
Nothing interesting seems to be happening with this viewing angle. So, we tried again.
Slope Field – Third Attempt
(graph 3) (Matlab code)
>> S=-T*(Y+1);
>> L=sqrt(1+S.^2);
>> quiver(T,Y,1./L,S./L,0.5), axis tight
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
Success !!!!
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.
Now, I understand a bit more what this is revealing to us. The “Global Picture” that we finally found – the solution curves reveal separatrix curves – they are solution curves that that approach the unstable equilibrium point. Equilibrium points have constant solutions. The example given in our text Differential Equations With Matlab on pages 235 – 239 deals with predator prey models, ODE45 and the Lorenze Attractor – Now that we have covered these issues in projects two and three – I hope to give a better explanation than I did in September of what it is we are looking at…(to be added shortly) At (-1) there appears to be a boundary – the trajectories of the slope lines do not appear to cross this line x=-1 this is called an x nullcline. It is where the derivative equals 0. Equilibrium occurs when (dx/dt)=0=(dy/dt). When traveling along this nullcline – without crossing an equilibrium point – the velocity vectors are all the same. Once we coss an equilibrium poit – then the direction might change. Qualitatively we can see that there are two seperate trajectories that the vectors seem to be taking. This breaks the region into two different subregions – with two diffierent behaviors. These two trajectories are called separatrix. Separatrices are known also to be near saddle points.
Next, we used Matlab with different parameters to get a further qualitative look at our equation.
At this point – we were really just experimenting and getting used to commands in Matlab and connecting visuals to inputs. Even though we used a small delta x – you can still see gaps at points were the line seems dotted. To fill in all those dots would take an extreme amount of data and time and energy – therefore cost.
ezplot (SOL,[-.01, .01]), axis tight (very small increments of delta – looks almost linear – )
PART TWO
EULER’S METHOD – Analytical Technique
These are our input and out – put values – since this time – I have learned to use a program to capture a picture, save it as a jpeg and insert it into the blog – this way the data stays organized andpresents better . I also learned that Euler’s Method is an approximation method used to help find a numerical solution to a differential equation. We are actually approximating the derivative (dx/dy) at x. But, the larger the increments of (delta x) the larger the margin of error is in our estimates. To keep a close accuracy – a large number of very very tiny delta x’s are needed – so, even though it is an easy method – it can be very time consuming to achieve accuracy with our approximations – this visually showed me – the advantage we have over previous generations of mathematicians. Now, I can look back at what I struggled through – and it seems easy now. Not so, a few months ago.
delta x x y
0.1 1 5 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
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 Need to cut and paste into more than one column – or get original file off computer and use photo of excel spreadsheet to make this neater and more mature.
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

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 andmy 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.
Part Three – Analytic Technique – Computer Aided Solutions – Using dsolve command in Matlab
>> SOL= dsolve(‘DT = -T*(Y+1)’, ‘T(0)=2′,’Y')
SOL =
2*exp((-1/2*Y-1)*Y)
This method was very quick and efficient once we learned the code. The qualitative came in second place for me , the longest section was the Excel portion – the analytical method – and, it was the least precise. We found a function and applied it iteratively until we could get as close as we could to the desired function. This is known as Picard Iterative Process (method of successive approximations). We can substitute any intial condition into our equation and we may have a unique solution on the solution curve. The existance and uniqueness theorem helps us to determine if there is a unique solution to an initial value problem. What happens near the equilibrium point is important because it helps us to predict what kind of behavior our solutions will have.
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)

In conclusion, project one taught me how to think qualitatively and learn new skills that I did not have prior to this class. I have become gotten used to solving problems and getting an answer – it took a little while for me to get used to having a problem and getting a solution curve – or a set of solutions. I learned that there were different techniques and methods to solve differential equations whether it be explicitly or implicitly. If dsolve is not an option – or any other math software that can explicitly solve a O.D.E. – then possibly we can use some approximation techniques or the old standby’s like separation of veriables and substitution.
The draw back of estimating is that there is a margin of error – especially using Euler’s Method. Looking at things qualitatively allows us to visually see behaviors of solutions to differential equations. Since indepth calculations can increase costs because of time, equipment and labor costs - we can try qualitative techniques to answer questions to be more effective and efficient.





