## MAT 2680 Differential Equations - Reitz

### "...how it differs from the rocks"

This post contains additional information related to the Numerical Methods Project posted last week, due March 23rd.

Submission guidelines. Your completed project will consist of three elements:

1. A working numerical methods calculator using your choice of technology (spreadsheet, programming, mathematical software), as described in the previous post.
HOW TO SUBMIT:

• If your project is a spreadsheet, either share it with me (if it is in Google Docs or a similar cloud-based platform), or email the file to me as an attachment.
• If your project is code, please submit it using an online coding site like ideone.com – once your code is working on the site, you can simply submit a link.  If you are using a programming language not supported by ideone.com, you can email the source code to me.
• If your project uses mathematical software, either share it with me (if it is in MatLab Online or a similar cloud-based platform), or email the file to me as an attachment.
2. Solutions to the following example using each of the three methods studied in class (Euler’s Method, Improved Euler’s Method, and Runge-Kutta), generated by your numerical methods calculator.  Submit using the same method as in part 1.

Project Example.  Given the differential equation $dy/dx = \frac{xy}{x-y}$ and initial condition $y(6)=0.8$, approximate the value of $y(7.1)$ using Euler’s Method, Improved Euler’s Method, and Runge-Kutta.

For each method, choose a step size that gives four correct digits following the decimal point.  How many steps are required to obtain this level of precision?

NOTE: The actual solution is $y(7.1)=3.700936$

1. Writing assignment.  Write one or two paragraphs (minimum 300 words) responding to the following.  Leave your response as a comment on this post.
1. Describe your project and how it works.
2. Describe the process of building your numerical methods calculator.  What kind of technology did you decide to use, and why? Did you encounter any unexpected challenges in completing this project?
3. Why do we need numerical methods in addition to the other methods studied in the class?
4. Why is this assignment included in the class (instead of just computing the various methods using a calculator)?
5. Please include a link to your project (if it is online), or clearly state that you will be sending me the files by email (and don’t forget to do it!).

1. first, i need to solve the function on a paper to get the information i need to solve the function on excel or numerical methods calculator. The process of building the numerical method calculator was difficult for me since i don’t use excel that often. i chose to use excel on school’s computer because i do not have excel. There are many unexpected challenges in completing the project. Example, like the function command on excel and the tools on excel were difficult for me since i do not know where the command is located or what command are there. Numerical method is one of the most precise method that we can use to solve a problem in the class. The assignment could also taught ourselves to understand what other tools are available for us to solve numerical problems. I will send an email

• file too big, ill share with dropbox

• Dear Jacky,
Thanks for being first to post – looking forward to seeing your solution!
-Prof. Reitz

• Heads up – for full points, you should expand your answer to meet the 300 word minimum (I’ll accept a separate comment with a continuation of your thoughts if you wish).
Best,
Prof. Reitz

• first, i need to solve the function on a paper to get the information i need to solve the function on excel or numerical methods calculator. First, need to input all the required numbers and information and name them.the h is step size, x0 is x initial,y0 y initial, and xn x final use to calculate the y(x). Then, i set another column depending on each question. For example, euler i input x and y starting with the number provided on the question. For X i set the initial number and for the rest will be set by how many steps. For, Y i input the initial number after that i will create an equation on excel. The process of building the numerical method calculator was difficult for me since i don’t use excel that often. i chose to use excel on school’s computer because i do not have excel. I did do some online research about the excel. For example, the excel commands and how to input equations. There are many unexpected challenges in completing the project. Example, like the function command on excel and the tools on excel were difficult for me since i do not know where the command is located or what command are there. Numerical method is one of the most precise method that we can use to solve a problem in the class. The assignment could also taught ourselves to understand what other tools are available for us to solve numerical problems. Sometime, calculating a math problem is much more simpler and precise but it could be difficult depending on the math problem. Sometime we use numerical method with use of computers is because the steps that is required to solve the problem is much more difficult or many steps to solve the problem. I will share it with dropbox

2. I chose to do my project on excel because it’s basically the only program I know how to use. I could’ve have used MATLAB but I’m not really that good in writing functions. Anyways, the process of building a numerical methods calculator wasn’t too bad because in excel all you have to do is put the given information into the cells and then plug them in to the formula. After doing that, you find y_(i+1). The only challenging part of this project was finding the step size (h) because we had to find y(7.1)=3.00936… with a 4 decimal precision. We need numerical methods in addition to the other methods we’ve studied in class because numerical methods gives you a precise answer. It’ll give you an even more accurate reading if you’re using Improved Euler’s or Runge-Kutta methods. I believe that this assignment was included in the class because so we can have an understanding of, depending on the method one uses, how many steps it takes to get answer. Like if we have a small step size h, we will get a more precise answer where as a bigger step size h, will not be as precise, but of course, there’ll be a lot more steps to a smaller step size h. ..I shared my file on Google Docs and I emailed it to you as well.

