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

  Give your opinion on the reasons why sapient developed its

sapient is an international company based in massachusetts. it has developed a unique and innovative agile methodology

  Benefit and disadvantage of cloud pro for network admins

Discuss one benefit and one disadvantage of Cloud Pro for network admins. Search and view a video demo of Rackspace's Cloud Pro for the iPad. Does the app have amazing features, as Mike Mayo described

  Write c++ program that stops read a line of text

determine what characters , if any, are not displayed by program you ceated for exercise (a)

  Article on a biomedical application using a microcontroller

Find a recent article on a biomedical application using a microcontroller and how you would design this microcontroller-based string matching detector. Which peripherals would you be using? What considerations would you take into account

  Discuss the layered stack approach

This is meant as a discussion topic, this is not an essay. Describe the OSI and TCP/IP reference models. express  the similarities and differences between them. consider how the layered stack approach assists in our understanding of these referenc..

  Program for calling the function

Suppose the availability of class named DataTransmitter which offers a static method, sendSignal which takes no arguments. Write down the code for calling this method.

  Develop a marie program that will input a variable number

Develop a MARIE program that will input a variable number of user entered Decimal whole number grades, validating each one (0-100) in a subroutine. If the input is invalid just terminate the input loop.

  To further investigate this weeks topics and to explain

to further investigate this weeks topics and to demonstrate your understanding of e-commerce as it relates to business

  What is the best way for sending people out

What is the best way for sending people out if one wants the total competition to be over as early as possible? More precisely give an efficient algorithm that produces a schedule whose completion time is as small as possible.

  How to name the associative entities

How to name the associative entities

  Question1 write down a css rule that gives all h1 and h2

question1. write down a css rule that gives all h1 and h2 elements a padding of 0.5 ems a dashed border style and a

  Express the role of each table

Propose the design of a database. Explain the role of each table in your proposed database and the relationships between the tables.

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