Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Figures for nonlinear stokes solve #4763

Merged
merged 3 commits into from May 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions doc/sphinx/user/methods/nonlinear-stokes-solvers.md
Expand Up @@ -86,7 +86,7 @@ To solve this nonlinear equation using Picard iterations, we need to rewrite our
This means that we need to find the point where $x$ is equal to $0.5*sqrt(1+x^2)$. The resulting $x$ is a the same time the solution to our original question (see the gray lines in {numref}`user_methods_nonlinear_solvers_new_and_original_function`).

(user_methods_nonlinear_solvers_new_and_original_function)=
```{tikz} A plot of the rewritten equation: $x = 0.5*sqrt(1+x^2)$. The green line the original equation and the gray lines intersect at the solution.
```{tikz} A plot of the rewritten equation (cyan): $x = 0.5*sqrt(1+x^2)$. The green line is the original equation, the black line is where x=y, and the gray lines intersect at the solution.
[xscale=8,yscale=8]
\node[draw] at (0.3,1.4) {find $x = 0.5sqrt(1+x^2)$};
\draw[thick,->] (-0.01,0) -- (2.025,0) node[right]{x};
Expand All @@ -103,7 +103,7 @@ This means that we need to find the point where $x$ is equal to $0.5*sqrt(1+x^2)
The Picard iteration transforms $x = 0.5*sqrt(1+x^2)$ into $x_{k+1} = 0.5*sqrt(1+x_k^2)$. This means to start the iteration, we will need an initial guess where the solution is. Let's pick $x_0 = 2$.


```{tikz} The blue line is the location of our initial guess
```{tikz} The blue line is the location of our initial guess, $x_0 = 2$.
[xscale=8,yscale=8]
\node[draw] at (0.3,1.4) {find $x = 0.5sqrt(1+x^2)$};
\draw[thick,->] (-0.01,0) -- (2.025,0) node[right]{x};
Expand All @@ -119,7 +119,7 @@ The Picard iteration transforms $x = 0.5*sqrt(1+x^2)$ into $x_{k+1} = 0.5*sqrt(1
Following the iteration, we set our next x ($x_1$) equal to our $y = 0.5*sqrt(1+(2^2)) \approx 1.11803$


```{tikz} The blue line is the location of our initial guess and the $x=y$ step.
```{tikz} The blue line is the location of our initial guess and the $x=y$ step (red).
[xscale=8,yscale=8]
\node[draw] at (0.3,1.4) {find $x = 0.5sqrt(1+x^2)$};
\draw[thick,->] (-0.01,0) -- (2.025,0) node[right]{x};
Expand All @@ -136,7 +136,7 @@ Following the iteration, we set our next x ($x_1$) equal to our $y = 0.5*sqrt(1+
We then use the new $x$ location to compute a new $y$ and set $x_2$ to that new $y$. We keep repeating this until we are close enough to the solution:


```{tikz} Several Picard iterations colored blue and red for each other iteration.
```{tikz} Several Picard iterations colored blue and red for every other iteration.
[xscale=8,yscale=8]
\node[draw] at (0.3,1.4) {find $x = 0.5sqrt(1+x^2)$};
\draw[thick,->] (-0.01,0) -- (2.025,0) node[right]{x};
Expand Down Expand Up @@ -208,7 +208,7 @@ Some strategies to achieve this, also called globalization, will be discussed in
```

(user_methods_nonlinear_solvers_sin_2)=
:::{tikz} Continuation from figure {numref}`user_methods_nonlinear_solvers_sin_1`, with the blue and gray lines showing one more iteration.
:::{tikz} Continuation from figure {numref}`user_methods_nonlinear_solvers_sin_1`, with the blue lines showing one more iteration.
[xscale=3,yscale=3]
\node[draw] at (-1.4,1.4) {find sin(x) = 0};
\draw[thick,->] (-2.5,0) -- (2.5,0) node[right]{x};
Expand Down Expand Up @@ -263,6 +263,7 @@ Now that we have a general understanding of how the Newton solver works, let's a
\draw [blue, thick, ->] (0.539987,0.5) -- (0.539987,0.475140);
\draw [red, thick] (0.539987,0.475140) -- (0.576478,0.5);
\draw [red, thick, ->] (0.576478,0.5) -- (0.576478,0.499433);
\draw[red] (0.576478,0.499433) circle (0.05);

```

Expand Down