- #1
zenith92
- 10
- 0
Homework Statement
The distance traveled by a comet is described with the following equation:
r = B + re cos (θ)
B (Beta) and e are constants
θ 0.88 1.10 1.42 1.77 2.14 2.91 3.85
r 8.27 5.49 3.53 2.50 1.95 1.52 5.21
These were some of the measurements, which can be written in the form Ax = b.
Task 1: design an m-file for the matrix A and the vector b with unknown vector
x = [ B
e]
Task 2: calculate the least squares x in Ax = b in MATLAB (use A\b or lsqr(A,b)
Task 3: determine the r if θ = 4.60 (approx. in 4 decimal)
Homework Equations
look up
The Attempt at a Solution
so I made the m-file with:
A = [0.88 1.10 1.42 1.77 2.14 2.91 3.85; 8.27 5.49 3.53 2.50 1.95 1.52 5.21]'
b = [8.27 5.49 3.53 2.50 1.95 1.52 5.21]'
Did lsqr(A,b) and got
lsqr converged at iteration 2 to a solution with relative residual 2.1e-015
ans =
-0.0000
1.0000
did the A \ b thing and got ans =
0.0000
1.0000
So my question is what would the r be that they're asking for me, i'd say close to 1.90?
but i don't know if the m-file is correct, you guys have an idea? Thanks!