3. For this project I decided to use a spreadsheet method for the calculation of Euler, Improved Euler and Runge-Katta. There is a column for each input that has been programmed to calculate the output of each criteria.
I used excel spreadsheets to build my numerical methods calculator because it is the most familiar option for me. One of the unexpected challenges that I faced during this project was figuring out the step size value. The second unexpected challenge was the amount of steps that had to be taken in order to get the final value within four decimal point accuracy. That unexpected challenge lead me to the realization that coding would have been a much better option and I should learn how to code one of these days.
We study different methods in class to help us decipher which method we should use when faced with a difficult equation. We need numerical methods in addition to the other methods we have studied to calculate the solutions (curves) that will produce answers that can help investigate different types of real life problems.
This assignment is included in the class because it creates a better understanding of numerical methods and it would take a very very very long time to complete this assignment by hand. The assignment also to shows us that there are other mediums beyond pen and paper that can be used to solve differential equations.
I have sent you my project Via email.

4. For this project I used Excel. The reason I decided to use Excel over MATlab is because I do not have MATlab on my computer and I did not feel like staying in the computer lab for the duration of this project.

My project works by plugging in you x, y, step size and a few other things in order to create an approximate answer for the differential equation that was given. I sat down and wrote out the code for each method using the formulas for each part that we got in class. I was really comfortable making the code but the hardest part was determining the step size. I kept on increasing the step size over and over and it was not giving me an accurate answer. I ended up making the step size incredibly small and slowly increasing it till I got the desired amount of decimals accurate (4 after the decimal point). I was really surprised at the difference in Step Size between each method with Euler’s method taking the most steps and the Runge- Kutta method taking SIGNIFICANTLY less steps. It really helped me to put in perspective how accurate each method is.

We need numerical methods in order to get accurate answers for Differential Equations that we can not solve with other methods we have learned in class. With numerical methods, any differential equation can be solved regardless on if you know how to solve it or not.

I believe this assignment is included in the class to help show us how powerful and accurate some of the numerical methods can be in inputting a small step size and producing an accurate answer. It was also put in the class to help better our understanding of each method and how they work,

I will be sending this project to you by email.

• Ryan, I really like your comment “I was really surprised at the difference in Step Size between each method with Euler’s method taking the most steps and the Runge- Kutta method taking SIGNIFICANTLY less steps.”

I admit, although I know that Runge-Kutta is more powerful, I didn’t really realize how much better it is until I completed this project myself (just before class, last Tuesday). I was surprised too!

5. My choice to create a spreadsheet, a code, or a program to evaluate Eulers method, improved Eulers, and Runge-Kutta was to create a spreadsheet. I chose to use Excel because i am a bit more familiar with it that creating a code or using any other mathematical software. I have three separate spreadsheet for each of the methods. Each spreadsheet is broken down into row and columns. Each column is labeled to represent each part each section of the numerical method. At the beginning of each spreadsheet i have a cell dedicated to h= which is my step size. My differential equation is denoted in a cell where it incorporates the other accompanied cells to carry out that specific equation. Also, line 0 in each of the methods is dedicated to the initial condition given. For example if my differential equation is y’=x+y and my step size is 0.25 and the initial condition is y(0)= 1, then all i have to do is change the h in my spreadsheet and input the values for the initial condition and also the differential equation. Upon entering those values each cell will automatically change according to the resected numbers. Challenges i faced in creating these spreadsheets were getting all the cells to work properly together. Any small error can throw your numbers off or just simply return an error code back. This became especially true when it came to Improved Eulers method and Runge_Kutta methods.

We use numerical methods to give us an approximation of a certain point over time or distance. This approximation can be fairly accurate depending on which method you use and how small of a step size you use. The bigger the step size the less accurate your answers will be and vice versa. This assignment is included in the class because sometimes we may not have access to such computer programs that run these methods or a code; we can simply pull up our spreadsheet and calculate these results. Another reason may be that you are asked to find step 100 of that specific differential equation. To write out all those calculations by hand will take a very long time, and as time goes on human error can kick in because of fatigue or just simply overlooking a step.

Prof. i have emailed you my spreadsheets.

6. For my Numerical Methods calculator project, I decided to use Microsoft Excel. I chose to use Excel because I am not too familiar with MATLAB or creating a calculator with a programming language. For my Numerical Methods calculator, I created 3 sheets in Excel, consisting of Euler’s method, Improved Euler’s method and the Runge Kutta method. For each of the numerical methods in Microsoft Excel, I created a column for the formulas that were I needed. Some of the formulas for the calculator consisted of finding the f(x,y), y(i+1), z and k values. After creating my columns, I could then create formulas for the first row of each of the components that I was looking for by referencing the cells that corresponded to the formula. To help me see if I was on the right track with some of the formulas, I wrote out the formula and used a calculator and that would give me an indication that I typed the formulas correctly.

At the beginning of this project, I had ran into a few challenges with referencing the cells. To get a good idea of how the cells and equations worked in the Excel spreadsheet, I practiced the first example problem. After completing the first example problem, I worked on the second example problem. Initially, I thought that for each row, I had to type the formulas to get to the values. I soon learned that once my first row was filled with formulas, Excel could generate the values automatically for the following rows for each of the numerical methods. While I practiced the problems, I also began to realize how some of the cells were needed to generate values for other cells like the y(i+1) column. One of the other challenges that I had also ran into was guessing the step size, especially for Euler’s method since we needed to specifically generate a value of 3.7009 with the 4-decimal accuracy.

