Question: EE 1 6 0 Homework 1 5 - Solving an algebraic equation numerically Theor: Suppose that you are trying to solve an algebraic equation that
EE Homework Solving an algebraic equation numerically
Theor:
Suppose that you are trying to solve an algebraic equation that looks like this: x x
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:
x x
Assume that the left side of the equation is a function, fx This means:
fxx x
If we evaluate fx for different values of x for all the x values where fx those x values are solutions to the original equation.
Instructions step:
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 fx at each increment from the starting value to the ending value see below
xvalue yvalue
startvalue fstartvalue
endvalue fendvalue
Sugqested 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
Instructionstep:
If you run the above program, you will notice that the sign of fx may change at some points. That will give you an indication of approximately where the zeroes solutions lie. Now create a third column of screenoutput to flag intervals where the signchanges
occur.
For example, if we input an interval of to with steps, we should see:
Deliverables:
This homework is due Wednesday by the end of class.
Your source code MUST contain comments for: i name, ii class iii homework assignment number iv a sentence describing the purpose of the code.
Save your terminal session including your source code ex: hwc compiler command, and runoutput as a file. The runoutput must be shown for the test dataset given below:
Go to Laulima DropBox. Create a folder hw Upload this textfile.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
