-
-
Notifications
You must be signed in to change notification settings - Fork 235
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
Example: Solving Equations in with Julia-defined Types #52
Comments
Did you install ArbFloats and DecFP? Note that ArbFloats requires Nemo to be installed (at least it used to). These two should work. [Should I make it more explicit that the packages for these number types have to be installed separately? I thought it was implied, but if it isn't obvious then I should add that the install instructions] In my tests, Decimals.jl, ArbReals, and DoubleDouble.jl don't work right now. That's stated in the notebooks. DoubleDouble doesn't let you multiply ints among other issues, which causes it to fail. ArbReals is still in development, and Decimals doesn't have an |
Yes, you should be clearer or perhaps use colors for the package names. The sequence should also be indicated: Nemo then ArbFloats then others. In any case Nemo did not compile properly for me thus stalling the whole process. From: Christopher Rackauckas [mailto:[email protected]] Did you install ArbFloats and DecFP? Note that ArbFloats requires Nemo to be installed (at least it used to). These two should work. [Should I make it more explicit that the packages for these number types have to be installed separately? I thought it was implied, but if it isn't obvious then I should add that the install instructions] In my tests, Decimals.jl, ArbReals, and DoubleDouble.jl don't work right now. That's stated in the notebooks. DoubleDouble doesn't let you multiply ints among other issues, which causes it to fail. ArbReals is still in development, and Decimals doesn't have an abs function. These number packages need more functions to be compatible (as stated in the notebook). — |
Nemo is hard to compile for some reason... I just tried it update the example and it's failing. I'll post what I had to do when I get it. Note that I have to use my VNC to a Linux computer to do this: I haven't gotten Nemo to compile on Windows ever. @JeffreySarnoff did you mention before that you're working on a version of ArbFloats that doesn't require Nemo? That would be really helpful. |
The other examples were changed, and it should be more clear which ones are compatible and which ones are not. DecFP's example should work now (it needed the constant to also be Dec128, which it was until the problem definition changed to the new way which is causing all of these example issues). Let me know if that works. What's left is that ArbFloats is compatible, but I need the example to show that again. For that, I need Nemo to build. |
For Nemo, this is the answer. I am on Windows 64-bit and Anaconda3.4.1 Should I switch to Ubuntu for all future work? I have Ubuntu 16.04 and Ananconda2.4.1 (but not now…I have it on a VirtualBox with a few bugs to iron out) From: Christopher Rackauckas [mailto:[email protected]] Nemo is hard to compile for some reason... I just tried it update the example and it's failing. I'll post what I had to do when I get it. Note that I have to use my VNC to a Linux computer to do this: I haven't gotten Nemo to compile on Windows ever. @JeffreySarnoff https://github.com/JeffreySarnoff did you mention before that you're working on a version of ArbFloats that doesn't require Nemo? That would be really helpful. — |
I got Nemo (/ArbFloats) to install just by doing But ArbFloats has a new problem. For more compatibility I added a float call some time ago in my calculation for the L^2 error. ArbFloats don't have a using ArbFloats
import Base: float
const arbalpha = ArbFloat(1.01)
float(arbalpha) That will error, while using ArbFloats
import Base: float
float(x::ArbFloat) = x
const arbalpha = ArbFloat(1.01) That won't. |
If you use Ubuntu, be careful because the PPA is old: I use CentOS, and the COPR repository. It stays up to date quite well. Note that there are fewer and fewer features which "require" Linux as time goes on. I work most of the time on Windows so I tend to point out and try to fix these issues as they come up, but since most developers are on Linux, these issues tend to get overlooked. For example:
The list can go on. Really, if you're dealing with something that uses some C/Fortran binary, it's more likely to work the first time if you're on Linux, because the developer of that package probably used Linux. |
Thank you for taking me through all these headaches in Julia on your examples folder. Not had problems so far with Julia but then I never got into packages in development. I now have a better feel for errors and package bugs and idiosyncrasies. From: Christopher Rackauckas [mailto:[email protected]] If you use Ubuntu, be careful because the PPA is old: I use CentOS, and the COPR repository. It stays up to date quite well. Note that there are fewer and fewer features which "require" Linux as time goes on. I work most of the time on Windows so I tend to point out and try to fix these issues as they come up, but since most developers are on Linux, these issues tend to get overlooked. For example:
The list can go on. Really, if you're dealing with something that uses some C/Fortran binary, it's more likely to work the first time if you're on Linux, because the developer of that package probably used Linux. — |
Nemo has installed properly (as different from last time) but ArbFloats does not work any better. From: Christopher Rackauckas [mailto:[email protected]] I got Nemo (/ArbFloats) to install just by doing Pkg.add("Nemo") a few times... I think I had to do that last time. I wonder what's up there. Try it yourself and see if it does the same thing? An open an issue if it does. It might also be because I closed the IJulia notebooks, then it worked. But ArbFloats has a new problem. For more compatibility I added a float call some time ago in my calculation for the L^2 error. ArbFloats don't have a float method, but it's simple to fix because it should be a no-op. I put a PR on the ArbFloats repo which should fix this: jsarnoff-juliacon/ArbFloats.jl#1 jsarnoff-juliacon/ArbFloats.jl#1 — |
It's good. Thanks for showing me where they are. I needed to go back through them since I just did a big update to make continuous output (interpolated dense function) part of the default, changed the pre-made problems to compile better (required for testing multithreading properly), switched the API from Yes, ArbFloats will still have an error since that package needs to add the no-op: float(x::ArbFloats) = x Once he adds that one line, it should work again (it previously wasn't calculating the errors. Now that it does, it needs the |
If you make it so that way it doesn't have to calculate the errors, i.e. don't give ODEProblem the analytical solution: using ArbFloats
const arbalpha = ArbFloat(1.01)
f = (t,u) -> (arbalpha*u)
analytic = (t,u₀) -> u₀*exp(arbalpha*t)
prob_ode_arbfloatlinear = ODEProblem(f,ArbFloat(1)/ArbFloat(2))
sol =solve(prob_ode_arbfloatlinear::ODEProblem,[0,1],Δt=1//2^(6),save_timeseries=true,alg=:RK4)
println(sol[end]); typeof(sol[end]) That should work. It's just that |
Since I am on GMT+1, I will make all the updates later today when the dust has settled. I will also reply to #47. From: Christopher Rackauckas [mailto:[email protected]] It's good. Thanks for showing me where they are. I needed to go back through them since I just did a big update to make continuous output (interpolated dense function) part of the default, changed the pre-made problems to compile better (required for testing multithreading properly), switched the API from (du,u,u) to (t,u,du). While internally that doesn't break much, that causes the definitions for the problems to have to change, which means just about every example breaks... Yes, ArbFloats will still have an error since that package needs to add the no-op: float(x::ArbFloats) = x Once he adds that one line, it should work again (it previously wasn't calculating the errors. Now that it does, it needs the float command). I put in a PR so all he has to do is say yes and it'll work. — |
The ArbFloats PR went through. It should work now. |
Yes, this is the outstanding issue. Do you agree with the following sequence: Pkg.rm(“Nemo”) PKg.rm(“ArbFloats”) Pkg.add(“Nemo) Insist with Pkg.add and Pks.checkout(“Nemo”) and Pkg.build(“Nemo”) even though the gfortran error may not disappear. Then Pkg. add(“ArbFloats”) or Pkg.clone(?) Pkg.update() Rerun the Solving….with Julia notebook From: Christopher Rackauckas [mailto:[email protected]] The ArbFloats PR went through. It should work now. — |
I do this:
(that master is in flux -- but the stuff I am changing, stuff about obtaining the radius, pbly does not matter to you) |
Oh wait, are there two ArbFloats.jl's? I meant to put that PR into the repo you get from Pkg.add. |
(Also, I thought ArbFloats were ArbReals with no radius?) |
I did that. On Wed, Sep 14, 2016 at 4:56 PM, Christopher Rackauckas <
|
... Give me 5min and I will clarify On Wed, Sep 14, 2016 at 4:58 PM, Christopher Rackauckas <
|
Better to restart from Nemo and ArbFloats removed twice. Also I am on Windows with mingw-w64 installed on the path From: Jeffrey Sarnoff [mailto:[email protected]] ... Give me 5min and I will clarify On Wed, Sep 14, 2016 at 4:58 PM, Christopher Rackauckas <
— |
@finmod yep |
the difference btwn ArbFloats ans ArbDecimals is (a) precision is in decimal digits rather than bits and (b) internal math is done at twice the working precision+a few (q.v. Professor Kahan). |
@finmod If you're on Windows with v0.5 I confirmed that Nemo won't build: wbhart/Nemo.jl#68. @JeffreySarnoff Oh, I didn't know those were still there. we might want to setup plot recipes for ArbFloats then so that we you get a shaded band for the interval, and a line in the middle. If ArbFloats and ArbDecimals has all of these, then what does the ArbReal add? |
Plot recipes yah! On Wed, Sep 14, 2016 at 5:13 PM, Christopher Rackauckas <
|
Okay. Thanks for the update. So in total: ArbFloats and ArbDecimals both act the same, except the precision for ArbFloats is the number of bits, while for ArbDecimals it's the number of accurate decimals? |
If ArbDecimals were done, yes. On Wed, Sep 14, 2016 at 5:59 PM, Christopher Rackauckas <
|
Is there a reason to have both ArbDecimals and ArbFloats, and not just one number type with two ways of setting its precision (or have it be a parametric type with a parameter for whether it's a decimal or float type)? What's gained by having them completely separate? |
It is important that they be separate. Think of ArbFloats as the machinery On Wed, Sep 14, 2016 at 6:16 PM, Christopher Rackauckas <
|
It would be clumsy to make ArbFloats be what ArbDecimals is to be, and then On Wed, Sep 14, 2016 at 6:19 PM, Jeffrey Sarnoff [email protected]
|
Got it. I understand now. |
ArbFloats is is more like BigFloats is. ArbDecimals is more like BigFloats On Wed, Sep 14, 2016 at 6:20 PM, Jeffrey Sarnoff [email protected]
|
@finmod I just checked, using the ArbFloats master will work again. An updated notebook shows the current state. |
no .. ArbFloats is the substrate, it is like BigFloat. ArbDecimals is a highly reliable layer atop ArbFloats .. it is like I would want BigFloat to be. |
On Windows nothing doing, ArbFloats does not compile (Bounds error) because Nemo does not compile (gfortran..). My set up is: new Julia, new Atome, set Julia path set mingw-x64 path. Should I set up on Ubuntu? I have 16.04 but the latest Julia is still 0.4 something and not 0.5 yet. This is the only notebook with errors, everything else runs fine. Perhaps I could wait until the dust settle on this notebook! From: Christopher Rackauckas [mailto:[email protected]] @finmod https://github.com/finmod I just checked, using the ArbFloats master will work again. An updated notebook shows the current state. — |
Well if you want to test it, you'll need to go to Linux until Nemo fixes the issue that it cannot install on Windows since libgit2 no longer exists in Julia's Windows binary (wbhart/Nemo.jl#68). I have tests showing it works, and @JeffreySarnoff has tests on his end that the conversions are good now, so I am sure that, in the right setup (which currently means Linux) this feature is available. Since it's an optional feature this isn't worrisome: ArbFloats are faster than BigFloats but you can always use BigFloats here. So I'm going to close this issue since what's left isn't on my end, it's a Nemo.jl issue. |
There is a long standing recurrent issue with Julia on Windows -- it works, If you want to do that -- let me know and I will talk you through it. -- Jeffrey On Thu, Sep 15, 2016 at 5:02 PM, finmod [email protected] wrote:
|
Hopefully when Julia switches over to the Windows 10 Linux subsystem (Ubuntu) it will use all of the standard compilers and therefore just work. It seems like that's the case (it builds fine, works fine), but needs a little bit more love to be "standard". |
@finmod meanwhile -- if you choose to go VirtualBox (dual boot gives you better performing Linux, but cut * paste from Win to Linux and back becomes a drag) ... |
This is correct lxss is fine from the computing side. Unfortunately, Jupyter/browser interaction is not supported right now. Just hope that this improves sometime soon. From: Christopher Rackauckas [mailto:[email protected]] Hopefully when Julia switches over to the Windows 10 Linux subsystem (Ubuntu) it will use all of the standard compilers and therefore just work. It seems like that's the case (it builds fine, works fine), but needs a little bit more love to be "standard". — |
This is available to me too and works fine for Anaconda python on Ubuntu 16.04. The problem with VirtualBox 5.1 is how to install Julia 0.5.0 on Ubuntu 16.04 (xenial). Is it needed? Finmod From: Jeffrey Sarnoff [mailto:[email protected]] There is a long standing recurrent issue with Julia on Windows -- it works, If you want to do that -- let me know and I will talk you through it. -- Jeffrey On Thu, Sep 15, 2016 at 5:02 PM, finmod <[email protected] mailto:[email protected] > wrote:
— |
I had no issues at all installing Julia v0.5-rc4 on LinuxMint v18 (which is built on top of Ubuntu 16.04) running on VirtualBox version 5.1.2 from Win7. I download the generic_linux_x64 julia |
Thank you for this accurate set up instructions for LinuxMint on VBox as an alternative to Canonical Ubuntu. I have implemented it and it works with the additional detail that “open an admin window” in LinuxMint is done using $ gksudo nemo And then cut and paste as advocated. Howver, I also noted all the similaries with standard setup with Canonical Ubuntu 16.04. The latter work also better for me with QHD display and touchscreen activated via VBoxGuestAdditions which did not work out as intuitively on LinuxMint. Reverting to Ubuntu on VBox, the gksudo nemo is not standard and it can be set up as follows: Sudo add-apt-repository ppa:webupd8team/nemo Sudo apt-get install install nemo nemo-fileroller Then $ gksudo nemo works as in LinuxMint On Ubuntu, the build of ArbFloats is a lengthy process with quite a few downloads that may be subject to errors. All in all. I still do not get Bingo! For ArbFloats. The error message is: LoadError: UndefVarError: initialize_arb not defined while loading In[6], in expression starting on line 6 in copy at /home/denis/.julia/v0.5/ArbFloats/src/basics/primitive.jl:37 [inlined] in #solve#559(::Array{Any,1}, ::Function, ::DifferentialEquations.ODEProblem{ArbFloats.ArbFloat{116},ArbFloats.ArbFloat{116}}, ::Array{Int64,1}) at /home/denis/.julia/v0.5/DifferentialEquations/src/ode/ode_solve.jl:56 in (::DifferentialEquations.#kw##solve)(::Array{Any,1}, ::DifferentialEquations.#solve, ::DifferentialEquations.ODEProblem{ArbFloats.ArbFloat{116},ArbFloats.ArbFloat{116}}, ::Array{Int64,1}) at ./:0 But we are 90% there, Nemo and ArbFloats build with no warnings or errors, packages update are also clean. From: Jeffrey Sarnoff [mailto:[email protected]] I had no issues at all installing Julia v0.5-rc4 on LinuxMint v18 (which is built on top of Ubuntu 16.04) running on VirtualBox version 5.1.2 from Win7. I download the generic_linux_x64 julia https://www.google.com/url?q=https%3A%2F%2Fs3.amazonaws.com%2Fjulialang%2Fbin%2Flinux%2Fx64%2F0.5%2Fjulia-0.5.0-rc4-linux-x86_64.tar.gz&sa=D&sntz=1&usg=AFQjCNHSKje1Ioz9eR1zQU3KvwJa3pU4xw — |
dunno much about the rest -- do know this
|
For ArbFloats:
INFO: Precompiling module ArbFloats...
ERROR: LoadError: LoadError: BoundsError: attempt to access 3-element Array{String,1} at index [0]
in library_filepath(::String, ::Array{String,1}, ::String) at C:\Users\Denis.julia\v0.5\ArbFloats\src\support\NemoLibs.jl:15
in include_from_node1(::String) at .\loading.jl:426 (repeats 2 times)
in macro expansion; at .\none:2 [inlined]
in anonymous at .:?
in eval(::Module, ::Any) at .\boot.jl:234
in process_options(::Base.JLOptions) at .\client.jl:239
in _start() at .\client.jl:318
while loading C:\Users\Denis.julia\v0.5\ArbFloats\src\support/NemoLibs.jl, in expression starting on line 23
while loading C:\Users\Denis.julia\v0.5\ArbFloats\src\ArbFloats.jl, in expression starting on line 70
LoadError: Failed to precompile ArbFloats to C:\Users\Denis.julia\lib\v0.5\ArbFloats.ji
while loading In[11], in expression starting on line 1
in compilecache(::String) at .\loading.jl:505
in require(::Symbol) at .\loading.jl:364
For DecFP:
LoadError: LoadError: error compiling _parse: could not load library "C:\Users\Denis.julia\v0.5\DecFP\src..\deps\libbid64"
The specified module could not be found.
while loading C:\Users\Denis.julia\v0.5\DecFP\src\DecFP.jl, in expression starting on line 63
while loading In[13], in expression starting on line 1
in macro expansion; at C:\Users\Denis.julia\v0.5\DecFP\src\DecFP.jl:78 [inlined]
in anonymous at .:?
in include_from_node1(::String) at .\loading.jl:426
in eval(::Module, ::Any) at .\boot.jl:234
in require(::Symbol) at .\loading.jl:357
For Decimals:
LoadError: TypeError: ODEProblem: in uEltype, expected uEltype<:Number, got Type{Decimals.Decimal}
while loading In[15], in expression starting on line 2
in #ODEProblem#235(::Function, ::Type{T}, ::Function, ::Array{Decimals.Decimal,1}) at C:\Users\Denis.julia\v0.5\DifferentialEquations\src\general\problems.jl:408
in (::Core.#kw#Type)(::Array{Any,1}, ::Type{DifferentialEquations.ODEProblem}, ::Function, ::Array{Decimals.Decimal,1}) at .:0
For DoubleDouble:
LoadError: MethodError: Cannot
convert
an object of type Rational{Int64} to an object of type DoubleDouble.Double{Float64}This may have arisen from a call to the constructor DoubleDouble.Double{Float64}(...),
since type constructors fall back to convert methods.
while loading In[16], in expression starting on line 3
in #solve#559(::Array{Any,1}, ::Function, ::DifferentialEquations.ODEProblem{DoubleDouble.Double{Float64},DoubleDouble.Double{Float64}}, ::Array{Int64,1}) at C:\Users\Denis.julia\v0.5\DifferentialEquations\src\ode\ode_solve.jl:173
in (::DifferentialEquations.#kw##solve)(::Array{Any,1}, ::DifferentialEquations.#solve, ::DifferentialEquations.ODEProblem{DoubleDouble.Double{Float64},DoubleDouble.Double{Float64}}, ::Array{Int64,1}) at .:0
The text was updated successfully, but these errors were encountered: