Find the initial interval for the root search

Assignment Help Computer Engineering
Reference no: EM1327407

1. Construct your own MATLAB function realizing the insertion sort algorithm.
Your function should have an unsorted array as its input and the sorted array as the output. In particular, you will need:
(i) Draw a flowchart of the function realizing the insertion sort
(ii) Write the corresponding MATLAB code. You should check (just for yourself) how your function works with an arbitrary unsorted array.

2. Write your own function computing cos(x) based on the Taylor expansion of cos(x) in the vicinity of zero. Name this function my_cos(x, N, eps). The input parameters in this function should be: x- the argument; N - the initial number of terms in the expansion; eps -optional parameter, giving the accuracy of approximation. In particular, you will need to do:
(i) Write MATLAB code for a function computing cos(x) based on the Taylor expansion with the fixed number of terms N in the expansion. Name
this function my_cos1(x,N). Draw a flowchart of my_cos1
(ii) (8 marks) Write a MATLAB code for my_cos(x,N,eps) based on the function my_cos1(x,N). 'Eps' is an optional parameter, the giving the accuracy. In other words, your function can used in two modes: my_cos(x,N,eps) and my_cos(x,N). Draw a flowchart of my_cos.

Hint: if we need to compute cos(x) with a given accuracy ?, we can truncate the infinite part of Taylor expansion cos(x)=a0+a1 x+a2 x2+... + an xn+...starting with the term an xn in case we have |an xn|<?.

3. You are computing now the roots of a nonlinear equation f(x)=0 with the accuracy ? based on the bisection method (use Wikipedia for details about the method, section 'The method'). The given accuracy is achieved in case |f(c)|< ? , where c- is an approximate root of the equation.
You will need to construct your own MATLAB function bisect_1(fname, a, b, eps), where fname - is the name of the function; a,b, determine the initial interval for the root search; eps is the accuracy.
(i) Draw a flowchart of bisect_1(fname, a, b, eps).
(ii) Write MATLAB code for bisect_1(fname, a, b, eps).
(iii) Find all roots of the equation exp(- cos(x)) -1=0 in the interval 0<x<3

Reference no: EM1327407

Questions Cloud

Scope, magnitude and feasibility of finding solution : Discuss the significance, scope, magnitude and feasibility of finding a solution to why students respond negatively to online learning teams and what can be done to promote a more positive experience.
Explain future environmental factors- mail packaging : Explain Future environmental factors- mail packaging or supply business and which factors do you think will have the most important impact
Wage and hour law of california : What are Exempt employees versus nonexempt employees as it relates to California?
Explaining power and leadership in organization : What is the relationship between power and leadership in an organization? How is power gained?
Find the initial interval for the root search : Write down the corresponding MATLAB code. You should check (just for yourself) how your function works with an arbitrary unsorted array.
Briefly elucidate how knowledge of price elasticity : Briefly elucidate how knowledge of price elasticity between different groups of customers
Prepare the standard cost of direct material : Development of standard costs - Prepare the standard cost of direct material, direct labor and packaging for a 10 gal batch of nerries sherbert.
Computing present value and future value : Find out the future value one year from now of $7,000 investment at a 3 percent annual compound interest rate. Also calculate the future value if the investment is made for two years.
Coimpute how much the shortage or surplus is if there is any : Coimpute how much the shortage or surplus is if there is any.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Generating ten random permutations

Write down a program which generates ten random permutations of numbers 1 to 10. To produce a random permutation, you require filling a vector along with the numbers 1 to 10 so that no two entries of vector have the same contents.

  Developing the java program

The Java String class explains the following method in order to split a Java String object into several fragments of the substrings and store them in a returned String array.

  Developing an eer schema for database application

Develop an EER schema for a database application which you are interested in. State all the constraints which should hold on the database.

  Determining the priority of period of execution of irqj

Determining the priority of period of execution of IRQJ

  Design a data structure which supports two operations

Design a data structure which supports two operations 1. Insert(S, x) inserts x into S. 2. Remove-Duplicates(S) removes from S all duplicated values.

  Program to print a sequence of 20 random die tosses

Write down a program which produces a sequence of 20 random die tosses in an array and which prints the die values.

  Computer hardware purchases over the next five years

what criteria will you use to make the purchases.

  Benefits of ansi/tia/eia cabling standards

Discuss about the benefits of the ANSI/TIA/EIA cabling standards in detail and also explain why telecommunications managers must be familiar with them.

  Determined through default conventions

An advantage of dynamic scoping is that access to nonlocal variables is considerably faster than accesses to nonlocals when static scoping is used.

  Consider an adt called squarematrix

Consider an ADT called 'SquareMatrix'

  What competitive advantage will gain

What competitive advantage will you gain by establishing SDLC and following rigid processes and procedures? List your response in bulleted format and provide details for each.

  Problem on sql statement

Problem on  SQL statement

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