Skip to content

Commit fc55d1f

Browse files
committed
Add plot of stationary points to README
1 parent 99cfcd1 commit fc55d1f

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ julia> @time rts = roots(g, X × X × X)
9494
Root([-0.440763, -0.440762] × [0.866025, 0.866026] × [0.236067, 0.236068], :unique)
9595
Root([-0.440763, -0.440762] × [-0.866026, -0.866025] × [0.236067, 0.236068], :unique)
9696
```
97-
97+
9898
There are guaranteed to be four unique roots.
9999

100100
### Stationary points
@@ -117,6 +117,22 @@ julia> rts = roots(∇f, IntervalBox(-5..6, 2), Newton, 1e-5)
117117
[output snipped for brevity]
118118
```
119119
120+
Now let's find the midpoints and plot them:
121+
122+
```jl
123+
midpoints = mid.([root.interval for root in rts])
124+
125+
xs = first.(midpoints)
126+
ys = last.(midpoints)
127+
128+
using Plots; plotlyjs()
129+
130+
surface(-5:0.1:6, -6:0.1:6, (x,y)->f([x,y]))
131+
scatter!(xs, ys, f.(midpoints))
132+
```
133+
The result is the following:
134+
![stationary points](stationary_points.png)
135+
120136
121137
122138
Some basic documentation (mostly now out of date) is available at [here](https://juliaintervals.github.io/IntervalRootFinding.jl/latest/).

stationary_points.png

461 KB
Loading

0 commit comments

Comments
 (0)