I believe this assignment is included in the class because it helps to give us a better understanding of how accuracy and precision works. I also see that we’re able to use the slope to help with generating the next y and y(i+1) values. Working on the numerical methods calculator in Microsoft Excel helped me to see and understand how only a few steps are required to find the y value, as opposed to Euler’s method which consisted of many more steps that were needed to find the y value. For the two problems, I saw how it was easy to guess a step size of the Runge Kutta method but it was difficult to guess the step size for Euler’s method. The less precise the method, the lower the step size will be which will help with finding the specific y value for each of the methods. The way I see it, if the same step size is being used for each of the numerical methods, the Runge Kutta method will be the most accurate, giving the precise or exact value that you’re looking for. The Improved Euler’s method is not as accurate as Euler’s, giving a slightly less accurate value. Euler’s method is the least accurate method but will give you a good indication that your approaching the value that you’re looking for. If the step size is altered for each case, then it is definitely possible to get the y value that is needed for each method but the amount of steps will vary for each method.

I will be sending my project by email.

• Despite the raw computing power of other platforms, I have always liked Excel and other spreadsheets because of their flexibility – they do a good job of taking your ideas and generalizing them (once you know the basics). Your description of working with them resonated with me!

7. For my Numerical Methods Project, I decided to use excel. I made three different excel spreadsheets, one for each method. The way each spreadsheet is set up, I will begin with an initial x and y value called x_i and y_i. For all three methods I used a step size of 0.1. Euler’s Method was the simplest to do since it only required two formulas. One formula calculated k and the other calculated y_(i+1). Euler’s Improved Method was a little more complicated because it involved more formulas. Using the initial x values and the step size of 0.1, I was able to find all x values needed until I reached 7.1. We were also were given an initial y value. Next step was to find k1. Using the given differential equation, I plugged in the x and y values to determine k1. I then found my z_(i+1) value, since I found the corresponding k1 value. Using the z_(i+1) value I next found k2 and using k2, I finally was able to find my y_(i+1) value or the next y value until I find the y value that corresponds to the x value of 7.1. From all three, Runge-Kutta was the most complicated. This method incorporated many more steps compared to the other two methods. For this method I used some similar formulas from the improved Euler’s method spreadsheet and calculated k1, k2, k3, and k4. To make it easier for me, I calculated z_1, z_2, z_3, and z_4 as well. This just helped me simplify the formulas for k1-k4. Finally, I was able to find y_(i+1) by incorporating the formula that averaged out all my k values found. This formula was given to us in class. Overall, this assignment wasn’t too hard. All it takes is understanding the formulas and being organized.
I used excel for my project because it seemed like the easiest way to include all three methods. I soon realized it wasn’t as easy as I thought. It took a little of researching and knowing how to use the formulas for each method as well as knowing where to place them in the excel spreadsheet. It also took a lot of trouble shooting to finally get the spreadsheets to work. Testing each formula before moving to the next one was key to making this project run smoother for me. I originally was able to use the first example given on Openlab to create all three methods. Once I saw my numbers equaled those given on the solution I moved on to the second example. We need numerical methods because it is an extremely powerful problem-solving tool. It allows us the ability to use large systems of equations and solve complicated equations as well, specifically differential equations for this class.
I believe this assignment was included in our class to help us understand each numerical method better. It’s one thing just putting numbers into a calculator but it’s another thing getting an entire spreadsheet or program to work. It takes knowing each of the different formulas to complete this assignment. I also believe this assignment was included in our class because most of the students in our class are majoring in computers and we were given the chance to incorporate our knowledge upon our field of study into this class. I will be sending my project to you via e-mail.

• David, your explanation of the development process if very clear – thank you. You say “All it takes is understanding the formulas and being organized”, but these are not at all easy – good job!

8. For my project I will be using the program Matlab and write a code in four different files which need to be put together to run the code to provide the needed outputs. If it is possible for me to implement the code in one file I will send it as such, but so far it only works when it’s in separate .m files. The reason why I choose Matlab because out of the other coding formats I believe doing it in Matlab is easier and needs a lot less lines of code, Matlab provides a less complicated compiler as well. Building the program became complicated only when I tried to do everything from the same script file, I’m currently still trying to develop a way to do everything from the same script file even after I turn it in. I included step by step messages into the code so each line has its own explanation so I don’t have to explain it line by line here. The biggest problem that I came across building the program dealt mostly with tiny errors here and there. Misplaced periods, and semicolons giving errors when the programed was compiled. It’s very easy to make a tiny mistake when using Matlab because unlike C++ and other programming languages Matlab is very specific, if you do not write it exactly how its suppose to be it won’t be able to correct the error itself. The purpose for additional methods is to give better approximations when presented with different problems, so one method might provide an easier path while another would take longer both giving either further or closer approximations depending on the step. I believe this assignment is included in this class to provide alternate hands on methods other than just a calculator to answer these complex problems. Just like the methods themselves it’s good to know multiple ways to solve a problem, and multiple ways to implement different strategies of using the methods themselves.

• Cody, I have only limited experience with Matlab development – I’m looking forward to seeing your project. Your final comment “Just like the methods themselves it’s good to know multiple ways to solve a problem, and multiple ways to implement different strategies of using the methods themselves” is spot on – for future engineers, I think this is one of the primary takeaways from this course.

9. For the Euler the user needs 360454 steps
For the improve Euler the user needs 5633 steps
For Runge Kutta the user needs 1409 steps
To obtain this level of precision.

