Write a script and a function to implement secant algorithm

Assignment Help Mathematics
Reference no: EM131069063

Assignment - Root Finding with the Secant Algorithm

Preliminary Information

In this assignment you will write a script and a function to implement the secant algorithm.

The function will implement the secant algorithm and return the root of the function.

The script will define the required data and send the data to the function.  Included in the required data there should be a string that defines the required function as an anonymous function.  The string can be converted into a function handle using MATLAB's str2func function.

After the root is returned from the secant function is should be written to a data file on disk with 6 decimal places.  The data file should read:

The root = (value_of_root)

For your function use

f(x) = 2 - 2log(x) - √x

Goals:

-Writing numerical analysis software

-The use of anonymous functions

-I/O to disk files

Reading Assignment:  Recommended reading from MATLAB help documentation:

-str2func

-fopen

-fprintf

-fclose

Note:  you should write the output to a file in your current directory.

What to Submit-

You are required to upload the following files to Blackboard

1) Your script M-file.

2) Your secant function M-file.

3) A documentation file.

You should note that your documentation file is extremely important.  It is this information that users of your software will consult when running your software.  Too many programmers make extreme efforts writing and testing software and then fail to provide proper documentation.  This hinders the use of your software and prevents users from gaining the full benefits of your hard work.

All you M-file should contain comments explaining how the program works.  In addition, you should include the follows:

File name

Description

Program variables

Programmer

Student number

Date

Your documentation file should contain the following information:

Programmer

Student number

Date

File software names of all your programs

Description of program

Instructions on how to run the program.

Reference no: EM131069063

Questions Cloud

Average monthly compound rate of change : Property A sold 22 months ago for $98,500; it sold last week for $108,000. Property B sold 20 months ago for $105,000; it sold two weeks ago for $113,500. What is the average monthly compound rate of change in sale prices?
How will transition impact functioning of the family unit : Examine their functioning in relation to a model of resilience appropriate to your specialization, and evaluate their challenges and strengths related to wellness and resilience. As each character transitions to his or her next developmental stage..
What is the effective cost of credit to worthington : How would I put that in a essay format? Worthington, Inc. is planning to issue $7,500,000 in 120-day maturity notes carrying a rate of 11 percent per year. Worthington's commercial paper will be placed at a cost of $35,000. What is the effectiv..
Principles of management select the single best answer : 1Rajis assigned to hold apress conference that discusses the company's plans to Build anew plant Raj is performing the role.
Write a script and a function to implement secant algorithm : In this assignment you will write a script and a function to implement the secant algorithm. The function will implement the secant algorithm and return the root of the function. The script will define the required data and send the data to the funct..
What is the share price of the companys stock : Gibson Co. has a current period cash flow of $1.2 million and pays no dividends. The present value of the company’s future cash flows is $20 million. The company is entirely financed with equity and has 800,000 shares outstanding. Assume the dividend..
What you intend to persuade the reader to think and do : State the purpose of your report, i.e. what you intend to persuade the reader to think and/or do. Then describe what you will address first as you attempt to overcome possible resistance and persuade them of the merits of your viewpoint and/or req..
What is the expected return on the portfolio : You own a portfolio that has $1,400 invested in Stock A and $1,000 invested in Stock B. If the expected returns on these stocks are 10% and 14%, respectively, what is the expected return on the portfolio?
Strategy and calculate the hedged value : (a) Explain the strategy and calculate the hedged value of GE's cash flow using a forward market hedge. (b) Explain the strategy and calculate the hedged value of GE's cash flow using a money market hedge.

Reviews

Write a Review

Mathematics Questions & Answers

  Determine how much was borrowed at each rate

determine how much was borrowed at each rate if the annual interest was $130,500 and the mount borrowed at 10% was four times the amount borrowed at 7%. solve the system using matrices.

  Explain the ship had been one-fourth greater

the speed of the ship had been one-fourth greater, the person would have traveled only 1315 miles in the same lenght of time. Find the speeds of the plane and the ship

  A eagle can fly 35 kilometers per hour faster than a

an eagle can fly 35 kilometers per hour faster than a hummingbird. in the same amount of time an eagle can fly 8.5

  Explain what is a binomial factor

What is a binomial factor? In your own words, describe the process of factoring by grouping. Explain how the distributive property is used in this process. Give a detailed example of this process.

  Reflexive-symmetric-boolean

Determine if the relation R on the set of all real numbers is reflexive, symmetric, antisymmetric, and/or transitive where (x,y) R if and only if x = 1.

  Calculate the test statistic

Calculate the test statistic.

  What is the shortest amount of time needed

It takes 3 seconds to flip a sandwich and 5 seconds to take one off or put one on the grill. What is the shortest amount of time needed to toast all 5 sandwiches?

  Which size box do you think the company should make

a company wants to construct a box that will hold exactly 200 one inch cubes. find the dimensions of all possible boxes. which size box do you think the company should make? why?

  Evolution of the mind through

Evolution of the mind began happening quite a long time ago. The ability to have emotions, critical thinking, solve problems, and relate to others is what makes us different from the animal and other living creature. It is very vivid that the mode..

  Determining the dimensions of a rectangle of maximum area

determining the dimensions of a rectangle of maximum area that is formed by x- axis and a semi circle.area a rectangle

  How many trees should planted to maximize the yield

An apple orchard has an average yield of 32 bushels of apples/tree if tree density is 24 trees/acre. For each unit increase in tree density, the yield decreases by 4 bushels/tree. How many trees should be planted in order to maximize the yield?

  Cookies with dark chocolate chips, and 2 empty identical

Professor Sofya oers you a chance to get an A++ in the course by playing a simple game. She gives you 50 cookies with white chocolate chips, 50 cookies with dark chocolate chips, and 2 empty identical containers. She asks you to put these 100 cook..

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