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

  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