The project is fixed to one differential equation since creating a calculator is kind of hard.
Therefore, users only can modify the step size to adjust the accuracy of the method, and the values given to find any particular solution, these are X0 and Y0.

The project is done on Microsoft Excel using spreadsheet. I did it through Microsoft Excel because it is easier to do since you need less typing and less thinking than in any other programming language because users just have to reference the cells and type in the formula. Therefore the syntax is really easy when compared with other programming language or math software. Thus this make Microsoft Excel the most efficient program when the user barely have time to compute their questions.

I built my calculator by looking at the formulas given on Web-work, this is found in the homework set number seven “the improved Euler’s method”. Then I found the step size value by using the h=.1 then I kept dividing the value by two in order to make it smaller because theses numerical methods get more accurate if the step size is small. In other words the smaller the step size the more accurate the method becomes. However, this increase the number of steps needed to reach the desire solution. I chose h=.1 because you can reach the solution in eleven steps with that step size (without it being accurate).

We need them because it allows students to find almost any solution without having to solve the problem on its original way. For instance, students have to solve a first order linear equation but they don’t know how to integrate, they can just use Runge Kutta method or improved Euler’s method to find the solution to the problem. This apply to almost any differential equation such as separable, Bernoulli, Homogeneous, etc.

This assignment is needed in class so students can grasp how accurate these methods are. These methods also allow students to develop their thinking process specially the Runge Kutta Method. The way the Runge Kutta is setup, allow users to see integration in other form. For instance, when you do a comparison between Runge Kutta and indefinite integration they are the same because when integrating the user increases the exponent by one and then the user divides by it, this is like finding the weight average. On Runge Kutta the user finds six slope, add them and then divides by six to find the weight average. In other words, on both of them the users increase their values, one exponentially and the other one additionally and for both of them you have to divide.

I will be emailing the files.

10. For the project I chose to use Excel. The reason I went with Excel over Matlab was that Excel is more user friendly and would display and save the values without having to run the program every time. I originally went with matlab but stopped using it midway because it required the user to press run every time. My calculator works by taking in the values given by the user as input and dispersing the answer. The required inputs the user must give are h, the starting x and starting y. It then calculates the value for y(7.1) .
One challenge I faced during the project was finding the required h step for each method. Because it was required we were accurate to 4 decimal places , I had to try several different h steps through trial and error. Another issue I had was that excel would give me different values depending on the PC I used. After googling the issue I found out this is due to the CPU and how far it it goes before it rounds. I tried the sheet on a intel i7 system and a pentium 4. The i7 was more accurate despite it being the same identical sheet. I think we study numerical methods along with other methods because in real life not all the differential equations we will face will be solvable using known methods. For these equations it is better to know how to estimate close to the answer then have no answer at all. This method is included over calculators because it is more accurate and faster. Using a calculator leaves room for user input error which can’t be viewed but with a excel sheet you can check each cell one by one until you find which cell had the mistake. Another benefit to using these methods over a calculator is that a computers were made for this. They are perfect at repeating a single task over and over without getting tired compared to people who will be tired. I will be submitting my file to you prof via email. It is also linked below.

11. At first when attempting this project, I wanted to use a programming language such as Java or C/C++ in order to be able to run all three of these numerical methods. After running into a series of syntax and compilation errors I decided to try another attempt with the Microsoft Excel Spreadsheets. This turned out to be a success. The most challenging part was determining, what was the step size was for each method and determining how many steps it would take for each method to be complete. After through a series of trial and errors and comparison with my peers, I was able to determine the correct step size. Overall, the main function of my spreadsheet is to give me the correct value for the x-values, y-values, k-value(s), and the step size.
After completing this assignment I found how useful it was and why we’re studying numerical methods. We need numerical methods and other methods we have used in class, so far in order to be able to not only solve, but to also check our solutions. These methods are a more efficient way of getting another point value when solving a differential equation. For example, in order to approximate the value from the differential equation using Euler’s Method it took 360,448 steps and that’s easy for a computer to do, but not a regular person. This is beneficial to us as students because it isn’t not just important to solve, but also checking our own answers. This is the purpose of this assignment is understanding how to determine the step size, while also approximating the new y value as close as you can. In the end I got a better understanding of how to use Microsoft Excel as a numerical calculator. Lastly, I will be submitting this assignment via e-mail.

12. To complete this assignment, I created a spread sheet using excel. Initially, I wanted to create a code for all three methods using C++, but I was having difficulty with the code giving me the correct output. I attempted to look up similar codes online for C++, but the way people coded their calculators were so different and complex than anything I learned for this language, that I was not able to follow along to create my own calculator.
The spreadsheet that I created in excel for all three methods had a column designated for inputs needed to solve the equation. A few examples would be h which is the step size, Xo which is the initial x value and Yo which is the initial y value. The way that the formula functioned for all three methods were very similar. They would take inputs in the designated columns that required user input, and then it would calculate the rest of the values in the table. For the Euler method, the formula calculated the k value and the y_(i+1). To solve the equation using the improved Euler’s method, I had to use the given initial x value and step size to find the remaining values that I needed. Lastly, for the Runge Kutta method, I had to calculate the values for k1, k2, k3, k4.
The main difference in the methods is the accuracy that you get for the values. The method that gave the most accurate value was the Runge-Kutta method with the improved Euler method following behind. The most difficult part of the project was finding the correct step size that gave the desired accuracy. By looking at the comments that have already been posted, it appears that I was not the only person who found this difficult.
I believe that the importance of the numerical methods and the other methods that we have learned in class is to be able to solve problems that are far too complex to be done in another way. It can also help with problems that you do not know how to solve using a certain method. I think that the project was included in the class to show how powerful that these methods are in calculating an accurate answer. For example, some of the steps that were needed to calculate an accurate answer were in the thousands. By using the computer to do these methods, the amount of time this problem took after I got the excel sheet to work was minuscule.

