Question: 1 EE 1 6 0 Homework 1 5 - Solving an algebraic equation numerically Theory: Suppose that you are trying to solve an algebraic equation

1 EE 160 Homework 15- Solving an algebraic equation numerically Theory: Suppose that you are trying to solve an algebraic equation that looks like this: 210=21 One way to solve this would be to move all the terms to one side of the equation so that the other side of the equation is zero. Rearranging the above equation would give: 210+21=0 Assume that the left side of the equation is a function, f(x). This means: ()=210+21 If we evaluate f(x) for different values of x, for all the x-values where f(x)=0, those xvalues are solutions to the original equation. Instructions step1: Start with the program you created in class that displays (on screen) a table of x and y values for a given polynomial in a given search interval of x. If that is not complete, you should complete it before going further. Make sure to allow the user to input the starting value and ending value for the interval for checking for roots. Also prompt the user for the number of steps to break the interval into. Create a loop to print out (on screen) a table of values of x and f(x) at each increment from the starting value to the ending value (see below). x-value y-value ============== start-value f(start-value)...... end-value f(end-value) Suggested variables list, type, description xmin double starting value for table (input by user) xmax double ending value for table (input by user) steps - integer number of intervals into which we need to break the range of x-values (user input) xincr double increment between x values in table, from one row to the next (calculated) Instruction step2: If you run the above program, you will notice that the sign of f(x) may change at some points. That will give you an indication of approximately where the zeroes (solutions) lie. Now create a third column of screen-output to flag intervals where the sign-changes 2 occur. For example, if we input an interval of 0 to 11, with 15 steps, we should see: Deliverables: This homework is due Wednesday 10/09 by the end of class. 1.) Your source code MUST contain comments for: (i) name, (ii) class (iii) homework assignment number (iv) a sentence describing the purpose of the code. 2.) Save your terminal session (including your source code (ex: hw15.c), compiler command, and run-output as a file. The run-output must be shown for the test dataset given below: Polynomial (in function): Interval (inputs) Steps (input)210=2101115210=21-211102328.421.38=59.22-100100172328.421.38=59.22-215313.) Go to Laulima > DropBox. Create a folder hw15. Upload this text-file.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!