### Create a function to estimate true heading

Assignment Help Computer Engineering
##### Reference no: EM131097701

E19: Numerical Methods for Engineering Applications Spring 2016 - HOMEWORK 4

1. Compass calibration

In the presence of magnets or circuitry, a magnetic compass may be subject to heading dependent heading error of the form

Ε(θ) = m sin(θ + φ) + b                                                                                   (1)

where m is the amplitude of the heading error, φ is the phase, and b is the DC offset. Given the true heading θT the measured heading θM is given by

θM = θT + ε(θT)                                                                                                    (2)

Given a set of true and measured compass data, we wish to estimate the unknown parameters m, φ, and b of the error function, and to be able to compute the true heading from the measured heading.

a. Make the error linear in the unknowns. Show that the error function (1) can also be written as

ε(θ) = m1sin(θ) + m2cos(θ) + b

and solve for m and φ in terms of m1 and m2.

b. Fit the data from the zip file. The file compass_data.txt is a simple text file with each line providing a (θT , θM) pair. You can load it into Python as an array using the command

data = numpy.genfromtxt('compass_data.txt')

Set up and solve a least-squares problem to obtain m1, m2, and b, and use your answer above to determine m and φ as well.

c. Create a function to estimate true heading. Equation (2) above tells how to compute θM from θT but we typically want to do the opposite. Use the fixed point iteration method to write a function which takes as input θM and then computes a number x such that x + ε(x) = θM. Verify your function by checking its output for 1.5, 2.0, and 2.5 radians.

2. Iterative solution methods

Modify the heat_1d.py example from class to solve the system using either Jacobi iteration or Gauss-Seidel iteration, but with a twist: you should not explicitly represent the A matrix or b vector at all. Since the structure of the A matrix in this problem is so regular, you should be able to replace any reference to a diagonal element of A with α, reference to to any element one step from the diagonal with -1, and totally remove any references to entries of A more than one step from the diagonal. You can reason similarly about the elements of b.

Your solver should terminate when the approximate relative error

εa = ||x(k+1) - x(k)||/||x(k+1)||

falls below 1e-5 (in my experience, this takes on the order of 150 iterations for n = 50).

3. Condition number of a matrix

Note: we will finish covering this material on 2/15.

For a small number ε > 0, the matrix

is nearly un-invertible. How much so? We can find out using the condition number of A.

Using the matrix norm

|||A||| = maxij|aij|

and the formula for the inverse of a 2 x 2 matrix, compute

cond(A) = |||A|||·|||A-1|||

analytically, in terms of ε.

Next, let's examine this in practice. For ε = 10-6, numerically compute the solution to Ax = b for b = (1, 1). Now observe how the solution changes as you perturb b with each of two small perturbations of δ1 = (ε, ε) and δ2 = (ε, -ε). Explain what you observe in terms of the matrix condition number. Recall that the condition number was originally defined as an inequality - how tight a bound is it in these two cases?

Attachment:- Assignment.rar

### Previous Q& A

#### After learning short run and long run cost functions

After learning short run and long run cost functions of industries, please give examples of industries which belong to the increasing return to scale, decreasing return to scale, and constant return to scale respectively. Explain why your pick follow..

#### How you led managed and communicated within the project

Using your selected project describe briefly with examples how you led, managed and communicated within the project. Describe what worked well and what you would change if you had to repeat the project.

#### Agent-employee and independent contractor

As a chief executive office, you are responsible only to the board of directors. Felicity, Ethan, Desiree and Cody do your bidding to one extent or another. All of you have contact with third parties on the firm's behalf. Who is principal? Agent? Emp..

#### Define what is enterprise crime in your own words

Siegel (2015) defines white collar crime and describes the profile of the typical white collar offender. In your initial response to this week's discussion, define white collar crime and economic crime in your own words, and describe the typical w..

#### White-box and black-box testing

Differentiate between White-box and Black-box testing. Which one is more useful and why?

#### Question regarding the java programming

Write a recursive method that takes as a parameter a nonnegative integer and generates the following pattern of stars. If the nonnegative integer is 4, then the pattern generated is:

#### Design a system with single-bit inputs u and d

If a single button is held down, Q should then continue to increment or decrement at a rate of once per second as long as the button is held. Assume the buttons are already dcbounccd. Assume Q simply rolls over if its upper or lower value is reach..

#### Joint application development

What is the difference between JAD (Joint Application Development) and RAD(Rapid Application Development) software development methodologies?

#### Determine the equivalent uniform annual cost

Forte Bend County is planning to construct a Dam some tens of miles away from the Grand Mission Recreation center to facilitate fishing in the El Rehobatha River Basin. In addition a major overhaul costing \$650,000 will be required at the end of the ..

#### Communication strategies organizations

The use of digital media within organizations has transformed how organizations communicate with prospective and current customers. Digital media such as: web videos, e-books, and social media have each shaped the communication strategies organiza..

### Similar Q& A

#### Appraise the individual and organizational consequences of

compare and contrast the mis in place in two distinctly different organizations.nbspcompare each organizations usenbsp

#### Write a program that allows numbers to be entered

Write a program that allows numbers to be entered in decimal (base 10), hexadecimal (base 16), or binary (base 2), and then prints out the number again in all three bases.

#### Write a c program that inputs several lines of multiple word

Write a c program that inputs several lines of multiple words, then a search character, and uses the function strchr to determine the total occurrences of the character in the lines of text.

#### Save the punch in or punch out date

Display an input field called "Choice" to input one of the four options - Inputting an incorrect option shall display a prompt indicating that the input was invalid and to try again.

#### Prepare a workflow diagram to describe how analytics and

write a four to six 4-6 page design document in which yousupport the need for the use of analytics and cloud technology

#### Make the syntax for a 2d array which has four rows

Write down the syntax for a 2D array which has four rows. The first row will have 10 elements and the second row will have 5 elements. The third row will have 8 elements and the fourth row will have 12 elements.

#### Describe how a race condition is possible

Describe how a race condition is possible and what might be done to prevent the race condition from occurring.

#### Write an essay on wifi performance

Write an essay on WiFi performance

#### What are the characteristics of application

offer examples of business applications that exhibit these characteristics. You can provide examples of applications from any client/server development environment. The two main platforms are Microsoft .NET and Sun JAVA J2EE.

#### Electrical or magnetic field that the nervous system produce

activation of the brain is measured by electrophysiological techniques using an electrical or magnetic field that the nervous system produces. These types of measures include may include magneto-encephalography (MEG) or electroencephalography (EEG..

#### Brief description to the pmis framework

A topic (consisting of a definition, brief description, example, context of usage, mapping [if any] to the PMI's framework [as described in the PMBOK Guide]) on the entries chosen from the AgileBOK.

#### What elements did the new world view possess

What elements did the new world view possess that were to enable it to last until the "Idea of Progress" in the eighteenth century. Is it still part of who we still think we are today Does it still define our place in the cosmos

#### 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!