I have each code on three separate spread sheets and will email you each one.

13. It was a fun changeling Project. To solve this problem I used Microsoft Excel. I had many obstacle’s trying to figure out the right step size and how many steps I needed in order to get 4 decimal precision. Luckily Prof Reitz gave us the formula to get the correct step size to get the precision we want. The formula I used to find the step size was h(step size)=c(final x)-a(initial x)/n(number of steps). I started with Eulers Method. Then went to Improved Eulers, and lastly Runge Kutta method. I used formulas that was given and set up tables and functions into excel. During the course of doing this project I asked the prof Reitz for help and my peers for some guidance.
For Eulers method i used 360,488 steps with a step size of 0.0000030517578125 and for improved Eulers i used 6,000 steps with a step size 0.0001833333 and for Runge Kutta i used 1,408 with a step size of 0.000781. I noticed that the number of steps went down and step size went up as the methods improved. Numerical Methods gives us y’=f(x,y) and y(a) = b, we need to find y(c). Eulers idea was use slope at initial x and y points to approximate the next value because step size plus initial x gives us the new x. Improved Eulers method idea is use the average of the slops at initial and final to approximate the next y value. And for Runge Kutta idea was use weighted average of the slops at three points initial, final and the half way point to approximate y values. In my spreadsheet you can change the step size and given formula and number of steps and it will do the rest.
Numerical method showed us the accuracy we can get with using different step size’s. I think this method can be used at a larger scale. When i think of this i think of how rocket trajectories are made and we can relate physics and how fast an object falls or ascends. Numerical methods as well as other methods are show for us to explain how precision is important. I had a fun time building this calculator. This project Was Emailed to Prof Reitz.

14. For this project I decided to use microsoft excel because its a lot easier to understand. Even through I have experience with programming like C++ , I feel I don’t have enough experience to use it to create a numerical methods calculator. I had many challenges doing this project. It was difficult to find the correct step size. Creating the spreadsheet was hard as I looked online and on youtube to figure out how to plug in the formulas. I needed to ask my peers for help since after many attempts I had no idea how to solve for the step size. I created three separate spreadsheets because it was easier for me to work with. My project works by putting in the x and y, step size, and the formulas. That wasn’t the hard part of this project it was just finding the step size that caused me a lot of problems. When I got my results I noticed a few things. Euler’s Method takes a lot of steps, it took over 100000 steps to reach the solution I needed. Improved Euler’s Method used almost 600 steps to reach the solution a big difference. But the Runge-Kutta method was the best method to reach the solution because it took less then 30 steps. I think this project was included in the class so it helps us get a better understanding of each method. I also think this project was included to let us learn how to use different types of software to help solve these very complex problems. It also shows us that there is more than one way to solve the same problem. This project also shows us that by using mathematical software or spreadsheets we have a more accurate and precise answer. Even through developing the spreadsheets was difficult for me, this project helped me learn how software can be helpful in this class . I Emailed the excel files to you.

15. My Project was created using spreadsheet in my case using Microsoft Excel, I started to create my program in Java because I am taking a class and I wanted to use this project as great practice for my java class. I started the basic of the program and was advancing, but I got stuck in the steps and in getting the answer for the specific values of Y. I have the program well advance but incorrect outputs. The design included a nice entry key of any equation and the hard part is to figure the steps needed to get that final answer.

Well I finally gave up and I started to do my project in Microsoft Excel, it was hard to find the steps need to get the answer. Thanks that excel facilitate the advance in each step, or better to say that in spreadsheet is easier to find the steps needed to get the right answer. My project was build base on the reference from the open lab. I know there is a shortest way to not procedure so many steps, but, I am not too familiar with formulas in Excel, I basically learned how to use it watching videos online and example projects.

The value that I use for h was 0.1 to get the nearest answer to the value requested by the professor that was 3.700936 and with my h=0.1 I got 3.7009354…. for the EULER’S method after 360,454 steps. For the EULER’S IMPROVED method requires 5637 steps to approximate the answer to a 3.700954, and finally for the RUNGE KUTTA method I required less steps to get the answer to the approximate answer, it required 1,413 steps. One of the reference that really help me a lot was this website ‘’http://www.math-cs.gordon.edu/~senning/desolver/ ‘’ here you got a great calculator that can show you the answer for each method.
Is good to use this numerical method to solve the equation because it help you to approximate you answer to the value desire, and Like that you reduce the % error. This assignment included in the class instead of just computing the various methods using a calculator because there are so many step in order to complete or to get closer to the true value.

