"...how it differs from the rocks"

OpenLab #2: Numerical Methods PROJECT – Part 2

This post contains additional information related to the Numerical Methods Project earlier in the week, due April 4th.

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{x^2}{y-1} and initial condition y(-1)=-0.5, approximate the value of y(2) 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(2)=-1.87228

  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!).

 

39 Comments

  1. Jennifer

    a) For this project, I created a spreadsheet in Excel which needed an initial condition for x and y for the differential equation given. From this, the way the “calculator” works for Euler’s Method is the user can input a step size for h for the grid location of B4, an initial condition for x and y needs to be inputted at C7 and D7 (since that it where that column for the table is located), and to achieve the slope (k) plug in the coordinate values into the differential equation. To achieve the next y value, use the formula yi+hk but instead for those variables you will be using coordinate values from the table. It would only have to be done for one row after that to achieve the results for the whole table until you reach x=2 just drag (to copy) that row to the whole table. For Improved Euler’s Method, you would use the same strategy except for formula that used for the next y value instead would be used for the z value and you also have to find the slope for k2 by using the same formula as k1 but changing the grid coordinates to plug in for x and y. For Runge Kutta’s Method, you would use the same strategy as the other two methods except you would be need to have more z values and slopes (k1, k2, k3, and k4), specifically, the formula used to find the z value for z2 and z3 is yi+h/2*k1, however, for z4 it is yi+h*k3. Then to find the next y value, the formula that will be used is yi+h*((k1+2k2+2k3+k4)/6).

    b) When building the numerical calculator, I had to figure out what formulas would be needed and how to implement them onto the spreadsheet. Depending on what method that needed to be implemented to the differential equation, I needed to decide how many slope (k) values and z values needed to be added to find the approximation value for y when x=2. I decided to use Excel to create a spreadsheet for the table because it seemed an easier and understandable way to use Euler’s Method, Improved Euler’s Method, and Runge Kutta’s Method to calculate the approximation for y when x=2. I did encounter a challenge when completing the project for choosing a step size since it wasn’t given in the assignment. In order to know what step size should be implemented to the table, I had to do trial and error until I believed I got close to the actual value for y when x=2.

    c) We need numerical methods because it gives another way to find a solution to the differential equation (even if it an approximation) because sometimes there are differential equations that can’t be solved through the original method so it is a good idea to have another strategy to solve the problem.

    d) This assignment is assigned in class because it allows the students to understand how these methods can be applied for any differential equation given and how it can help solve differential equations when they can’t be solved the original way. In addition, you can observe how these methods make an effect to the differentials equations when comparing the approximation value to the actual value.

    e) The project assignment consists of 3 attachments which is sent to your email.

  2. Jonas Reitz

    Hi Jennifer,
    Thanks for being first-to-respond, and for your thorough post. I look forward to trying out your numerical methods calculators!
    Best,
    Prof. Reitz

  3. William Santiago

    a)This project uses google’s version of excel, which is Google Spreadsheet. I laid out the given variables to make it easier to perform a call back within the code. This basically means that you’re telling the program where to collect the data from. Once you tell the program where to collect the data from, it will then use a return function and then calculate the data that was laid out in the function. To make coding the program easier, I used a tool that was given within spreadsheet. This tool was a simultaneous copy and paste of one block 19 times. By doing this the program will automatically adjust on the fly within the next cells based off of previous data computed within the program. From there, I inputted the specific value needed to compute each of the variables needed before I performed the copy and paste function.

    b)Some issues that came along the way with the programming came with h modifying on the fly. Being that there was only one h, the code would stop taking the value of h since it would skip down one cell each time. Because of this, h had to be manually adjusted to obtain the proper approximation. The second issue came about when I tried to obtain the value of k2 by using the value of Yi. This was because the program collided to use each others given value. This was resolved by manually calculating for k2, then allowing Yi to use the manually calculated k2.

    c)When it comes to the three methods in question, these being Euler’s, Improved Euler’s, and Runge Kutta, they allows us to distinguish the importance of approximation. Although, the Runge Kutta Method may be the superior of the 3 methods as far as accuracy goes, starting with the Euler’s method is a much simpler way to initially learn how these computations work. From there, the complexity can be expanded upon by introducing the improved Euler’s method, and lastly The Runge Kutta Method once full comprehension is obtained.

    d)The reason for computing this via programming instead of with just a calculator in class is to avoid the manaughtny that comes with repeating the same calculations over and over again. This is also to help minimize any error within long drawn out calculations. It will also allow students to develop a deeper understanding of how to use all three methods for computation purposes.

    e) Since I did this on Google Spreadsheet, I will be sharing this file with you.

  4. Pastuszka

    a) My project was done in a three spreadsheets for each method.
    Euler’s Method Spreadsheet: the initial conditions are located in cells C6, and D6. There are 5 columns starting with A7 from left to right is the Step, the step size or h, the x_i value, y_i value, and k the slope. The step size is changeable under the h column just above the first step. The initial values were are entered as equations under C9 and D9, so they will change when the initial value at the top change. The slope or k value is entered as the differential equation given, selecting x_i, and y_ i for the values of x and y. To get the next y value the equation, y_0 +h(k) is used in the y_1 cell. The columns can be extended depending on the step size entered, to find x =2.
    Euler’s Improved Method: this is the same as Euler’s method with a couple extra columns, with the values for z_(i+1), k2. To retrieve the values for z, and the equation used is for the current y value + h(k1) is entered into the cell. The column to the right has is the value for k2, and this is found using the differential equation given to find the slope substituting into the equation the current x value for x, and the value just found for z into y. To find y_(i+1) in cell H8 the equation the previous y value + the average of k1, and k2 multiplied by the step size is entered. Taking this value and making it equal to cell D9. These columns then extended until the step size is increased until x=2
    Runge-Kutta: this one has a lot more columns added to make the equations in the cells simpler, so a variable could just be picked from a cell. The first part is the same as the following two methods, the difference is there are more k, and z values. There is a column added for h/2, and another one for the value of x+h/2. These are used to find the values for k2. Using the Differential equation and the values f(x+h/2,z2). To find z3 the equation y_i +h/2(k2) is used. The Differential equation is used f(xi+h/2, z3) to find k3. The value z4 is found using yi+ h(k3). k4 is found using f(xi+h, z4) coordinates for the differential equation. Once all the values are found for these columns a the following y value is found with the equation y_(i+1)= y_i + (h*((k1+2k2=2k3+k4)/6).

    b) I used a spreadsheet for each method because it was the only method I was familiar enough with to be able to enter formulas that would calculate the values in a simple way. I had to decide how many columns and what variables were needed to conduct the calculations. I found making more columns for simple equations made it less likely I’d have an error when entering a larger equation because i’d choose a cell for a portions of the calculation. I had some issues with negative numbers, and not using enough parenthesis for the equations in some of the columns.

    c) Numerical methods are used to solve differential equation we can’t solve by some other method. Depending on the use of the differential equation sometimes an approximation is a sufficient enough answer.
    d) The assignment is given because it shows how the step size can be decreased from Euler’s, to Improved Euler’s, to Runge-kutta, to get the same accuracy. Using a program made it so only a few calculations had to be checked and the rest could be computed automatically. If this was done by hand it would be a lot of tedious work.
    e) I will be sending the files by email.

  5. Riky

    a. My project consists of three c++ programs that calculate the solution using each method learned in class. In each one, I made a menu that asks whether or not the user has written the desired formula to be solved, if yes, the program proceeds, if no, then the program ends and tells the user to type their formula in line 8 of the code.
    I made floating variables for initial x and y, last x and next y, and h. The other methods included more variables such as k2 and z2 and more. I then set the precision for the places after the decimal point to be 4 using setf(ios::fixed). I then ask the user to input the initial values for x and y, as well as the last value of x, and the step size.
    I then set a while loop with the condition that while the absolute value of initial x minus the last value of x is greater than the set decimal point precision, the calculations for the next y are made. where that new value is then printed, with the next value of x being calculated and printed as well. When the while loop condition is no longer achieved, the program then goes on to print the final value of initial x, and the final value of y.
    In the Improved and Runge Kutta methods, the while loop also calculates values for the variables as well, such as for z2 and k2.

    b. I decided to use the c++ program due to my prior knowledge and extensive use of the program, with a little help from research and other people in my major. The initial problems I had with making this program was being able to display all the new calculated values onto a chart. Through some research, I learned of a function named setw(x), that allows the user to space out each designated value. I also ran into the problem of how to allow the user to enter a formula manually, from the output. Unfortunately I was only able to make a menu system that asked the user to enter the formula to be solved on a set line of the code.

    c. Numerical methods allow us to accurately approximate solutions to problems that need a set of procedures to find said solution. This also allows us to compute the error estimates within each solution with each precision approximation made.

    d. This assignment was given to us due to the amount of work it would take to calculate each one by hand depending on the amount of precision, as well as with each method learned. With this assignment, we are able to get a better, more accurate approximation for each solution due to the program effortlessly calculating each new value. We are also able to get more accurate in our solutions due to this as well, due to the fact that more accuracy means more steps, or smaller step sizes, the program is capable of doing said task at a quicker and more efficient way.

    e.
    Euller’s Method:
    https://ideone.com/Ooc0nL#stdin

    Improved Euller’s Method:
    https://ideone.com/0YBW9g

    Runge Kutta Method:
    https://ideone.com/qInfjz

  6. Dillen Pantua

    a) In my project I used Microsoft Excel to calculate a differential equation using the three methods, Euler’s Method, Euler’s Improved Method, and the Runge Kutta Method. It may be difficult to use this spreadsheet, but to use it properly is just to edit certain cells.

    To use Eulers Method, you must edit cell F15; You must replace x and y in the Function F(x,y), with the formula you desire. For example I used the example you set in this OpenLab Page, (x^2-0.5xy). For each ‘x’ in the formula you replace it will cell D15, and for every ‘y’ in the formula is replaced with cell E15.

    To use Improved Eulers Method, you must edit cell L14. Replacing every ‘x’ with cell I15, and ‘y’ with cell E14.

    And finally to use the Runge Kutta method you edit two cells, cell U14 and V14. For cell U14 you replace the ‘x’s with Y14, and ‘y’ with Z14. For cell V14 you replace the ‘x’ with AB14 and ‘y’ with AC14.

    b) It was very challenging for me to create this spreadsheet mainly because I was not familiar with Excel at the start of the project. Initially I began this project using c++, however I was running into many problems, such as prompting the user to enter a formula and then simply displaying the answers via each method as a result. At first when i finished the user would have to edit the code itself in order to input the desired function but that didn’t satisfy me. However, I was able to find a method which would work using c++ by parsing each input as its own letter or number, and then assigning it to a function, but I discovered it would be easier to use Excel since I remember it is good for charting data. When using excel I started by building a set amount of cells (35) to solve for each method. I started using Eulers method, then moved on to Improved, and finally Runge kutta. I had to research and learn how to use excel during this process.

    c)We need numerical methods in conjunction with other methods since, numerical methods offer a constant and consistent way of solving these equations. These methods are more tedious but since it is a system of equations, it is very precise.

    d)This assignment was included to develop a simpler method to calculate each value instead of working by hand which would be much more prone to error and would take longer. By creating a program that would solve these methods you get instantaneous results, and bypass and mistakes you could have made if you had done it manually on a calculator.

    c)The files will be sent to your email.

  7. Dillen Pantua

    a) In my project I used Microsoft Excel to calculate a differential equation using the three methods, Euler’s Method, Euler’s Improved Method, and the Runge Kutta Method. It may be difficult to use this spreadsheet, but to use it properly is just to edit certain cells.

    To use Eulers Method, you must edit cell F15; You must replace x and y in the Function F(x,y), with the formula you desire. For example I used the example you set in this OpenLab Page, (x^2-0.5xy). For each ‘x’ in the formula you replace it will cell D15, and for every ‘y’ in the formula is replaced with cell E15.

    To use Improved Eulers Method, you must edit cell L14. Replacing every ‘x’ with cell I15, and ‘y’ with cell E14.

    And finally to use the Runge Kutta method you edit two cells, cell U14 and V14. For cell U14 you replace the ‘x’s with Y14, and ‘y’ with Z14. For cell V14 you replace the ‘x’ with AB14 and ‘y’ with AC14.

    b) It was very challenging for me to create this spreadsheet mainly because I was not familiar with Excel at the start of the project. Initially I began this project using c++, however I was running into many problems, such as prompting the user to enter a formula and then simply displaying the answers via each method as a result. At first when i finished the user would have to edit the code itself in order to input the desired function but that didn’t satisfy me. However, I was able to find a method which would work using c++ by parsing each input as its own letter or number, and then assigning it to a function, but I discovered it would be easier to use Excel since I remember it is good for charting data. When using excel I started by building a set amount of cells (35) to solve for each method. I started using Eulers method, then moved on to Improved, and finally Runge kutta. I had to research and learn how to use excel during this process.

    c)We need numerical methods in conjunction with other methods since, numerical methods offer a constant and consistent way of solving these equations. These methods are more tedious but since it is a system of equations, it is very precise.

    d)This assignment was included to develop a simpler method to calculate each value instead of working by hand which would be much more prone to error and would take longer. By creating a program that would solve these methods you get instantaneous results, and bypass and mistakes you could have made if you had done it manually on a calculator.

    c)The files will be sent to your email.

  8. Maiqiang

    A)How to start.

    This project consists of an M file for Matlab application, to approximate the value of a first order differential equation through three methods Euler’s Method, Improved Euler’s Method, and Runge-Kutta.
    In the script, the section is dived into 3, UI, Conditions, and calculating loop.
    Both UI and calculating loop are fixed. No changes are required.
    Gather the following parameters of your first order differential:
    Y(a), Y(a), Y(c), dy/dx, and h or n.
    Filling the above parameters to the following corresponding parameters in the Conditions:
    tstart=, m(1,2)=, tend=, dydx =@(x,y) and h or n.
    Run the file in Matlab,
    The window will pop- up ask which method to use. Select the method then click continue.
    The result will return as a tabulation.

    B)Behind the scenes.

    The technology used in this project was Matlab, its a widely used online and desktop version mathematic software in many fields including engineering. While building it some challenges were raised and settled once.
    How do I process the data, which method to use ‘if loop’, ‘for loop’, ‘while loop’, ‘switch’

 etc.?
    How do I condense the code? So, one file can do all the jobs I required with fewer lines of code.
    How do I make a UI each time ask me what method to use?
    



    C)Why carry about it?

    The reason behind use numerical methods to approximate the result of differential equations is not all the differential equations are easy and solvable by the known methods we studied. Numerical method bridge over the missing blank to acquire the result in many different accuracies.

    D)Why not use pen and pencil?

    This assignment was including in the class as an introduction to numerical approximation. As the accuracy depending on the step size. The smaller the step size the more accuracy we get. That results we can have more than hundreds or thousands of repeated calculations to do. Which is a kind of annoying thing to do even with a calculator.

    E)Where is the file?

    You will receive the file in your City Tech email.

  9. James Picon

    a) My project was done through the use of the c++ program. In the program, I call iomanip and cmath in order to use the functions associated with them. I then set the function k to be variables x and y, which will be called later in the code. I then set f to be the differential equation. In the main() function of the code, all the variables to be used are called float variables so we may use decimal numbers for each one. The variables xi, yi, x, y, and h are set. The display will then tell the user to enter the value of x that is to be used to find the last value of y. After, the display will also tell the user to enter the step size h. Once the user has input both values, the program uses the function setw() in order to set the spacing for each output listed. Here, the display shows n, h, x, y, k, and y_(i+1), with 13 spaces through 22 spaces in between each one. A while loop is then used with the condition using the absolute floating value of x-xi, being greater than the step size limit, the function will continue to loop. Within the loop is the math to getting the value of y, which is then set to the value of y0, and xi, which is set to xi+h, the next step number is also displayed, with n, and with n++, the step number displayed is able to be increased. Once the while loop condition is no longer met, the loop ends, and the final values for n, h, xi, and y are displayed. With the end output displaying to the user that the value of y, using the last value of xi, using the specified method, is the final value of y.

    b) When building the calculator, I decided to use the c++ program, since it is a program we use a lot in my major. And since I have a lot of experience with this program, I did not run into any major problems, however, I had to figure out what formulas to use in each program.

    c) The reason why we study numerical methods in the class is to learn new ways to solve problems. For example, in some exercises you are only asked to find a value at a specific point, then you can apply a numerical method to find the solution. Also, these methods can solve problems that are not analytically solvable and usually, people use computers to make the calculations and improve the precision of the results.

    d) This project is assigned in class because it allows students to have a better understanding of these methods. Also, it helps students develop new skills, such as learning new programming languages and at the same time, students are learning how to use technology in their favor to solve real-life problems.

    e) I will be sending 3 cpp files by email.

    Precision:

    Euler’s Method
    h = 0.000005
    Number of steps = 600,000
    y(2) = -1. 872279725

    Improved Euler’s Method
    h = 0.0005
    Number of steps = 6,000
    y(2) = -1.872281367

    Runge-Kutta
    h = 0.005
    Number of steps = 600
    y(2) = -1. 872281323

  10. mitchell.ayzenberg

    a) For this project, I chose to do it on Microsoft Excel. On excel you enter the formula for each value you want, but instead of using x’s and y’s you use grid numbers. For example in euler’s method, you would put your timestep(h) in grid D2 and put your initial conditions for x and y in grids C5 and D5. Also, column B(from grids B5 to B20) would have the timestep shown. In order to find slope (k), you would have to plug in the x and y values into the differential equation. So for this example, you use grid numbers and for slope k it looks like : (C5^2)/(D5 – 1). Once you put it in the first column you can drag down so it continues. To find the new y, you would have to use the formula (y_i + h*k). To enter this formula in excel, you would use D5 + (B5*E5). Finally, you drag all the columns down it it gives you each result. For improved euler’s method, it uses two slopes (k1 and k2) and has a z value that acts like a y in the slope k2. You use the same process as the euler’s method, in which you use grid numbers instead of x’s and y’s in your formulas. For Runge-Kutta, it uses 4 slopes (k1,k2,k3,k4) and gives an outcome y which takes the aves of all the slopes and multiplied by the timestep plus the previous y. Using grid numbers you would replace all the x,y, and k’s using their respective grid number.

    b) I chose microsoft excel because I am not yet advanced with any mathematical softwares or programming languages. Even though i knew a little about excel, I still had to do some research on how to construct a calculator. When building my numerical methods calculator, I first used the example you provided so that I can match up my data with yours to see if I’m on the right track. One challenge that I encountered was trying to drag down some of the columns so that it would continue on. Sometimes I would drag down and the numbers would be the same because it was keeping the same formula for each row. I then discovered that in order to fix this i had to first complete the formulas for each first grid of every column and then i can start dragging down column by column.

    c) We need numerical methods because these type of problems are tedious to do by hand or analytically. Numerical methods most likely will not make a mistake, meanwhile when using a method studied in class you can easily make an algebraic mistake. And if you make a mistake in the beginning of the process, then your mistake will carry on to the end.

    d) This assignment is included in the class because it helps us understand these 3 methods better. For me, using excel and having to use grid numbers gave me a better understanding of which values are supposed to be substituted. Some formulas can get a little confusing, but when you use grid numbers you know which values they are.

    e) I will be sending the excel files to your email.

  11. YuFang

    a)For the project, I used excel to compute each of the methods. I have written all the formulas on the top right side to give an idea how I solve for each valuable. I also added certain colors to certain cells in excel indicating which ones could be changed if you were to compute it with a different formula or just different numbers and which ones shouldn’t.

    b)I used the same format as I did for the example problems, except for the dy/dx that is changed. This means that all the k’s (k1,k2,k3,k4) has to be changed as well. The k’s I have to manually change it in the table (only the first/second row, then I just copied them to entirety of the row), while everything else can be changed in the colored cell. A problem I encounter is finding the step size for the Euler’s Method, I had to expand the table so many times excel crashes each time I add a few thousand more rows. Thus I gave in and rounded up to the nearest hundred-thousandth. For the Improved Euler’s Method, I increased the step size ten times bigger than Euler’s Method to reduce crashes and unnecessary work. This means that IEM is at least ten times better at finding precise results than Euler’s Method. For Runge-Kutta, I did the same as previously, ten times greater than IEM or a hundred times than greater than Euler’s Method.

    c)We use numerial methods because it help reduces the workload. If we have to solve for a hundred set of linear equations, it will take an extended period of time. There are also problems that doesn’t give the exact solutions such as infinity, thus using numerical method, it’ll give a result that is very close to the original answer.

    d)This methods are included because it help us understand the different ways of solving. It helps us reduce the amount of repetition and eliminates (or at least greatly reduces) errors that may occur.

    e)I’ll be sending the excel via email

  12. Benny Lui

    A) My project Euler method, Improved Euler method, and Runga Kutta method was done on C++. First I added the libraries to enable certain functions. Then I created and initialized the differential equation with double. Then I created an int main for receiving inputs for x, y, and h for step size. Then i made a while loop so that the euler method would keep on running until it reached the desired number. I did this by subtracting the end condition with the initial condition and making it keep running until it is less than zero. Within the while loop i put the step size plus the initial condition. Then i putt in the Euler method formula to find the y. For the improved euler method the code was almost the same just modified to obtain more values. In order to obtain more values i initialized more variables using double because it allows the input and output to be in decimal form. For the improved euler method i added a k2 and z into the code so that the improved euler method formula can be used. I also added a cout for k1 and k2 within the while loop so it can show each k1 and k2 after every step. The Runga Kutta method I used the same int main but changed the while loop. I created z2,z3,z4 . I also needed to create a new variable to put inside the k2 and k3 so i made d2 and d3. The new variables was needed to be used to find k1, k2 , k3, k4 to put into the final formula.
    B) I chose to use C++ because it seemed the easiest because i had used the program before for other classes. The process of building this calculator was difficult because i ran into certain problems like unable to create a code that allows the user to input the equation but i was only able to receive inputs for the certain variables.
    C)We need numerical methods in addition to other methods studied in class because it allows us to further understand the process of certain problems. It also allows us to challenge ourselves with how math can be used in many different ways.
    D)This assignment was included because it shows how the other programs are created to benefit the understanding of math topics.
    E) I emailed you the source code.

  13. Benny Lui

    A) My project Euler method, Improved Euler method, and Runga Kutta method was done on C++. First I added the libraries to enable certain functions. Then I created and initialized the differential equation with double. Then I created an int main for receiving inputs for x, y, and h for step size. Then i made a while loop so that the euler method would keep on running until it reached the desired number. I did this by subtracting the end condition with the initial condition and making it keep running until it is less than zero. Within the while loop i put the step size plus the initial condition. Then i putt in the Euler method formula to find the y. For the improved euler method the code was almost the same just modified to obtain more values. In order to obtain more values i initialized more variables using double because it allows the input and output to be in decimal form. For the improved euler method i added a k2 and z into the code so that the improved euler method formula can be used. I also added a cout for k1 and k2 within the while loop so it can show each k1 and k2 after every step. The Runga Kutta method I used the same int main but changed the while loop. I created z2,z3,z4 . I also needed to create a new variable to put inside the k2 and k3 so i made d2 and d3. The new variables was needed to be used to find k1, k2 , k3, k4 to put into the final formula.
    B) I chose to use C++ because it seemed the easiest because i had used the program before for other classes. The process of building this calculator was difficult because i ran into certain problems like unable to create a code that allows the user to input the equation but i was only able to receive inputs for the certain variables.
    C)We need numerical methods in addition to other methods studied in class because it allows us to further understand the process of certain problems. It also allows us to challenge ourselves with how math can be used in many different ways.
    D)This assignment was included because it shows how the other programs are created to benefit the understanding of math topics.
    E) I emailed you the source code.

  14. ChunYu Lin

    I’ll be sending all my files via email including code and short responses.

  15. ChunYu Lin

    I’ll be sending all my files via email including code and short responses.

  16. ChunYu Lin

    I’ll be sending all my files via email including code and short responses.

  17. David levi

    A) For this project, the objective was to estimate the amount of steps it would take for our function to reach the correct Y-value (up to four decimals) at the specified X-value, which is 2. In general, the most accurate approach is to increase the amount of steps which thereby decreases the step size, and calculate the slopes at each desired point(s) and to use that to guide you towards your point of interest (which is when X=2 in our case). This process gets very repetitive and since we use the same formulas over and over again, we can create a program that will perform the calculations automatically as opposed to us doing the computations manually, which would be extremely time-consuming. The numerical methods calculator was programmed so that once you change the step size, the rest of the values will change simultaneously.
    B) I used excel for this project since that is what I am most comfortable with, as well as for its relative simplicity. In my numerical methods calculator, I used the same table format that you used in the first example for simplicity purposes. I inputted in the first row all the given start values and the given differential equation, as well as the formulas needed to compute the rest of the points. Once I created the formulas, it calculated all the values for the first row. I then dragged down all the columns until I reached the appropriate number of steps (when X=2), and observed the final results and assessed if the step size needed to be changed. For one of the numerical methods, I accidentally inputted the incorrect starting point which led to some very confusing results since my answer was getting worse and worse as I would increase the number of steps. Fortunately, you pointed it out to me and I was able to correct it with ease.
    C) It is necessary to study numerical methods since those work for any kind of first order differential equation. All the methods we learned only relate to a small portion of all possible first order differential equations one might chance upon. That is why this method is very helpful when using it with respect to a differential equation that can’t be solved by any known method.
    D) I believe this assignment was assigned for multiple reasons, one of which was for us to see how each of the three numerical methods compare to each other in terms of accuracy. For instance, it took 12,000 steps using the Euler’s method to get the correct solution, as opposed to Runge-Kuttas method which took only 60 steps by comparison. This highlights how a few simple tweaks created a much more improved approximation.
    E) I will be sending you the excel files via email to you.

  18. Ivan Rodriguez

    For my project, I used Euler’s Method, Improved Euler’s Method and the Runge Kutta Method using spreadsheet in Microsoft Excel. I chose Excel because it was the only program i knew how to work things out. Since we were given the formula and our xi and yi, for Euler’s Method, we had to find K using the formula which is already in that cell for k. If you want to make changes, just change the step size and x as for all the the methods were the same step size which was really short. As for the Improved Euler’s Method, we not only needed to find k, but also z and k2. The formula is already there, so if any changes were to be made, just change the step size and x so that you’ll get the results your looking for. For the Runge Kutta Method, we had to find k1,k2,k3,k4, z2,z3,z4 in order to get our next set of y. For this, if any changes were to be made, just change x and the step size if you don’t really like to work with small numbers. I used small step size so that you were able to get as close to the answer, which the Runge Kutta Method got me the exact answer. The process of building this was hard at first because I wasn’t getting the answer. This was due to either not putting them correctly, not having enough parenthesis, or not that specific of what the formula should be. We need numerical methods because they help us get an approximation of the solution to a certain problem. In my case, Runge-Kutta Method got me the exact answer to the problem. It’s very useful these numerical methods. Computing this in a calculator would give us a certain answer and also does not have enough space to give us a big output as for the numerical method and computers can help us get solutions that is either very big or very small. As for the project, I’ll send it through the email.

  19. RahkeemW

    a) For my project I used Microsoft Excel to calculate Euler’s Method, Euler’s Improved Method and finally the Runge-Kutta Method. Each method has its own spreadsheet, and on each of the spreadsheets, the initial conditions are located in cells B8 and C8, with the step size, “h” located on the far right of the sheet. To use/edit the sheet, you would only need to edit X_i, Y_i and the step size, and the rest of the sheet should adjust to the new set values.

    b) To make this numerical methods calculator, I tried to closely emulate the table we would make in class, and while in theory it is easy, dealing with the syntax of Excel made things somewhat difficult. One to many, or not parenthesis would end up changing everything and giving me incorrect values. The Runge-Kutta Method gave me the most problems since there were so many steps to keep track of and making sure the math was correct every step of the way.

    c) We would need numerical methods to assist in solving (or more accurately, approximating) a very complex differential equation that can not be solved by the other methods we have learned in class.

    d) The assignment was given to us, to give us a loose idea of how computer computation actually works

    e) I will email this to you

  20. Robertxander Bello

    Numerical Method Project

    The project was an extension to our in class lessons on Numerical methods. The three methods are Euler’s Method, Improved Euler’s Method, and Runge-Kutta. I chose to build my numerical method calculator in excel as a spreadsheet. I chose this method because I wasn’t very familiar with a programing language and because learning to make a spreadsheet was good practical knowledge for the work place. The process was not too complicated. Essential I just created a column for each part of the numerical process. The x and y values in the table were linked to another cell, as well as the step size, h. The cells of the step space, the initial x value, and the initial y value can all be changed depending on what’s needed. However, the equations need to be changed directly depending on the differential equation that is given. The essential columns had an equation, and each equation related to another, and eventually you get an answer.

    Euler’s Method and Improved Euler’s Method were simple; however, Runge-Kutta was incredibly frustrating and tedious. Compared to the other two methods, the equations for Runge-Kutta were much lengthier, making it easier to make small errors. Another tedious process was figuring out the step size needed for an answer with a 4 digit after the decimal point accuracy. The step size for the Euler’s Method was 15,000 steps! There are times in mathematical problem solving that an exact answer is difficult, if not, impossible to find. We can use numerical methods to approximate an answer. The importance of this assignment was that it showed us how tedious these calculations can be, as well as, how much more accurate and precise the Runge-Kutta method really is compared to the other two. Instead of dealing with 15,000 steps in the Euler’s Method, we can relax and use Runge-Kutta.

    *Files will be emailed you, Professor.

  21. Cristhian U

    A. Before I started I had to write down the formulas I needed for each particular method. The first thing I did was write down the formula, this can be changed to solve other differential equation, however it must be written on the code section itself before running it. I chose to do it this way for simplicity. After that I began with a menu option in which the user is asked to choose which method they would like to use to approximate a particular solution to the differential equation. I did this using a switch statement. After the user has selected the method, the code will go to the chosen method and it will execute it. First it will ask the initial condition (values for x0 and y0), then it will ask the step size (h) and lastly it will ask the value of x for which y is being approximated. Each variable is declared outside the case switch so they can be used for any of them. Each case is its own method, with the corresponding formulas such as slopes k1, k2, k3, and k4 for Runge Kutta, y+i, dy average, dy2 for Improved Euler’s method. When the while loop has the absolute value of x minus the last value of x is less than the decimal point precision, it will come out the loop and print out the results of x and y, otherwise it will continue to calculate the next x0 and y0. At the end of the calculation I have a while loop which asks, if the user wishes to
    continue. I tried making the interface as friendly as possible.

    B. Building my numerical methods calculator was not a lot of trouble. It was actually fun. I chose to do it in C++ as coding has been something I have become use to, as my major is computer engineering. The only minor problem was keeping the syntax and variables in check since C++ is case sensitive. I was very happy with the end product

    C. We need numerical methods other than those we studied in class because not all problems are analytically solvable. We can determine the level on precision every step of the way.

    D.I think this assignment is included in the class because it allows us to use outside knowledge and integrate it with topics learned in class. Similarly, if there is very little understanding of any of the tools allowed, then it’s the perfect opportunity to learn how to use them to enhance our understanding of the topics we are learning. As well as see how these tools can and are being used to solve real world problems.

    E. I emailed you the link.

    Euler’s Method:
    h = 0.000005

    Improved Euler’s Method
    h = 0.0005

    Runge-Kutta
    h = 0.005

  22. Kevin Pineros

    A) Ok, so the way I approach this project on my end was using a mathematical program called “Matlab” that is also useful for solving problems for differential equations. It also is beneficial since it can also solve numerical methods problems by simply inputting the problem on the program… however it’s not that easy to grasp right away. In Matlab, there’s a required format to input and do these type of problems (eulers, runge kutta and improved eulers) and as a guide I checked on the documentation page of MATLAB for help. The reason I chose Matlab as well is cause I’m also using it in my engineering course so it’s familiar. In the program itself, you’ll need to input the stepsize by setting it to H = 0.1 which is what I put. By adding the initial value as well and how long you want the x and y to hold results. In most cases, in eulers method you go up to 2. The main part of my project code was inputting the formula of eulers to matlab and that’s by typing the real formula that’s used in class. I also made sure to set each variable to a specific letter so that it corresponds to the formula too. At the end of the short code, I placed a printf which in coding is the main function to display an “output”. My output at the end displays the result of -1.47 which means it’s correct. It’s definitely approached as a calculator because if my code was used in class. Hence, the professor would simply change the stepsize and the differential equation to whichever and as long as everything is done correctly. At the end it would display the correct answer done.

    B) The process of building my numerical methods calculator is simply understanding computer language and being able to declare variables with specific values to accommodate the code. In my end, I choose the simplest yet understandable code for someone to interpret and understand what it does overall, because if it were to be long and complex… it would not work. I used the simplest method to do my code, you’ll see that I declared the step size, given initial value, the differential equation and as well as the eulers method formula all in order. The main goal of the code is to display the result for accuracy purposes, and that is why I provided the “printf” function which in coding provides the result. Once the code is run on matlab the result is -1.47. To reiterate, Matlab is a mathematical/engineering software to solve advanced math problems, it bring connection to our course because it can also solve differential equations. I did expect challenges because I had a rough time trying to figure out improved eulers method and runge kutta because the code became complex and it wasn’t clear to understand. However, I did seek help by visiting the forum of matlab to improve my ability to learn it. Well apart from the difficulty of it, coding errors was another obstacle so I had to make sure everything was declared correctly.

    C) We need numerical methods because it’s a concept used in differential equations to solve problems using a stepsize and initial value to the DE in which we need to find K, and the amount of steps it takes to reach the magic number. In Eulers method, the limit is once X gets to (2), then your Y must display the result because there’s were the method distinguishes the result in most cases. Step size is a huge factor to solving numerical method problems too because it’s plugged in on every formula that’s used to solve y. Fortunately, improved eulers method provides an easier approach to solve the given DE with fewer steps and the solution tends to appear simpler and faster compared to the standard EUL Method. The complexity of Runge Kutta is knowing how to solve it using the long formula it provides, however the results tend to be more accurate. I believe numerical analysis in DE is needed because when applying it to the real world, it can be used to solve in various programming platforms and computer programs.

    D) This assignment is included in this class because numerical method is a concept that’s taught in differential equations so it’s mandatory that we need to learn it. Apart from it not being on the exam, it’s beneficial that a program was assign on it because we knew how to think outside the box and find a way to solve a problem on it using a different approach by using computer language or software programs. It’s a good way to apply this skill in the real world because projects like these can be used in other courses as well. I believe it was a good suggestion given by Professor Reitz to further exercise our possibilities of improving our grade on the course. The most important fact to note about numerical methods in DE is that unfortunately it takes really long time to solve especially if given in an exam so I believe the professor made an alternative by instead assigning it as a project. A huge plus was being able to solve it using a programming language. Lastly, to achieve this project, the output of the code for all 3 numerical method whether if it’s done on a language or in excel was to get the same answer as provided in the post provided by the professor.

    E) I will provide the code as an attachment via MATLAB software, provide screenshot of the code and output. To proofread, and lastly, send it to the professor via email.

  23. Abdel Moussa

    a) So first Euler’s method I went with a spreadsheet. However, I went with a c++ code for improved Euler’s method. The way I approached the concept was quiet straightforward and simple. You put in the first x and y, find the new y and add that to the next column. This project helps compute what the final y at a given point is using step sizes. It’s very interesting.
    b) I used a spreadsheet and C++. Now the spreadsheet works fine. However I ran into a lot of problems with the code. The hardest part is getting the formula into the code. I decided to just change that line of code every time somebody needs a new formula. Having someone input a new formula from the keyboard every single time didn’t seem to workout properly. Perhaps I should’ve used java?
    c) We need numerical methods because this is what our class is all about. This is a way of numerically computing the answer using a code or spreadsheet. These methods help us find a closer value. With more steps and longer process, our percent error because very very small every time.
    d) I believe that this assignment is shown in class so we know that there is more than one way to go about this. The cool part math is that there’s no one direct way to an answer. There are multiple way to get to the right answer, and at the end, they’re all right and correct. This project really opened my eyes and helped my critical thinking.
    e) I am emailing you the files for the code and spreadsheet

  24. Rabia Arif

    A. For my project, I used C++ program to calculate all three methods which were taught in class as well. I used a website caller repl.it for this project because I’ve used it before in my classes and I know how it works. For Euler’s method and improved Euler’s method,First it will ask the initial condition (values for x0 and y0), then it will ask the step size (h) and lastly it will ask the value of x for which y is being approximated. For Runge Kutta, y+i, dy average, dy2 for Improved Euler’s method. When the while loop has the absolute value of x minus the last value of x is less than the decimal point precision, it will come out the loop and print out the results of x and y,otherwise it will continue to calculate the next x0 and y0.

    B. Since it’s a code it will have little errors which will lead to code not executing. Figuring out what’s the error and how to fix it was the only issue.

    C. We need numerical methods in addition to other methods in class because it allows us to understand how these problems work and how to solve them. Also, sometimes the differential equations can’t be solved in a certain way for which we have to try other methods to figure it out.

    D. This assignment is included in the class so the students can understand the whole process of getting these values and where do these originated from. Going through each step in analyzing a problem makes students learn more instead of just computing it.

    E. The link to the code was sent to your email.

  25. Ibrahima Sow

    In this project, I coded numerical methods which approximate the value of a solution for a given differential equation. The codes consist of Euler’s method of approximating differential equation, the improved Euler’s method and the Runge-kutta method. The Euler’s and Improved Euler’s method approximate the value for the solution by using numerous slopes of small segments between the initial value (or given point) to our end point. While Euler’s method uses the slope of only one point (the initial) to approximate the value of the next, the Improved Euler’s method uses the initial point and an intermediate point to have better estimate of the slope between the two points. On the other hand, the Runge-kutta method uses the slope of the parabola between the two points. Parabolas grasp better the shapes of a curves than straight lines. Therefore, the Runge-Kutta method give a better approximation of the solution of the differential equation.
    For this projet, I have decided to use c++ and write a program to solve the different method. I chose c++ because I feel more comfortable using it and also for more practice reasons. So here is how my project works and how it is built:
    For all the method, the differential equation is built in the code, therefore it will give you the solution of the differential equation within the code. I created double variables to hold all my constant such as the step size (h) and the initial point (Xo,Yo) and the different variable such as the slopes at the different point, the increasing x-values (X) and the y-value (Y) that are being computer. For Euler’s method, the program will first use the differential equation to find the slope at the initial point, then find the change along the y-axis (d) from the initial value of x to x+h. Add the change in y-axis to the previous y value which will then give us the estimate for the next point (x+h,y+d). The method goes on until the x-coordinate reach the expected value, which is controlled by a for loop.
    For the improved Euler, after finding the change in (Y) as for the Euler’s method and finding the y-value, this value will be held by a different variable called Z. We will then have a point (x+h, Z). The program uses this new point to find the slope at the point using the differential equation. Now we have two slopes in the interval x to x+h (k1 and k2). We will then take the average of these two slopes (which would be a better approximate actual slope between the two point). It will then use the averaged slope to find another change in (Y) called d2, which will be added to the precedent known Y-value to give us the new point (x+h, y+d2). This will also go on until x reaches the desired value.
    For the Runge-Kutta method, the concept is a little different and longer than the previous two. As usual, the program will first compute the slope at the initial point (k1) using the differential equation. It then compute the slope at the point (x+h/2,y+d1), where d is the change in (Y) using the k1. It the use k2, to compute a third slope k3 at the point (x+h/2, y+d2) where d2 is the change in (y). Finally, it computes a fourth slope at the point (x+h, y+d3), where d3 is the change in Y using k3. It will then use the weighted average of the four slopes to find good approximation of the slope between x and x+h (k=(k1+2k2+2k3+k4)/6). The program will then use k to find the change in Y between the two end point and add it to the y-values (y=y+h.k). This will also repeats until x reaches the desired value.
    C)- Numerical methods are studied in classrooms in plus of other methods because, in plus of given a very close approximation of the solution, in certain cases (certain differential equations), they are the only option of finding a solution because we cannot find nice formulas for the DiffyQs. It also valuable because these methods help us automate the result using computers or calculators.
    D)- This project is assigned because once you have a hand-on experience on something we will understand it better or consolidate your understanding. Having practical project in class is a great way to make student understand and remember the notions they’ve learned.
    E)- I will be emailing the files.

  26. TC

    For this project I used C++, to approximate the solution of a differential equation. My code takes in a raw differential equation (y’=(X^2)/(y-1)), substitutes all the X’s and Y’s with the X and Y that the user input. After it substitutes it will then use the function “Evaluator” this function breaks down and parses the math expression, solves it and returns the expression in the simplest form; It uses this to solve ‘K’. All of the data that is solved by the code for Y, K1, K2, K3, and K4 is stored in a dynamic 2D array and when the program finishes processing Euler’s, Improved or Runge-Kutta, it will print out the entire array into the console.
    The issues I ran into when developing this code was trying to make the inputted equation dynamic, by having users input the equation they want to use instead of integrating the equation into the code. There was no easy way of entering the equation as a string and then having the computer understand each special characters (/, *,-, +) inside it without manually typing it in. That’s why I have the code parse the expression, separating the operations by their parenthesis and then solving the simpler expression.
    I believe the reason we need to use numerical methods of addition instead other methods is that the numerical methods are easier to program in a computer and are used for finding the approximate result faster, but less accurate than the more complicated methods of solving these equations. The reason why this is included in the class is to better understand how effective these methods are for approximating the real solution of the differential equation using its initial conditions. The Runge-Kutta method is also used a lot in computing to generate a particular solution quickly without doing too many steps.
    Code:
    Euler’s:
    https://ideone.com/XoPU6m This took 4500 steps to complete (ideone.com doesn’t display everything)

    Improved Euler’s:
    https://ideone.com/XoJv8V This took 50 steps to complete

    Runge-Kutta:
    https://ideone.com/5HMijJ This took 20 steps to complete

  27. Ronnye G

    a.) My project is an excel spreadsheet that is able to calculate values for Euler’s Method, Improved Euler’s Method, and of course the Runge-Kutta method. The spreadsheet works by simply imputing the value for each variable into the equation already set up before, thus automatically calculating values for each step. However the most important rows are the beginning two rows, and this is true for any method. Once the first two rows are set up then one can simply drag down the columns to whatever value is requested. As an example, take the Runge-Kutta spreadsheet; this has more columns than the other two methods. It also doesn’t have a Z value like proposed simply because it is already written into the equations for the K and Y values. This also includes H or the step value since it is also included in all the spreadsheets as well making the step size of .2 the main and only common number out of all of them.
    b.) Building the calculator took a lot of work. I initially wanted to use matlab and found some success using that. However, I never really quite found a way to making it exactly user friendly and after much trial and error decided that making an excel spreadsheet would alleviate that issue altogether. This isn’t to say that the spreadsheet faced no issues. It was confusing to use at times since all the cells would get muddled up in my mind whenever I was trying to properly place the equations for their respective columns and rows. However after much deliberation I was finally able to figure things out especially in the Runge Kutta spreadsheet.
    c.) It is always good to have numerical methods because it can sometimes be a good way to explain a topic well. For instance I have had a long time struggling with many differential concepts but I found that these alternative methods are quite helpful in understanding differential equations and just the class overall. It also a good way to understand how people and mathematicians of the like were able to even come up with such equations to make things a lot more accurate.
    d.) To help us understand exactly what we are doing and how to use it properly. It’s always
    better for someone to have to figure something out on their own from scratch then just being told it and then expecting said person to already know what to do. Doing it yourself is just a great way to actually learn instead of memorizing.
    e.) I already have sent you the Google Excel Spreadsheet files and I hope your not too harsh on grading me!

  28. Cristian

    A. For my project i chose to do an excel spreadsheet for each method. For Euler’s method i put the initial conditions in D3, D4, D5. From there i put the given k value in E8 but instead of x and y we use the cells x being the C column and y being the D column. To get the next column y_(i+1) we input the formula for it in F8 but replace the normal formula variables for the column and row number. After that highlight the works and drag it down to get the rest of the values.
    For improved Euler’s method, it’s pretty much the same thing but more values to solve for which are k1,k2, and z. you input the formulas and replace the x and y’s for the perspective column and number and drag down to get the rest of the values.
    For Runge-Kutta method its the same as improved Euler’s method just more columns of k and z’s. The initial values can be changed just by clicking on D3,4,5 and replacing them with what ever you want
    B. I used and excel spread sheet for each method because it was the simplest way to do it compared to matlab and other programs. You only have to do a row or two and them highlight the row and drag it down to get the rest of the values. The hardest problem i encountered was remembering how to use excel and how to drag down the fill in the rest of the values and putting parenthesis where they need to go to get the right answer.
    C. We need numerical methods and others because sometimes it take to long to find one answer so we need another way to solve them even if it isn’t exact its close. Sometimes you cant solve them one way so you need to have a back up.
    D. The reason we do this project is to be aware that there is an easier way to solve this problem instead of having to do them by hand and sometimes there are thousands of steps to get the problem. With programming you can find your answer in a few steps.
    E. Will be sending files via email.

  29. ~Evan~

    a-b) Essentially, we have a crude sort of digital calculator made within Microsoft Excel that approximates a given value y, when x is any real number. In addition, when putting in key values, it can get the aforementioned approximation for differential equations with given initial conditions. The Euler’s Method, Improved Euler’s Method and Runge-Kutta Method were done on one file, with separate sheets. While Euler’s and Imp. Euler’s took only around 20 cells to get the correct approximation, the Runge-Kutta Method took about 3 times the amount, the reason being that I used a rather small step size of 0.05. The only challenges were the simple mistakes that come with copy-and-pasting certain formulas without making sure certain key values were in the correct places. That being said, there were multiple instances where the approximates were suuuuper close to the actual answers (both the example and the actual problem given.) Mildly irritating to say the least.

    c) These numerical methods help us to get better approximations. You see, nothing is perfect, including the Euler’s Method. It isn’t very accurate when coming to solving certain differential equations, especially higher-order ones. So, we turn to methods like Improved Euler’s and Runge-Kutta to not only have better approximations, but understand how these equations behave.

    d) I believe this assignment was to help us understand that there is more than one way of doing things, as well as get us to understand that there are better ways to get an answer. The idea that there is more than one method to solving differential equations and satisfying the initial conditions is actually interesting, if not exciting.

  30. HenryLam

    A. My project was done on excel. The reason why i picked excel is because i have some basic knowledge of it and it seemed a lot easier since I can easily drag down the column to get my values.
    Eulers Method was pretty simple and straight forward. What i had to do was create a column for i, h, x_i, y_i and k then getting my y_(i+1) values.
    What i did in this sheet, i created a number system to see how many tries it took to get my number of steps, which ended up to be 600. How i created this formula was “=$A2 +1” so it can reach 600 without me typing 1 2 3 4. After, i created my h value which was 0.005 and just dragged it down to 600. for my x_i value I did +$C2 + $B3 to get my x values. Then for y, i did =$f2 to computed my values. to my Y(2) value. I cant get my y_i value unless i got my y_(i+1) value first. which was getting my -0.5 value and adding it to k value and multiplying it with my h value. so in the end the value result should look like this “-0.5 + (-0.666*0.005) which ended up giving my Y(2) value at 600.
    For Improved Eulers: it was the same steps but this time i had to find my k2 value and my z value. My k2 value was added by .1 and then squared after getting the first half i divided it by my z value – 1. which would give me my K2 values. Getting the z value was multiplying the y value and adding it with .1 multiplying it with my k1 value.
    Runge Kutta: Runge kutta gave me the most trouble because i had to figure out a lot of formulas since i had to get up to k4. You can see it in the spread sheet , that i had to generate multiple colums to get my K4 value.
    B) Building my numeric calculator took a lot of time, because i had to understand the basics of formulas on excelfirst, then knowing how to implement those formulas to each column. The hardest part was the Runge Kutta method because there were so many steps to get my final answer. The most challenging thing about this project was the Runge kutta method, it took way too much time and formula solving to get the answer. Rather when using Eulers and improved eulers i took less time.
    C) Numeric methods are a nice way to find a close approximate answer than having a big answer thats not approximate.
    D) The assignment is included in the class because we can get a close look at how approximate numbers can work rather than doing it by hand where it can take hours to find how many steps it takes to get the approximate answer.
    E) Files will be sent by email.

  31. Juan villacis

    A) For my project i used google sheets to create a calculator capable of doing Euler’s method, Improved Euler’s method and Runge Kutta. Google sheets uses a grid like format. By using Sheets for Euler’s method, you put your H value in the B column, and since H is kept constant in the equation to make it simple you put it in B2, and for B3 the second row you just drag it down. For X, you first put the X you start with in C2, and then for C3 you put the equation C2+B2, and then drag it down for the rest. You put Your first Y, in D2. For K, you plug in (B2)^2 / (D2-1) due to the equation given being that, and that equation goes in E2, afterwards for the next Y value, in D3, you put in D2 + (B2*E2) and that gives you then next Y. Once you get all the values you drag the column down and sheets remembers the equations. For Improved Euler’s method you use the same columns for H, (B) for X (C) for Y(D) , but now you use a Z (F) value and 2 K values, K1 (E) and K2 (G). For Runge Kutta, there is More Columns added due to there being more values (Z2, Z3, Z4, K1, K2, K3, and K4) so there is more equations plugged in, but the spreadsheet remembers the equations so it makes it easier. For each method it takes the values already plugged in for the basis and then runs them thru the equations, and then once it’s done with the first row, you can drag down the first row to fill in the rest.

    B) I used google sheets because I don’t have that much good experience with coding but did dabble a little bit with it but no luck, I love sheets more because it’s more convenient and is able to run a code like system which will result in more accurate results. The real trouble came at the end when doing Runge Kutta, due to there being many many columns. The reason why is you needed to make sure your answered made sense due to there being so many numbers around you.

    C) we need numerical methods to solve differential equations that are non solvable by other methods. By using these kinds of methods we get estimates results but are doable. Improved Euler’s method gives more accurate results and Runge Kutta gives the most almost pure accurate results.

    D) The reason we were given this project is really to have a calculator kind of process that would allow us to solve these kinds of questions without any real errors or lengthy calculations by hand. By using this “calculator” we are able to just plug in the variables for the first row and then once the results are given you just drag down until you reach the desired result.

    E) I will be sending you the files via email

  32. umaira shah

    For this project, I used Excel Spreadsheet for that you need to enter timestep size h which located in A1 grid. Then, enter the values of the initial condition x and y it is located F2 and G2. we will complete the column of values of x, by using the fact that each x-value is the previous x-value plus the timestep. For y values you enter the formula yi+hk and plug in the values into formula. To get the slope plug in the values into differential equation.
    For Euler’s Improved method and enter the timestep size then enter the values of the initial x and y values same as the for Euler’s method but the only difference was that we must find k2 and z value. To get the values for k2 and z we can use the same formula that we used to find k1 in Euler’s method. For Runge method you need to find more z values and more k slopes using same formulas.
    2. challenging part was creating spreadsheet for three methods using Microsoft excel because I didn’t have experience with excel. After that putting formulas and computing values was complicated for me. The most challenging part was Runge method because finding more values for k and z was bit tricky, we need to use formulas in order to find the values.
    3.We need to numerical methods in order to solve differential equations because Many differential equations cannot be solved exactly. By using numerical methods, we can get approximate solutions. By using excel for three different methods I learned about numerical methods and its helpful to understand for differential equations.
    4.This assignment is included in class to get better understanding how numerical methods works in different ways and we can solve these types of equations easily.
    5.I will send the excel files on your email.

  33. ~Evan~

    ~A message relayed by me, for Justin Burke~
    Justin has E-mailed his project to you, Prof.

  34. ~Evan~

    ~A message relayed by me, for Justin Burke~
    Justin has E-mailed his project to you, Prof.

  35. Brandon Fong

    a. For my Euler’s method, Improved Euler’s method and Runge Kutta method calculator work completely fine first step you have to do is you have to enter the initial condition value for x and y and then you have to type what your x going to be of the function in order to use Euler’s method to solve the given differential equation. At last, you need to type the step size h in order to let the program start running because the h is the most matter you have to know in the program or code and the number you put in there have to be exactly right . That’s the reason why in order to let the Euler’s method to give you the answer that is approximately close to your actual solution for the initial condition you want to find, then you have to make sure you keep checking the step size h until it reach that approximation. In the program code, I also add a bunch of formula for Euler’s method in order to let the computer know this is the equation you have to use to find the answer and they are yi+1 = yi + h *f(x2, y2) to find the next y value and f(x2, y2) or that mean substitute the number in the differential equation to find the slope k. This two formula is all use in Euler’s method calculator. Also, in the program code I use while loop to let the output keep on running and non stop in order to let the program know it have to keep running until the answer it reach to the answer you want to find. Now for Improved Euler’s method basically is did the same thing as the Euler’s method but just this time it add few more formula and step to find the values for the initial condition. The new formula you need to include in the Improved Euler’s method is you need use f(x3, y3) in order to find the slope k but this time you need to find 2 slope in order to take those average to find the solution it is much closer to the actual answer. Also, you have to find the new value z and it is represent the temperately slope and the formula for that z is the same as when you find next y in Euler’s method and in order to find y in Improved Euler’s the formula will be like yi+1 = yi +(k1+k2 / 2) * h. At last, for Runge Kutta the only difference between those two are it have the more step and the fastest to find the answer that is the most approximate answer to the actual value and it have more formula you have to use in order to calculate the answer and it is you need to have 4 slope k1, k2, k3 and k4 and take the average in those 4 number and divide by 6. Also for z you have to find 3 more z too like z2, z3 and z4 and the formula is the same as improved Euler’s but this time the h will be divide by 2 so this is the one of the difference between those two method and this is how my program or code work in the website ide call repli.it.

    b. The technology I choose to build the numerical methods calculator is I use c++ programming language in the ide website call repli.it I choose this technology is because my major in computer Engineering Technology so I am a software programmer so in my other class I basically just keep coding in every single day especially I will use c++ language to do my work in school and maybe some research project. Also, c++ language is kind of like the most popular coding language for windows user in lot of software programmer and I am a windows user too. That’s why this coding language will be so familiar with me because I did learn in class and I have a lot of experience on it so this is the reason I will choose this technology to do my project. The challenges and problem I have for my programming code are I keep have issue and a hard time for running the output for my Runge Kutta method because I keep making the variable wrong and it not match to every part the code. Also, since it have a lot of formula to type in this method that why I keep getting a lot of syntax error in the code and it is very hard for me to well organize it. Therefore, this is the challenges I keep facing when I fixing my code for Runge Kutta.

    c. We need numerical methods to solve some differential equation is because sometime some differential equation cannot be solve by the normal way and it give us hard time to solving it so this is time when numerical methods comes in handy because it is very easily to use and I know it may take more step than the normal solving way when you need to find the actual answer and some answer may not be exactly the same as the actual solution but at least the calculation will definitely be easier than the normal way so I think numerical method will be really helpful for you in the future when you have some hard differential equation problem.

    d. This assignment is included in the class is because sometime when you use the calculator to do numerical problem it will not always have less step and will not always be a small table then you will be able to find the solution and sometime maybe we need to make a large table and use thousand of step to finish finding the answer. That is why if you just use learn your calculator it will be a very hard time for you to solving a problem. As a result if you learn how to make a calculator in computer it will definitely easier for you to find the answer and computer will also run much more faster than a calculator too. Also, as a student we should learn and try more way for solving a differential equation and it gave us better understand about this topic. That is the reason why I think this is the main reason why this project will be include in the class.

    e. I will email my c++ programming code link to you.

    Euler’s Method:
    step size h = 0.000005

    Improved Euler’s Method:
    step size h = 0.00005

    Runge Kutta
    step size h = 0.005

  36. Christian Avila

    My project was worked in Excel, some people might say that working on excel was the easiest way to do it but I think that if we had to something it doesn’t matter the software used, as far as we do it correctly. I also can say that I used excel because I don’t have any other software installed in my computer, plus I had to manage my time between school and work, so I decided to work in excel because it was more manageable. For the differential equation the initial condition was given for xi and yi. The way my numerical calculator was set up began by placing the initial values (xi,yi), and the step size (h) in the corresponding locations, C7, D7, and G4 respectively. Having the step size and knowing the initial value for “xi” the first column (C) was easy to fill up with the different values of x. The same set up was used for all three methods, Euler’s Method, Improved Euler’s Method and Runge-Kutta Method. The difference between the three methods is the accuracy for the value of y, for this reason the steps and formulas used to approximate the value increases for each method. For the Euler’s Method I used the value of k (slope, column E), which was obtained by substituting the initial values (xi,yi) into the differential equation. Then, for the next value of “y” (yi+1), I used the formula yi+1 = y1 + k*h. For Improved Euler’s Method, more values were included such as z1 and k2. K1 still the slope of the initial condition (xi, yi). For z1 the formula used is z1 = yi + k1*h, with this value we obtained a new momentary point (xi+1,z1). With the new momentary point, we find the slope and the result is k2. Finally, the formula used for the new value of yi+1, yi+1 = y1 + ((k1+k2)/2) * h.
    The Runge-Kutta method is a bit more meticulous, for this method new values are used. The new values combined with the previous values we get xi, yi, k1, z2, k2, z3, k3, z4 and k4. I also decided to include the values of xi+h/2 (Column F) and xi+h (Column K). kn is always an slope of a certain point, k1 (xi,yi), k2 (xi+h/2,z2), k3 (xi+h/2,z3), k4 (xi+h,z4). To find z2=yi+(h/2)*k1, z3=yi+(h/2)*k2, z4= yi+h*k3. The last step is to find the new value of yi+1 which is found with the formula yi+1 = yi+h*((k1+2k2+2k3+k4)/6).
    Once I had the formulas settled, I copy and paste the formulas along their corresponding columns. I had to make sure that the step size (h, G4) was selected for all the formulas that needed it. In the spreadsheet the initial values (xi,yi), and the step size can be change, and the results for all the values will be calculated. Not exactly an “unexpected challenge”, more like an annoying step, was to make sure that the value of “h” was the correct one in every formula that needed the step size in the calculations.
    From my perspective we need numerical methods because as you told us today in class “if we can do any problem by hand, we can tell the computer/system/software what to do”. When it comes to mathematical problems sometimes there are different ways to solve a problem, so it is important to know these other ways to solve problems, even if it is only an approximation.
    This project was assigned to the class not only to get a grade for the class but also to improve our knowledge and abilities to make computations that are tedious and long process.
    My project consists of three attachments, Euler’s Method – 1, Improved Euler’s Method – 2, and Runge-Kutta – 2, that will be sent to your email.

  37. Christian Culcay

    My project was worked in Excel, some people might say that working on excel was the easiest way to do it but I think that if we had to something it doesn’t matter the software used, as far as we do it correctly. I also can say that I used excel because I don’t have any other software installed in my computer, plus I had to manage my time between school and work, so I decided to work in excel because it was more manageable. For the differential equation the initial condition was given for xi and yi. The way my numerical calculator was set up began by placing the initial values (xi,yi), and the step size (h) in the corresponding locations, C7, D7, and G4 respectively. Having the step size and knowing the initial value for “xi” the first column (C) was easy to fill up with the different values of x. The same set up was used for all three methods, Euler’s Method, Improved Euler’s Method and Runge-Kutta Method. The difference between the three methods is the accuracy for the value of y, for this reason the steps and formulas used to approximate the value increases for each method. For the Euler’s Method I used the value of k (slope, column E), which was obtained by substituting the initial values (xi,yi) into the differential equation. Then, for the next value of “y” (yi+1), I used the formula yi+1 = y1 + k*h. For Improved Euler’s Method, more values were included such as z1 and k2. K1 still the slope of the initial condition (xi, yi). For z1 the formula used is z1 = yi + k1*h, with this value we obtained a new momentary point (xi+1,z1). With the new momentary point, we find the slope and the result is k2. Finally, the formula used for the new value of yi+1, yi+1 = y1 + ((k1+k2)/2) * h.
    The Runge-Kutta method is a bit more meticulous, for this method new values are used. The new values combined with the previous values we get xi, yi, k1, z2, k2, z3, k3, z4 and k4. I also decided to include the values of xi+h/2 (Column F) and xi+h (Column K). kn is always an slope of a certain point, k1 (xi,yi), k2 (xi+h/2,z2), k3 (xi+h/2,z3), k4 (xi+h,z4). To find z2=yi+(h/2)*k1, z3=yi+(h/2)*k2, z4= yi+h*k3. The last step is to find the new value of yi+1 which is found with the formula yi+1 = yi+h*((k1+2k2+2k3+k4)/6).
    Once I had the formulas settled, I copy and paste the formulas along their corresponding columns. I had to make sure that the step size (h, G4) was selected for all the formulas that needed it. In the spreadsheet the initial values (xi,yi), and the step size can be change, and the results for all the values will be calculated. Not exactly an “unexpected challenge”, more like an annoying step, was to make sure that the value of “h” was the correct one in every formula that needed the step size in the calculations.
    From my perspective we need numerical methods because as you told us today in class “if we can do any problem by hand, we can tell the computer/system/software what to do”. When it comes to mathematical problems sometimes there are different ways to solve a problem, so it is important to know these other ways to solve problems, even if it is only an approximation.
    This project was assigned to the class not only to get a grade for the class but also to improve our knowledge and abilities to make computations that are tedious and long process.
    My project consists of three attachments, Euler’s Method – 1, Improved Euler’s Method – 2, and Runge-Kutta – 2, that will be sent to your email.

  38. Anthony Tapia

    A) For this project I created 3 MATLAB files one for each method, for Euler’s method I started by adding user input for the initial values like Xi, Yi, target value and step size. The code will take the initial values and apply it a for loop with the function K. After getting K the code will run the equation for the new value of Yi and replace the old value. The code will continue to run until it reaches the targeted value prompted at the beginning of the code. As the code runs it will plot the points x and y. Like Euler’s method the code for both improved Euler’s method and Runge-Kutta will ask for initial values and run the function K, which will then allow the others functions to run and find values for YI, k2, k3, k4, etc.
    B) I choose to use MATLAB because it’s the option have the least experience in and wanted to improve in using the MATLAB software. At first, I had to know the formulas for each method and be able to apply them to MATLAB without using built in commands that are provided. My first challenge was trying to get the new values to loop into the function, so it can display the real values. Another problem was being able to change the function at user request, I was able to get the user to enter their own differential equation at the beginning, but it would require constantly having to input it at every step.
    C) We need numerical methods because we can encounter differential equations that can’t be solve in our preferred method or require too much calculation by hand. It also helps to get more precise approximations that other methods couldn’t.
    D) Students are assigned this project because it helps students get a better understanding on using the methods as well as reduce the errors. Also, it can help a student visually because the programs we use can plot the points of xi and yi while the program does the calculations.
    E) I will be sending the MATLAB files by email.

  39. Julian Jimenez

    A.) For my project, I decided to use Excel to create the numerical calculator. I decided to use because I believed it would be easier and less time-consuming dude to my limited available time. I quickly found out that it was more complicated than I originally believed, and it took more time then expected to have the calculator completed. My original method was going to be C++ but soon realized that the program was no longer on my computer. The calculator works for 3 separate examples, Euler’s, Improved Euler’s and the Runge Kutta method.
    For Euler’s method, the calculator works by taking initial values of x and y and using these values to find a value for k. the values for k is determined by using the initial values of x and y and inputting them into the original differential equation. Once getting this value of k, it can be used to find the following value of Y. The value of Y at a specific X is what needs to be found and this calculator will help. These steps are repeated until the Y value for the desired X value is found.
    For the improved Euler’s method works similar to Euler’s method but with a slight change to the calculations. In this case, we need another value of Z. This value takes the place of the Y value in the Euler’s method which we now use to find another value of k, in this case it’ll be called K2. Once both value of K are found, we use the average of these two values to find a new Y value which is the following number. Just like in Euler’s method, these steps are repeated until the Y value for the desired X value is found. As a result of the average of the k values that are found, we get more accurate answer with less steps that are needed.
    The Runge Kutta method takes this further by taking a greater average values because of new K value, K1, K2, K3, K4 and Z values of Z2, Z3, Z4. These values are then used to compute the next Y value.

    B.) The process of building the calculator was very tedious. The equations for the k values and the z values had to be placed in the correct cells vertically. Then they had to be applied throughout the entire row so that the next number can be computed properly and applied to the same equation. The horizontal had to be placed properly so that the formulas could be applied properly, otherwise the calculated values would not be correct which would result in a completely different number than the one that is being looked for. This was a main issue that I came across when completing the project. It came to a point where I had to start from scratch because of the issues that came across.

    C.) The numerical methods are needed because they give us another approach to solving differential equations. Depending on what the task at hand is, numerical methods could result in an easier, yet at times tedious, steps that one can take to solve these equations.

    D.) This is included in the class because as stated before, it gives us another approach to solve differential equations depending on what the task at hand is.

    E.) The project will be an excel file with 3 sheets. The 3 sheets will have the 3 methods that are needed to be found.

Leave a Reply

Your email address will not be published. Required fields are marked *