-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Documenter.jl
committed
Oct 5, 2023
1 parent
08d6af0
commit 5744e36
Showing
38 changed files
with
42 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"documenter":{"julia_version":"1.9.3","generation_timestamp":"2023-10-05T18:18:14","documenter_version":"1.1.0"}} | ||
{"documenter":{"julia_version":"1.9.3","generation_timestamp":"2023-10-05T18:36:55","documenter_version":"1.1.0"}} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Convergence · RationalFunctionApproximation.jl</title><meta name="title" content="Convergence · RationalFunctionApproximation.jl"/><meta property="og:title" content="Convergence · RationalFunctionApproximation.jl"/><meta property="twitter:title" content="Convergence · RationalFunctionApproximation.jl"/><meta name="description" content="Documentation for RationalFunctionApproximation.jl."/><meta property="og:description" content="Documentation for RationalFunctionApproximation.jl."/><meta property="twitter:description" content="Documentation for RationalFunctionApproximation.jl."/><meta property="og:url" content="https://complexvariables.github.io/RationalFunctionApproximation.jl/convergence/"/><meta property="twitter:url" content="https://complexvariables.github.io/RationalFunctionApproximation.jl/convergence/"/><link rel="canonical" href="https://complexvariables.github.io/RationalFunctionApproximation.jl/convergence/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">RationalFunctionApproximation.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Walkthrough</a></li><li class="is-active"><a class="tocitem" href>Convergence</a></li><li><a class="tocitem" href="../minimax/">Minimax</a></li><li><a class="tocitem" href="../mode/">Discrete vs. continuous</a></li><li><a class="tocitem" href="../functions/">Functions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Convergence</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Convergence</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/complexvariables/RationalFunctionApproximation.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/complexvariables/RationalFunctionApproximation.jl/blob/main/docs/src/convergence.md#" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Convergence-of-AAA-rational-approximations"><a class="docs-heading-anchor" href="#Convergence-of-AAA-rational-approximations">Convergence of AAA rational approximations</a><a id="Convergence-of-AAA-rational-approximations-1"></a><a class="docs-heading-anchor-permalink" href="#Convergence-of-AAA-rational-approximations" title="Permalink"></a></h1><pre><code class="language-julia hljs">using RationalFunctionApproximation, CairoMakie</code></pre><p>For a function that is analytic on its domain, the AAA algorithm typically converges at least root-exponentially. In order to observe the convergence, we can construct an approximation that preserves the history of its construction. For example, we approximate an oscillatory function over <span>$[-1,1]$</span> via:</p><pre><code class="language-julia hljs">f = x -> cos(11x) | ||
r = approximate(f, unit_interval, stats=true) | ||
convergenceplot(r)</code></pre><img src="042bef55.png" alt="Example block output"/><p>In the plot above, the markers show the estimated max-norm error of the <span>$n$</span>-point AAA rational interpolant over the domain as a function of the numerator/denominator degree <span>$n-1$</span>. The red circles indicate that a pole of the rational interpolant lies on the interval itself. We can verify this by using <code>rewind</code> to recover the degree-7 approximation that was found along the way to <code>r</code>:</p><pre><code class="language-julia-repl hljs" style="display:block;">julia> r7 = rewind(r, 7)</code><code class="nohighlight hljs ansi" style="display:block;">Barycentric rational function of type (7,7) on the domain: Path with 1 curve</code><br/><code class="language-julia-repl hljs" style="display:block;">julia> poles(r7)</code><code class="nohighlight hljs ansi" style="display:block;">7-element Vector{ComplexF64}: | ||
-0.7865385850382729 + 0.26769746910591075im | ||
-0.7865385850382728 - 0.26769746910591075im | ||
-0.3174146424804872 + 0.288943809847393im | ||
-0.3174146424804871 - 0.28894380984739293im | ||
0.16129605360549762 - 0.24967968490231618im | ||
0.16129605360549765 + 0.2496796849023162im | ||
0.7365067113018722 + 0.0im</code></pre><p>When the AAA iteration encounters an approximation with such undesired poles, or having less accuracy than a predecessor, the AAA iteration simply disregards that approximation and continues–-unless there have been more than a designated number of consecutive failures, at which the best interpolant ever encountered is returned. That interpolant is indicated by the gold halo in the convergence plot above.</p><p>When a singularity is very close to the approximation domain, it can cause stagnation and a large number of bad-pole failures:</p><pre><code class="language-julia hljs">f = x -> tanh(3000*(x - 1/5)) | ||
convergenceplot(r)</code></pre><img src="57016ed7.png" alt="Example block output"/><p>In the plot above, the markers show the estimated max-norm error of the <span>$n$</span>-point AAA rational interpolant over the domain as a function of the numerator/denominator degree <span>$n-1$</span>. The red circles indicate that a pole of the rational interpolant lies on the interval itself. We can verify this by using <code>rewind</code> to recover the degree-7 approximation that was found along the way to <code>r</code>:</p><pre><code class="language-julia-repl hljs" style="display:block;">julia> r7 = rewind(r, 7)</code><code class="nohighlight hljs ansi" style="display:block;">Barycentric rational function of type (7,7) on the domain: Path with 1 curve</code><br/><code class="language-julia-repl hljs" style="display:block;">julia> poles(r7)</code><code class="nohighlight hljs ansi" style="display:block;">7-element Vector{ComplexF64}: | ||
-0.7865385850382719 + 0.2676974691059106im | ||
-0.7865385850382718 - 0.2676974691059106im | ||
-0.317414642480487 - 0.28894380984739215im | ||
-0.317414642480487 + 0.2889438098473921im | ||
0.1612960536054982 - 0.2496796849023163im | ||
0.16129605360549823 + 0.24967968490231632im | ||
0.7365067113018724 + 0.0im</code></pre><p>When the AAA iteration encounters an approximation with such undesired poles, or having less accuracy than a predecessor, the AAA iteration simply disregards that approximation and continues–-unless there have been more than a designated number of consecutive failures, at which the best interpolant ever encountered is returned. That interpolant is indicated by the gold halo in the convergence plot above.</p><p>When a singularity is very close to the approximation domain, it can cause stagnation and a large number of bad-pole failures:</p><pre><code class="language-julia hljs">f = x -> tanh(3000*(x - 1/5)) | ||
r = approximate(f, unit_interval, stats=true) | ||
convergenceplot(r)</code></pre><img src="c7709f12.png" alt="Example block output"/><p>This effect is thought to be mainly due to roundoff and conditioning of the problem. If we use more accurate floating-point arithmetic, we can see that the AAA convergence continues steadily past the previous plateau:</p><pre><code class="language-julia hljs">using DoubleFloats | ||
convergenceplot(r)</code></pre><img src="2c8a255b.png" alt="Example block output"/><p>This effect is thought to be mainly due to roundoff and conditioning of the problem. If we use more accurate floating-point arithmetic, we can see that the AAA convergence continues steadily past the previous plateau:</p><pre><code class="language-julia hljs">using DoubleFloats | ||
r = approximate(f, unit_interval, float_type=Double64, stats=true) | ||
convergenceplot(r)</code></pre><img src="aa70c007.png" alt="Example block output"/><p>In the extreme case of a function with a singularity on the domain, the convergence can be substantially affected:</p><pre><code class="language-julia hljs">f = x -> abs(x - 1/8) | ||
r = approximate(f, unit_interval, stats=true) | ||
convergenceplot(r)</code></pre><img src="68d6eb68.png" alt="Example block output"/><p>In such a case, we might get improvement by increasing the number of allowed consecutive failures via the <code>lookahead</code> keyword argument:</p><pre><code class="language-julia hljs">r = approximate(f, unit_interval, stats=true, lookahead=20) | ||
convergenceplot(r)</code></pre><img src="6e37860c.png" alt="Example block output"/></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Walkthrough</a><a class="docs-footer-nextpage" href="../minimax/">Minimax »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.0 on <span class="colophon-date" title="Thursday 5 October 2023 18:18">Thursday 5 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> | ||
convergenceplot(r)</code></pre><img src="f036fc9f.png" alt="Example block output"/><p>In such a case, we might get improvement by increasing the number of allowed consecutive failures via the <code>lookahead</code> keyword argument:</p><pre><code class="language-julia hljs">r = approximate(f, unit_interval, stats=true, lookahead=20) | ||
convergenceplot(r)</code></pre><img src="10298161.png" alt="Example block output"/></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Walkthrough</a><a class="docs-footer-nextpage" href="../minimax/">Minimax »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.1.0 on <span class="colophon-date" title="Thursday 5 October 2023 18:36">Thursday 5 October 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> |
Oops, something went wrong.