16. the project I created was used in a spreadsheet in Microsoft Excel. i initially started the project using MatLab but was not able to finish it because i didn’t have the program at home. it was very challenging find the step size ,had to do a lot of trial and error in order to find the correct step size. my other issue was with my CPU and it round off the decimals thankfully i found a way to correct it. we need numerical methods in addition to the methods we studied in class in order to either find more precise solutions or to check our work and errors. this project also gives us a great amount of understanding for the numerical methods as to just plugin it into the calculator because you cant really find the error you have done in the calculator as you can in the project. i will be sending the files to you via email

17. I worked with excel because it was the only program that i knew how to work i have little experience with MATlab but not enough to work the numeric methods. It took some time but i was able to adjust and use the shortcuts to excel.
It took a lot of tries but i finally found a working step size although it was very small the answer still came very close the the one given. i had tried numbers that did not seem too large at first like .011 and .06 but realized that it would have to be even smaller for the x value to be 7.1 and come out to the desired Y outcome.
Euler and improved Euler were relatively simple to get the formulas to work but when it came to runge method it took a lot of tries and different methods or writing out the formula to get them to work the way i wanted also the runge method has the largest step size

18. For this project , It was difficult to see which method was easier for me to use. As a computer major, I intentionally wanted to use java or c++. The reason for that was because I learned to use c++ and understand the basic programing code. It did get difficult to get the inputs so I decided to try java. Java is fresh and still learning. After looking up similar coding and getting advice to see if I can get the right input , I couldn’t get close to it. The coding was a bit difficult. There was definitely to many steps to take and wouldn’t be finish with the project.

I then thought to myself that creating a spreadsheet was way easier then a code, or a program to evaluate Euler’s method, and to improve Euler’s, and Runge-Kutta. Creating the spreadsheet is easier on excel because I have used this program multiple of time. Using the Excel program helped me create the codes and helped me get the values necessary for this project. I have created three separate spreadsheet for each of the methods so it would be easier to understand.

For each of the methods created in Microsoft Excel, I created a column for the formulas that were needed in order to get my values. The formulas consisted of finding the f(x,y), y(i+1), z and k values. After creating my columns, I then created the formulas for the first row of each of the components that I was looking. I tried to see if I had the correct values with some of the formulas, so I then wrote out the formula and used a calculator and that would give me a bit of help when I wrote down the formulas correctly.The importance of these methods is being able to solve problems like these. To help us think in certain ways. Even with many difficulties along the way, you can always find a right answer.For the Euler the user needs 360454 steps , For the improve Euler the user needs 5633 steps , For Runge Kutta the user needs 1409 steps. I will email you my project.

19. For the numerical methods project I chose to use Microsoft Excel due to my limited experience with MatLab and coding, this seemed to be the most realistic route. I made separate spreadsheets for each method and used the initial x and y value to find the next needed value using the formula in the following cell the value from that formula was then used in the next formula to fill in the next cell and so on. For excel to create a working numerical methods calculator, I had to learn how to plug formulas on a spreadsheet which would calculate the values needed to get to Y until Y=3.7009. One problem I encountered was finding a step size for Euler’s method. I did not expect to use such a small step size with so many steps. The ability to see each cells formula and values made it easy to find the errors and correct them to quickly see the results of the correction. After the long hard fought battle with euler’s method, it made improved euler’s and runge kutta method a much easier to process to fix errors and find step size.
We need numerical methods to be able to approximate the closest value possible when finding the actual answer is ether takes too long or is deemed impossible. We also need more than one numerical method so that when one when can’t find the answer or approximation, we more more methods to try out. This will lead to more accurate calculations and gives a way to rate how what kind of equations need what methods.
I feel this assignment was included in class to give us hands on experience in what goes on behind the scenes in calculators as opposed to just using a calculator itself and skipping the grind it takes to find the answer. Although it was tedious I feel now the knowledge is stuck with me better than it would have been without the project.
I will be sending my project via email.

20. For my Openlab project 3, I first attempted to write a Java code, as it is one of the classes I am taking and practicing the basics with. Even though the coding part seemed easy, it became a bit difficult as I am not that advance in practicing Java. My next attempt was to try out the Matlab. I had come half way with Matlab but could not configure further coding due to the fact we needed to find the right step size. In order to get the approximation answer of y(7.1) = 3.7009… with the decimal precision it became a bit difficult to do that in the coding software. My final attempt was to finally attempt Microsoft Excel. It was a bit challenging in the beginning but inputting the formulas makes it easier to get the results. To get the precision of the desired output, you can easily extend by highlighting and further stretch the data in order to get more precise results. Some of the errors I ran into while working on Excel was trying to be as precise as I can with my step size (h), which took me a while in order to better accommodate it. Euler’s method in the excel took many cells to get the correct precision compared to the Improved Euler’s method which surprisingly did not take that many cells compared to Euler’s method. The numerical calculator, which I built on Excel, is a basic working calculator that can easily be configured using or inputting other numbers to help with other problems. The reasons why numerical methods can be a good thing or benefit are by checking the accuracy of your solution. As shown in the previous lecture, we as humans can make mathematical mistakes so these numerical methods can help us better assist in finding the right number. I will be e-mailing the project to the Professor.

