MPResults
This is v1.0
This repo supports my paper
C. T. Kelley, Newton's Method in Mixed Precision, 2021, To appear in SIAM Review
This version will make the plots/tables in the paper/notebook.
This uses the solvers and test problems from my new SIAMFANLEquations.jl package.
Readme Contents
What's in this repo
- The codes in /src
You need these packages:
- PyPlot
- LinearAlgebra
- SIAMFANLEquations
- Printf
- FFTW
- AbstractFFTS
- The data I used to make the plots in /Data_From_Paper
- The half-precision data takes a very long time to generate (days to weeks)
- I show you how to make an abridged version of the plots in the notebook ...
- A juypter notebook MPResults.ipynb explaining how it all works
- If the notebook fails to render, do not bother me. Instead, look at the sad tale of woe on
jupyter/notebook#3555
- The pdf is a better job than github's render anyhow. You can look at it.
- It's even better to clone the repo and get to the notebook from your own computer anyhow.
- newtonmp.html is the bib for the notebook. Do not touch it.
- If the notebook fails to render, do not bother me. Instead, look at the sad tale of woe on
jupyter/notebook#3555
- A pdf file of the notebook.
- Viewgraphs from a talk I gave at Hong Kong Polytechnic on this.
How to use this mess
This is a Julia application. It has .toml files to prove it.
Look at https://julialang.github.io/Pkg.jl/v1/glossary/# to see the difference between an application, a project, and a package.
-
Have a github accout and know how to use it.
-
Clone the repo into your choice of directory. My favorite way to do this is to cd to that directiory and issue this terminal command
git clone https://github.com/ctkelley/MPResults
-
Put MPResults in your Julia LOAD_PATH with the command (issued from the REPL)
push!(LOAD_PATH,"/Users/yourid/whereyouputit/MPResults")
You must use the absolute pathname (ie starting with /Users for Mac) for this.
-
Type using MPResults at the Julia prompt and you're ready to go. Unless ...
-
If you get complaints about missing packages, install those packages. Then try again.
-
Alternatively, for those of you who are comfortable using pkg...
-
cd to the MPResults directory. Fire up pkg (the package manager) by typing ] at the julia prompt.
-
Then
(v1.2) pkg> activate .
Activating environment at `~/Julia/MPResults/Project.toml`
MPResults) pkg> instantiate
MPResults) pkg> update- Get out of pkg by typing a backspace.
Julia prints out the story of package installation. The instantiate command should install your missing packages automatically. The update part is to make sure that you're using the latest stuff. I will try to keep this updated, but I could be dead when you read this.
-
-
Fire up IJulia by
- Typing
notebook
at the REPL Prompt - Navigating to the MPResults directory
- Clicking on MPResults.ipynb
- Do run all to make sure the LaTeX macros and the dependencies are in there. It is really important to run the first cell in the notebook. That is an invisible markdown cell with the LaTeX macros. The second cell is a code cell that organizes the dependencies and makes sure you're starting from the correct directory.
- Typing
-
NSOL
nsol.jl is from my new book/package/notebook project.
Solvers and Examples in Julia
Solving Nonlinear Equations with Iterative Methods: This book will be a sequel to
(Kel03) C. T. Kelley, Solving Nonlinear Equations with Newton's Method , Fundamentals of Algorithms 1, SIAM 2003.
The components are
- A book now under contract to be published by SIAM in 2022
- A Julia package: SIAMFANLEquations.jl
- A collecton of IJulia notebooks:
Notebook Problems
It is very important that PyPlot and IJulia use the same version of conda. If the notebook is complaining about the kernel, that is likely the issue. You have a good chance of fixing this with the update command within pkg (see detailsbelow). If you did the update when you installed this application and are still having problems. Try typing update IJulia and build IJulia from pkg.
How to update all packages: If you are running anything other than Julia 1.5. Your packages may be out of sync with the application. To fix this
1. Do a package update from the REPL
2. From the REPL in the MPResults directory.
a. Type ] to get into the package manager
b. type activate .
(the . is important) at the package prompt
c. type update
at the package prompt
d. hit backspace to exit the package manager
3. Doing this will update the .toml files for the application
If that fails ...
The worst case, which has happened to me more than once, is that you'll have to
-
Move .julia/config to a safe place.
- Your startup.jl lives in config. Don't lose it.
-
Delete or move .julia
-
Run Julia (which will create a new .julia in your home directory)
- Put your config diectory back in there.
-
Reinstall ALL YOUR PACKAGES! That is a real pain, but has never failed to fix the problem for me.
Support
This project was partially supported by
- Army Research Office grant W911NF-16-1-0504 and
- National Science Foundation Grants
- OAC-1740309
- DMS-1745654
- DMS-1906446
- Department of Energy grant DE-NA003967
Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author and do not necessarily reflect the views of the National Science Foundation, the Department of Energy, or the Army Research Office.