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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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