21. I use Java language for my Numerical Methods Project. The program works by assigning the initial values into the variables (x0 and y0) as well as the given equation I also need it to insert a previous calculated step size and number of steps. Once all the variables have a value I run the program and get the desired output for x=7.1.
I decided to you Java language because I’m current taking a Java class so I thought it would be easy. It was easy at beginning I got Euler’s method work, but my output was only given me the “x” and “y” values and not the slopes and the “y+1” in the same row. I moved forward to the other two methods, but my code wasn’t working I was getting the wrong answer because of the deadline getting closer I decided to use excel instead and actually it was easier to get the methods to work, the only difficult part was to figure out the step size require for each method. However, after completing the project on excel and the extension of the due date I was able to get back to the java code and input the formulas based on the way I did in excel and it works. I was able to output the values for each column of the three different methods.
We learn to solved differential equations using separable, bernoulli, non-homogenous, exact and linear equations. However, we were going to get a point where this equation wouldn’t help solve those differential equations. These three methods introduce will help us solve those equations.
I think this assignment was included so we can explore and come familiar with the variety of resources available to solve this type of equations because we never know when it could be useful. Thanks to this project I was able to improve my knowledge in excel and Java.
I will be sending the links by email, also I will be sending the codes and screenshots.

22. For this project, I decided to use C++ as a way of completing this task. I chose C++ because I thought I would have been easier to just write the formulae as a code and let the computer run till I get the result; I was wrong. When I first started this project, I first used Excel and realize that it was easy so I switched to C++. In my code, I use three For loops, one for the Euler, Improved Euler and the Runge Kutta method. First for the Euler’s method, I use h = 0.0000030517578125 as my step size and was able to solve the equation with 4-digit precision after 32 mins of running through all possible iterations in 360,448 steps. Second for the Improved Euler’s method, no matter how small I bring the step size down to so I started dividing .1 till I got 0.000195313, after plugging this value for h, I was finally successful to get the correct value. Lastly the Runge Kutta method was the easiest to calculate using C++ since is requires minimum steps, with this method solving the equation only required 704 steps and I used h = 0.0015625 as step size.
The way the loops in my program work is that once the loop starts, the computer stores values associated with the variables and plug them into the formula then stores the new values in a memory. When the loops run the second time, it uses the new value stored in memory as new value and it keep doing this until all the iterations are complete. For the Euler, I had to experiment on how many time the loop should run. I first started with a 1000, then kept increasing the number to runs unlit I reached the wanted value.
The main reason, numerical method are more advantageous is because with these method, you can calculate more complex equations which mostly will take forever in a shorter time frame. In addition, when these methods are used in a program like C++, spread sheet and other media, the process of solving becomes easier and less time consuming. Although, I said it’s let time consuming, while I was running my program in Visual Studio, it took me 32 minutes to find out if I got the right answer and that is probably due to the speed or computing power of my computer. I did realize that when I compiled the program on an online compiler like C++ shell it only took seconds. This assignment was a good way for some us that have a great deal of coding in our major or have majors that uses each C++, Java, Spreadsheet to test ourselves. Overall this assignment was stressful but rewarding when I finally was able to solve the equation using all three method with the requested precision. I will sending the source code for this project by email and screenshots of my output.

23. For my numerical method project, I decided to use Excel because I had a difficult time with Matlab. Using the equations I learned in class, I plugged in the appropriate x, y, h, and z values for each method. It was relatively easy to find the solution after plugging in all the equations and initial value, but the hardest part was finding the step size needed to get four digits of accuracy after the decimal. I skipped Euler’s method first because it took a long time to find the step size but the other two methods, Improved Euler’s Method and Runge-Kutta Method, took less than twenty minutes to finish. It was because the step size wasn’t as small meaning it needed less steps to get precision. Euler’s Method was hard because I had to keep changing the step size and extending the numbers of steps until I reach the solution that I wanted. Numerical method is important because there might be times when can’t solve a differential equation so we could use Euler’s methods and Runge-Kutta Method to help us reach the solution we need. The reason this assignment was given to us was so we can have a better understanding of what these method actually are and which methods yield a better result. Basically these method is using an initial point then either using the next slope, or the average of the slopes to find the next value and hopefully getting close to the point we want to find. Each method helps use find the answer but in order to have a precise answer we would need different number of steps for each method. Euler’s Method which is the easiest to formulate, uses the most number of steps and need a very small step size in order to get the four digits of precision. Improved Euler’s Method is relatively easy, use less steps than Euler’s method by a thousandfold in order to get the four digits of precision. Runge-Kutta which takes a little bit of time to formulate, uses the least number of steps. Runge-Kutta Method is the most precise and uses the a lot less step numbers.
I will be emailing the spreadsheet.

24. My project is a Numerical methods calculator that calculates an approximate value of Y at a certain point of X using three methods. Eulers, Improved Euler’s, and Runge-kutta. For each method I used Java. Like most programming languages variables need to be set up. I started each method by declaring an X and Y variable and an H variable. X= 6 and Y = .8 . Since most programming languages can compute basic arithmetic I started making equations that applies to each method. For Euler’s method I started off with a slope equation. Followed by finding the y1 value when x =7.1 with. To repeat the steps without writing the code multiple times i used a “For” loop to run the program to however many steps I decided. For each loop I also then put each output for all the variables needed to solve each method. Each method had the same basic principle just more variables/equations. In order to get the correct answer I also had to play around with the step and step size.

