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)||

1279_Figure.png

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

Reference no: EM131097701

Questions Cloud

Cumulative backup on the other sundays : A customer performs a full backup on the first Sunday of the month followed by a cumulative backup on the other Sundays. They also perform an incremental backup each day Monday through Saturday.
Teams captured and euthanized at least five alligators : In this article, analyze the original article and look to see if you can find the newsworthiness. Thinking of the standard criteria for news how would you justify that this article is news. Explain.
Prepare a report on study of formation of crack patterns in : Prepare a project report on Study of formation of crack patterns in bentonite clay with different AC voltages.
Calculate the mtbf and mttr of component : Failure of component 1 occurs as follows: n Monday = No failure n Tuesday = 5 a.m. to 7 a.m. n Wednesday = No failure n Thursday = 4 p.m. to 8 p.m. n Friday = 8 a.m. to 11 a.m. Calculate the MTBF and MTTR of component.
Create a function to estimate true heading : 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 suc..
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..

Reviews

Write a Review

 

Computer Engineering Questions & Answers

  What is the least number of tcp segments

The following questions is related to TELNET. A user types cp file1 file2. What is the minimum number of TCP segments exchanged if the transfer uses the following mode. Explain the answer.

  When dynamically allocating memory for a specific data type

when dynamically allocating memory for a specific data type explain why a pointer variable of the same data type must

  Define what would adversary observe

(HW1) List some of the attacks on the Diffie-Hellman key exchange protocol we discussed in the lecture. Present your solution for avoiding such attacks.

  Explain heat transfer by radiation

Heat Transfer by Radiation, How much does a human body radiate assuming that they are in a vacuum of space

  Find out the strategic merits and demerits of using

determine the strategic advantages and disadvantages of using customer relations management crm services provided by

  Describe why you think it is important for an organization

write 4-6 paragraphs...define the terms and discuss their implementation.use examples to reinforce your ideas.several

  Questionkeeping data safe is not only a responsibility of

questionkeeping data safe is not only a responsibility of the security administrator but also of every employee in a

  For your assiggnment consider the following writing two

for your assiggnment consider the following writing two pagesdefine a decision support system dss.what is the

  In what circumstances are digital readout displays best

In what circumstances are digital readout displays best, and why? In what circumstances are analog readout displays best, and why?

  How to write code for selection sort, insertion sort

How to write code for selection sort, insertion sort. Using your performance of selection, bubble and insertion sort, add a counter in an appropriate place so as to measure the runtime of your code for example this capacity be a counter to track ..

  Select a large multinational organisation that has

select a large multinational organisation that has succeeded in effectively aligning its business and isit strategies

  Cloud computing management

As we selecting Google Docs as the SaaS provider Proper actions are to be upheld when handling Google Docs servers as the software service providers. This is a challenge posed from several grounds, starting from its vulnerability to hacking and ea..

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