|
Posted: 08/21/23
Due: 08/30/23, 11:59PM
Tracks 1 & 2: 1-4. Track 2: 5.
This homework serves as an introduction to number approximation techniques and a familiarization with homework drafting and submission procedures. No grade points are awarded, but comments on proper assignment drafting are returned.
Solution drafting notes.
Take note of the following aspects of the model solution. The letter in the list below will be used in comments on your submitted solution.
Hints on how to approach your solution are deleted from the work you turn in.
Correct punctuation is used in mathematical statements.
Present concise results.
Favor presentation of results as well-constructed plots or tables that synthesize performed computations. Plots must be labeled, inserted into your document (Insert->Image->Insert image ...) into a figure environment (Insert->Image->Small figure) and appropriately sized. Tables must be labeled and inserted into a table environment (Insert->Table->Big table).
When a question specifically requests presentation of code, include the code in the main text of your solution. Otherwise, include code that was used to obtain your results inside of a fold (Insert->Fold->Folded->Default). Submit your draft with all folds closed, which should result in a coherent presentation of your work.
Include brief comments on the intent of the coding instructions.
Break up long sequences of code (Focus->Session->Split session) into commented chunks.
Ensure variables in code correspond to notation used in mathematical formulas.
Immediately test functions to ensure they behave as intended.
Identify generic aspects of a problem and code these into separate functions, e.g., a general function to evaluate continued fractions that can be reused or tested on a simple cases.
Always add a conclusion to your presentation of results.
State relevant theory, and verify assumptions of the theory.
Consider alternative interpretations of a problem, even if you choose to solve only one formulation.
Recognize structures within complicated expressions.
Recognize complicated formulations, and first attempt the simplest possible case. Within allowable time constraints either start work on the more complicated formulation or state the difficulties.
Construct a convergence plot in logarithmic coordinates of the Stern continued fraction
Identify the terms in the general expression of a continued fraction
Compare with the additive approximation of the Leibniz series
Estimate the rate and order of convergence for both approximations.
Solution. (a) Identification of terms: the first few terms are
With , , , obtain , and for . (c)
For large enough , the distance of a term sequence to the limit satisfies
whence
and then
Results are presented in the following table, with both sequences exhibiting close to linear convergence. (k)
Apply convergence acceleration to both the above approximations involving . Construct the convergence plot of the accelerated sequences, and estimate the new rate and order of convergence.
Solution. (a) Since both the Leibniz and the Stern sequences exhibit close to linear convergence, Aitken acceleration is applicable (though not guaranteed to provide faster convergence since it is an extrapolation).
![]() |
Generate terms in the Leibniz, Stern sequences
∴ |
N=40; n=1:N; L=Leibniz.(n); S=ContFrac.(n,aS,bS); |
∴ |
Define a function that carries out Aitken acceleration. (j)
∴ |
function Aitken(x) n=maximum(size(x)); a=copy(x); for k=3:n Δx = x[k] - x[k-1] Δ2x = x[k] - 2*x[k-1] + x[k-2] a[k] = x[k] - Δx^2/Δ2x end return a end; |
∴ |
AL = Aitken(L); AS = Aitken(S); |
∴ |
Construct plot of errors for both original and accelerated sequences
∴ |
errL=log.(abs.(L .- π/4)); errAL=log.(abs.(AL .- π/4)); |
∴ |
errS=log.(abs.(S .- π/2)); errAS=log.(abs.(AS .- π/2)); |
∴ |
clf(); plot(log.(n),errL,"-o"); plot(log.(n),errS,"-x"); plot(log.(n),errAL,"o"); plot(log.(n),errAS,"x"); xlabel("log(n)"); ylabel("log(err)"); title("Aitken-accelerated Leibniz/Stern convergence"); grid("on"); plot([2,4],[-6,-8],"-"); plot([2,4],[-6,-10],"-"); |
∴ |
savefig(homedir()*"/courses/MATH661/homework/H00/Fig02.eps") |
∴ |
Completely state the mathematical problem of taking the root of a positive real, . Find the absolute and relative condition numbers.
Solution. Within the framework of defining a mathematical problem as a function (l), the choices
with , , can be made. Other options (m) include treating as a variable or considering the framework of multivalued functions (regularized by cuts in the complex plane) for which . Since is differentiable, the absolute condition number is given by the derivative
The relative condition number is then
Completely state the mathematical problem of finding the roots of the cubic polynomial , using the Cardano [2] formula. Find the absolute and relative condition numbers.
Solution. Assuming , then one real root is obtained as
where
and is assumed to be positive. In this case , , though in general (m) might be complex. The function is a composition of differentiable functions, so the condition number may be evaluated as the norm of the gradient
Further calculation gives
The relative condition number can be stated
choosing the 2-norm in .
Completely state the mathematical problem of solving the initial value problem for an ordinary differential equation of first order. Use Lyapunov exponents [1] to find the absolute condition number.
Solution. For the initial value problem (IVP) expressed in autonomous form (always possible) (l)
the problem inputs are the slope function that has to be Lipschitz continuous, to obtain a unique solution (l) and the initial value . The definition of the mathematical problem is then , . In this formulation the condition number requires the definition of the derivative of a function (i.e., the solution ) with respect to another function (the slope ). (o)
Since the Lyapunov exponent quantifies the rate of separation of trajectories upon infinitesimal perturbation of the initial condition , in the simpler case of considering fixed, the condition number is identical to the Lyapunov exponent, .