For my project I used the Java programming language.. The reason I used java is because I am currently taking a java class and we are learning how to create equations and loops. I encountered some problems because when writing a program each line is read one after the other. If i put an equation to early some of my numbers were incorrect so i had to make sure the order of each equation was correct. An example would be x+h. X+h formula needed to be in a certain order or some equations would get an X value for the next step instead of the current.

Numerical methods is important because it helps us approximate a specific solution faster than other methods. It also helps us deal with very large/very small numbers and large amounts of data that some simple equations can’t handle. Another reason why it is important to use numerical methods is because numerical methods is used for many solutions in the real world.

This assignment was given to us in class to show us the importance of why we need numerical methods and how it can be used in different forms and programs ( like spreadsheets and programming ) that you might encounter in the real world to solve problems. It also shows us the difference between the 3 methods. For example when using the Euler’s method it takes a huge amount of steps to get to the actual answer compared to the improved euler’s method. While the Runge-kutta is the fastest of the 3 taking the least amount of steps to get to the correct answer. The difference between the Euler’s Method and Runge-kutta is big and the assignment shows us the importance of numerical methods and how they can save time solving problems.

25. When I started doing this project, I was going to use Java because, I’m taking Java Script class this semester, so I tried to use that but I was getting some issues with that and writing the code was kind of hard. I tried to do it an easy way so I decided to use Excel Spreadsheets, and it is way easier than writing a code. I could’ve used Matlab too but still that required coding. So, using Excel Spreadsheet I was able to find the values for x, y, and z but the most complicated part was to set the step size. Beside this project excel is really good tool to do other things. Like, we can use it as a calculator. If we need to draw a diagram we can use Excel.
It is very important for us to use because by using numerical methods we can solve a problem and check the solution for it. We are learning these methods in class because we can find the exact answer for a problem. We do need this numerical methods so we can solve a problem and check the solution too. This assignment is included in the class because the calculator won’t just let us show how to check the solution. While doing this project we had to solve the numerical methods in 3 different ways. Euler, Improved Euler and Runge-Kutta. So we can solve these problems in not only calculator but using excel spreadsheet too. Lastly I will send you this project in your email.

26. I decided to use Matlab for my project because it gave me the flexibility to have a script where the user could just run it and it prompts them for inputs specific to their problem. Its generalized to work for pretty much any equation. Once the initial Eulers Method program was completed the other two were based off of that one. For some reason Eulers improved method took me the most time as I kept getting errors about indices not matching the matrix (meaning the array was too small for the index marker being called upon). This one issue took me almost a week to figure out. In fact I only figured it out an hr before writing this!
I believe we need to study the numerical methods because it gives us an actual number to work with. Our other methods give us formulas to plug into and this returns quantifiable data that can be graphed or used to solve real world situational problems (I’m hoping this will come in handy in my Vibrations class). This assignment is included in the class curriculum because it allows us to make use of those skills from other classes as well as what we learn in a class and apply it. It’s one thing to do math problems in a class and another to use what you learned about solving these problems to allow you aplly it in a different way. It demonstrates a fuller understanding of how each method works if you could program computer to do it. After all, we cant expect to program something to do something we don’t have a full understanding of, that’s just not how programming works. I will be sending all 3 script files through email! Its 11:30 while writing this but hopefully I can also get them to graph the function before 12!

27. For this project I planned to prepare something unusual to myself, I decided to create C++ program or just 3 of them to represent the three methods of finding the solutions to Ordinary Differential Equations. I’ve got a bunch of difficulties on this way, but finally created them. I did not get enough time to complete my idea of combining them into one program even thought it was not required to do. Each of my three programs work excellent. All solutions are matching with the examples posted. Each program need only simple changes in one line of code in order to change the equation. All variables are chosen by the user

28. Ideone.com could not recognise any line of the code which I tried to upload even though I try to put a couple of C++ versions in its setting in attempt to compile it and save online. Anyway, each of my 3 program do not have any problem to work in the software I created them, in Microsoft Visual C++ 2010.
In addition to the source code for the three programs which I sent by E-mail, I have also sent three screen shots of the output generated by each of the programs.
Those screenshots shows how the program works in interaction with the user providing approximate solutions generated by any of three numerical methods studied. It requests to enter initial values, step size and the X value for which user would like to see the approximate value of Y. So, during initial interaction with the program, the user freely chose these numbers. Even though the ODE by itself is build in for the user, for any one who knows how to access to the program, there is a line which I marked up. In this line the equation is simply written as the one which is required for this program. You can write any other ODE and the program will still provide you with correct answer. I have checked it already. So, the initially written into each of 3 programs ODE can be overwritten by any one who know how to get into the code. All you need to know is the the place where this line is located. These programs are very flexible, they works with any ODE, just do not use variables which this code doesn’t use. It was written for Xs and Ys.

When I was practicing with my code I also noticed that it may provide solutions at different precision level. This level is regulated by the number in just one commandl. The number 7 which I put there provides 7 digits after the decimal points of any number shown in the output which provides just slightly more than necessary precision. This precision can easily be regulated. For example, increase of this number provide more accurate results while decrease, makes the solutions rounded up to the number of digits chosen.