are going to solve the linear equationsystem Ax=b In Matlab:
vector x with matlab
residual vector r=b-Ax with matlab
Why is the
residual vector r not exactly 0(zero)?
Non-linear scalar equation with Newtons method
We want to determine the two positive roots to the
equation f(x)=0 where
a relative inaccuracy less than 10^-8.
ß relative inaccuracy (relative wrongness?).
you with paper, pen and non-graphicwriting calculator roughly localize the two
now the function f(x) in matlab in two separate windows. In the first part
window, f(x) should be displayed within the interval [0,a] where a is chosen so
the smaller of the two roots is visible(you should be able to see 1-2 digits in
the root). In the second part window, display f(x) in a bigger interval [0,A]
so the bigger root of the two roots is visible. Use the subplot commando
subplot(2,1,j) to display the j-th part window. Both graphs should have
matlab code to determine the roots carefully with Newton method
Also let the program write as much intermediate results that you can answer
How is quadratic
convergence defined for an iterative method for equation solutions?
How can we
see quadratic convergence in our printing? (Easiest to see in the bigger
How do you
check that the relative inaccuracy is small enough in your calculated
function have any negative roots? If so, how many? (Don’t forget to motivate
non-linear scalar equation with secant method
the two positive roots of the equation (f(x) in the previous assignment) with
the roots? Are they same?
have quick and regular convergence?
Is your convergence
quadratic? Is it linear?
convergence match/suit the theory for the method?
the methods do you prefer? Why?
and linear least squares method
table below displays the amount of time the sun is expected being up in
Stockholm during different days in 2020. (First column is number of hours,
second column is number of minutes and third column is the date),
We are now going to do some adaptations to these datas, with both
interpolation and least square method, to
the adaptations largest value and for which ‘’x-value’’ this occurs
the adaptations value for Christmas eve(Swedish Christmas eve), 24/12
the adaptation looks like for the whole year, together with all given points.
The different adaptations that should be done:
interpolation polynomial that passes through every point.
piece’’ linear interpolation through every point.
through every point.
quadratic polynomial that only uses data from 1 jun to 1 aug.
square adapted quadratic polynomial that only uses data from 1 apr to 1 sep.
square adapted quadratic polynomial that only uses data from 1 jan to 31 dec.
function y = c1 + c2*cos(w*x) + c3*sin(w*x) least square adapted from 1 jan to
31 dec, where w=2*pi/365 (ie one year periodic time).
adaptation did you find was the best? Does it depend on which part of the curve
you were interested in?
represent the coefficients with c_i for the polynomials
Which ‘’run-up’’ needed to calculate the most coefficients?
Which ‘’run-up’’ needed the least amount coefficients?
Four of the ‘’run-ups’’ needed three coefficients, which one or ones did you
find was the best? Did the best one/ones depend on what you had to calculate?
In these questions, it is difficult to define the correct answer; the important
thing is to be able to motivate your opinion. You should be able to show the
teacher that you understand and know which method should be used in different