Test your script with one or two functions

Assignment Help Civil Engineering
Reference no: EM13548101

One method of finding roots of an equation on a computer is the false position method. The idea is that for a function f(x), you find two values, f(x1) and f(x2) such that f(x1)* f(x2) is less than zero (think about what that means). We would then approximate a line between the points (x1 , f(x1)) and (x2, f(x2)), and then calculate where that line crosses the x axis at x3. We then look at f(x3) and determine if the root is between x1 and x3 or x2 and x3, and repeat the process. The algorithm finds x1 and x2 through trial and error or a coarse search. You are allowed to put in guesses for x1 and x2, but you are not allowed to call any other MATLAB commands to generate these guesses. Your assignment is to do the following:

1. Create a flow chart, pseudo code, or other outline of the algorithm you need to implement. This will need to be turned in with your MATLAB code.

2.Create a MATLAB script that implements this algorithm. You are not allowed to use any MATLAB functions that implement this algorithm. The mathematical function that you intend to find the roots of should be assumed to be in a function of the form function y = mathroots(x) So, for example, if you wish to find the roots of a simple quadratic equation, you would create the function function y = mathroots(x) y = 3*x^2 + 2 * x + 1; and store it in the file mathroots.m.

3. Test your script with one or two functions, and include the results of those tests in your code as comments

Reference no: EM13548101

Questions Cloud

When does connection capacity govern the required strength : The cost of tuition at a certain public university was $120 per credit-hour 7 years ago. The cost today (exactly 7 years later) is $255. The annual rate of increase is closest to
Determine the payback period for an asset that has a first : A construction company invested $60,000 in a new bulldozer. If the income from temporary leasing of the bulldozer is expected to be $15,000 per year, the length of time required to recover the investment at an interest rate of 15% per year is closest..
Compute the total restaurant sales : Compute the total restaurant sales, and the sales of each product line that would be necessary to achieve the desired target net income and calculate the total restaurant sales and the sales of each product line that would be necessary to achieve t..
Craete a single-step income statement : Prepare a multiple-step income statement, prepare a single-step income statement - In its income statement for the year ended December
Test your script with one or two functions : Create a flow chart, pseudo code, or other outline of the algorithm you need to implement. This will need to be turned in with your MATLAB code.
If the heading of a member function of a class ends : If the heading of a member function of a class ends with the word const, then the function members cannot modify the private member variables, but can modify the public member variables. the function members cannot modify the public member variables,..
Compute the breakeven point in sales units : Compute the breakeven point in sales units and in sales - what will the new breakeven point be in un nd in Rupees?
Identify the items in the cash-basis financial statements : Identify the items in the cash-basis financial statements that make cash-basis accounting inconsistent with the theory underlying the elements of financial statements.
What software development advantage of object-oriented : Composition, like inheritance, demonstrates what software development advantage of object-oriented programming?

Reviews

Write a Review

Civil Engineering Questions & Answers

  What force is required to hold in equilibrium under mercury

A cube has side dimensions of 18.00 in. It is made of steel having a specific weight of 491 pcf. What force is required to hold it in equilibrium under mercury

  Calculate alkalinity as cac03 of water that contains hco3

calculate the alkalinity as CaC03 of water that contains 85mg/l of HCO3, 120 mg/l of CO3 and 2 m/l of OH.

  Commencement of fill placement

Determine the horizontal spacing of the vertical drains if the drains are installed in triangular grid to reach 90% of primary consolidation in 1.5 years after the commencement of fill placement.

  Find the direction of flow

A conical tube of length 8 m fixed vertically with its smaller end upwards. The velocity head and pressure head at upper ends are 1.27 m and 2.50 m respectively. The velocity head and pressure head at lower ends are 0.203 m and 5.407 m respectivel..

  What is probability that more than people will participate

Suppose 500 people are approched outside of a grocery store to answer some survey questions. If each person decides independently whether or not to participate, and each has a probability of 0.1 of participating

  Determine what is the decrease in diameter d

A bar of monel metal (length L=9 in., diameter d=0.225 in.) is loaded axially by a tensile force P. If the bar elongates by 0.0195 in., what is the decrease in diameter d What is the magnitude of the load P

  Changes in atmospheric pressure due to change in elevation

Determine the pump power in W & hp required to pump water froma tank at the base of the world's tallest building (1667 ft) to ahot tub of similar size on the roof. Ignore friction losses& changes in atmospheric pressure due to change inelevation. Flo..

  Equilibrium temperature of the two bodies

What is the final equilibrium temperature of the two bodies?

  Determine the bubble point pressure for a mixture

For a mixture 10 mol % methane 20 mol % ethane 70 mol % butane at 50 degrees Fairenheit determine the bubble point pressure

  A town is installing a new 10 main to carry drinking water

a town is installing a new 10 main to carry drinking water. the onlynbspsection remaining to be installed is a segment

  How many resistors out of package of 100 to burn up

A 6.6 mA current is flowing through a 47 kilo-Ohm, 5% tolerance, 2-watt resistor. If the resistor values are uniformly distributed, how many resistors out of a package of 100 would you expect to burn up

  What is the flow rate in cfs from the higher to the lower

Water is flowing from a higher to a lower reservoir through a 24-inch pipe that has a Darcy friction factor of 0.02. The local loss coefficients for the bends, entrances

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd