Giter VIP home page Giter VIP logo

Comments (17)

lbenet avatar lbenet commented on August 16, 2024

Which version (of Julia and the package) are you using?

from taylorintegration.jl.

PPorras avatar PPorras commented on August 16, 2024

I am using the 1.0.3 version of Julia and the 0.4.1 version of TaylorIntegration.

from taylorintegration.jl.

lbenet avatar lbenet commented on August 16, 2024

What about TaylorSeries.jl? I am trying to have the same set up as you have to see if I can reproduce the problem.

from taylorintegration.jl.

lbenet avatar lbenet commented on August 16, 2024

Note that the documentation was created with Julia v1.0, which I guess corresponds to Julia v1.0.3, and there was no problem...

from taylorintegration.jl.

lbenet avatar lbenet commented on August 16, 2024

So, I've checked it again and I can't reproduce the problem. Everything runs fine for me using Julia 1.0.3, TaylorIntegration v0.4.1, and TaylorSeries v0.8.0. I haven't checked it, but everything should also run without any problem for more recent versions of TaylorSeries.

from taylorintegration.jl.

PPorras avatar PPorras commented on August 16, 2024

I'm sorry, I realized I wasn't completely clear about my issue. I got the error from this part of the code:

using TaylorIntegration

for i in 1:nconds
    rand1 = rand()
    rand2 = rand()
    x_ini .= x0 .+ 0.005 .* [0.0, sqrt(rand1)*cos(2pi*rand2), 0.0, sqrt(rand1)*sin(2pi*rand2)]
    px!(x_ini, E0)

    tv_i, xv_i, tvS_i, xvS_i, gvS_i = taylorinteg(henonheiles!, g, x_ini, 0.0, 135.0,
        25, 1e-25, maxsteps=30000);
    tvSv[i] = vcat(0.0, tvS_i)
    xvSv[i] = vcat(transpose(x_ini), xvS_i)
    gvSv[i] = vcat(0.0, gvS_i)
end

However, it seems that the real problem is the definition of the function:

function g(t, x, dx)
    px = constant_term(x[3])
    
    if px > zero(px)
        # ...return x
        return x[1]
    else
        #otherwise, discard the crossing
        return nothing
    end
end

If I change g(t,x,dx)for

g(t, x, dx)=x[1]

The program works

from taylorintegration.jl.

lbenet avatar lbenet commented on August 16, 2024

I actually checked if I could reproduce the documentation (step by step, copy-pasting what it is written), and I had no problem. That's the reason I gave all the details of the packages that I used. Yet, I know that the definition of g is kind of subtle.

@PerezHz Do you have an idea what is going on here?

from taylorintegration.jl.

PerezHz avatar PerezHz commented on August 16, 2024

Sorry for the late reply... I also was unable to reproduce the problem; it would seem as if the version is lower than 0.4.0, since it can't find a method of surfacecrossing which was introduced in 0.4.0 (specifically, those methods were added in #62), are you completely sure your installed version of TaylorIntegration is 0.4.1? Could you please post the output in the REPL of using Pkg; Pkg.status()?

from taylorintegration.jl.

PPorras avatar PPorras commented on August 16, 2024

Yes, of course!

Status `~/.julia/environments/v1.0/Project.toml`
  [6e4b80f9] BenchmarkTools v0.4.1
  [7073ff75] IJulia v1.15.2
  [b964fa9f] LaTeXStrings v1.0.3
  [429524aa] Optim v0.18.1
  [58dd65bb] Plotly v0.2.0
  [91a5bcdd] Plots v0.22.5
  [438e738f] PyCall v1.18.5
  [d330b81b] PyPlot v2.7.0
  [92b13dbe] TaylorIntegration v0.4.1+ [`~/.julia/dev/TaylorIntegration`]
  [6aa5eb33] TaylorSeries v0.9.2

from taylorintegration.jl.

lbenet avatar lbenet commented on August 16, 2024

I can't recognize the commit you are in in TaylorIntegration, [92b13dbe]. Can you confirm that commit or where did it diverge from master?

from taylorintegration.jl.

PerezHz avatar PerezHz commented on August 16, 2024

I think [92b13dbe] refers to TaylorIntegration's UUID; but still, yes, it looks as if the local used version of TaylorIntegration is not exactly v0.4.1... Since the output of status looks like you have dev'd TaylorIntegration, have you tried doing git checkout v0.4.1 in the dir ~/.julia/dev/TaylorIntegration and then checking if the problem disappears?

from taylorintegration.jl.

lbenet avatar lbenet commented on August 16, 2024

You are right, @PerezHz, it does refers to the uuid.

from taylorintegration.jl.

PPorras avatar PPorras commented on August 16, 2024

Oh, thank you very much.

When I tried git checkout v0.4.1, I got error: pathspec 'v0.4.1' did not match any file(s) known to git..
So, I pulled from ~/.julia/dev/TaylorIntegration and then I tried doing git checkout v0.4.1 and it worked.

However, I don´t know if the pull was the best option.

from taylorintegration.jl.

PerezHz avatar PerezHz commented on August 16, 2024

So, I pulled from ~/.julia/dev/TaylorIntegration and then I tried doing git checkout v0.4.1 and it worked.

So, just to confirm: has the original issue been solved?

However, I don´t know if the pull was the best option.

If you keep TaylorIntegration dev'd then probably you will have to update the versions manually as you just did; but if you don't expect to do many fine-tweakings to TaylorIntegration, then perhaps the best option is to remove TaylorIntegration from your Julia environment and reinstall via using Pkg; Pkg.add("TaylorIntegration") so that you use registered versions and then updating to new releases doing e.g. using Pkg; Pkg.update("TaylorIntegration")

from taylorintegration.jl.

lbenet avatar lbenet commented on August 16, 2024

Another way is woth Pkg.free:

(v1.1) pkg> ?free
  free pkg[=uuid] ...

  Free a pinned package pkg, which allows it to be upgraded or downgraded
  again. If the package is checked out (see help develop) then this command
  makes the package no longer being checked out.

from taylorintegration.jl.

PPorras avatar PPorras commented on August 16, 2024

So, just to confirm: has the original issue been solved?

Yes, It has been solved.

@lbenet and @PerezHz, thank you for your help.

from taylorintegration.jl.

lbenet avatar lbenet commented on August 16, 2024

Then I close this issue.

from taylorintegration.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.