Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Patrick Scheibe
    @halirutan
    That has several advantages and also some disadvantages. One advantage is that you can rewrite the pattern-matching code to if statements that work better with other languages because Mathematica is strong in pattern-matching and it is hard to replicate the behavior in e.g. python. The different behavior of MatchPy in python is actually the reason why Rubi cannot work successfully under sympy right now.
    Another advantage is that walking the if tree is faster. Right now, Mathematica tests all Rubi rules and applies the first one that matches. So in the worst case, you need to sequentially check all 6600+ rules. This is similar for finding a match in a long list. In the decision tree this is faster, because you start by e.g. finding the general class of the integrand which is probably only <50 tests. Then you test the conditions on the parameters.. That should reduce the run-time.
    Patrick Scheibe
    @halirutan
    One disadvantage is that it is a lot of work to transform Rubi's rules into this decision-tree and code of the many nested if statements is harder to read.
    Albert D. Rich
    @AlbertRich
    @CeaVi @halirutan Everything Patrick said about Rubi 5 vs. Rubi 4 is right on. Preliminary testing indicates Rubi 5 will run more than an order of magnitude faster than either Rubi 4 or Mathematica's built-in integrator.
    I am currently manually compiling Rubi 4's pattern matching rules into an if-then-else based decision tree for Rubi 5. I recently compiled the rules for integrands of the form (a+bx+cx^2)^p in the notebook file "1.2.1.1 (a+b x+c x^2)^p.nb".
    CeaVi
    @CeaVi
    @AlbertRich @halirutan this looks like a Trie datastructure (in Knuth's naming), am I reading this correct? ("Discrimination net" as Krebber called it in his thesis on MatchPy .. other flavours with slightly different naming have been published, too)
    @AlbertRich Do you compile those if-then-else trees manually from the patterns?
    CeaVi
    @CeaVi
    @AlbertRich thank you, I can access the files
    CeaVi
    @CeaVi
    @AlbertRich @halirutan Do you want to keep this manual compilation process long-term, or is this just an intermediate step before some automatic compilation ("Trie-builder", "DFA Compiler", ...) is established?
    Albert D. Rich
    @AlbertRich
    @CeaVi I would dearly love for someone to automate the tedious, error-prone compilation of pattern matching rules into if-then-else code.
    Albert D. Rich
    @AlbertRich
    As you can see by comparing the Rubi 4 and 5 files, they are nearly isomorphic. Also Rubi 4's pattern matching rules use only a small subset of Mathematica's control constructs making the compilation much easier, but certainly not trivial.
    Albert D. Rich
    @AlbertRich
    A compiler capable of transforming Rubi 4's pattern matching rules into an if-then-else decision tree (aka a discrimination net) would
    • allow the Rubi source to remain in elegant, human-readable form, rather than a monolithic if-then-else tree virtually impossible to comprehend and debug,
    • make it relatively easy for others to port Rubi to any commercial or free CAS, since all serious systems support an if-then-else control construct, and
    • (most important to me) allow me to devote full time to extending Rubi's mathematical capabilities. :wink:
    betatron
    @betatron_gitlab
    Hi
    I have difficulties to calculate the integral below
    Assuming[{0 < z < 1},
    Integrate[
    Assuming[{0 < z < 1}, Integrate[ g^2 ArcTanh[Sqrt[1 - 1/g^2]/R] Exp[-z g], {g, 1, Infinity}]]
    betatron
    @betatron_gitlab
    can one help me please?
    Patrick Scheibe
    @halirutan
    @betatron_gitlab I don't see much hope here. You can use Rubi and try
    Int[g^2 ArcTanh[Sqrt[1 - 1/g^2]/R] Exp[-z g], g]
    Then, you will find that there are several parts that Rubi can't solve. One of them is fairly simple but an antiderivative cannot be computed:
    Int[1/(E^(g*z)*Sqrt[1 - g^2]), g]
    Even if you remove the z from the expression, Rubi and Mathematica cannot find a closed form of the antiderivative.
    betatron
    @betatron_gitlab
    I do not have Rubi. Please, can you do it for me?
    Patrick Scheibe
    @halirutan
    @betatron_gitlab (a) I already tried it for you and showed you that even with Rubi it seems not possible (b) Rubi is free and you can simply install and use it yourself.
    betatron
    @betatron_gitlab
    Ok. Thank you Sir. Please, how to instal it on My mathematica?
    Patrick Scheibe
    @halirutan
    @betatron_gitlab What Mathematica version do you have?
    betatron
    @betatron_gitlab
    11.2
    Patrick Scheibe
    @halirutan
    See here:
    betatron
    @betatron_gitlab
    Thank you.
    Patrick Scheibe
    @halirutan
    No problem
    betatron
    @betatron_gitlab
    Please, what is the utility of Rubi for a physicist?
    Patrick Scheibe
    @halirutan
    @betatron_gitlab Rubi is a package for calculating the symbolic antiderivatives of expressions. So if you have an expression that cannot be integrated with Mathematica, often but not always Rubi can do it. However, like in your case, where it is not possible, you will most likely need to use numeric integration.
    betatron
    @betatron_gitlab
    thank's
    well
    Nasser M. Abbasi
    @nasser1
    @betatron_gitlab "Please, what is the utility of Rubi for a physicist?" There is a Physics paper using Rubi https://arxiv.org/pdf/1811.04892.pdf titled "An Application of Rubi: Series Expansion of the Quark Mass
    Renormalization Group Equation"
    Patrick Scheibe
    @halirutan
    @nasser1 Ahh, yes. How could I forget that. This paper is the sole reason why we wrote the Rubi paper to make Rubi officially citable.
    Thanks Nasser.
    betatron
    @betatron_gitlab
    Thank you
    Tobias Bouma
    @Tobiasbouma_twitter
    Hello everybody!
    I'm having trouble looking up a reference for a RUBI rule
    The rule (rules actually) are 2485 and 2490. Where can I look this up?
    Tobias Bouma
    @Tobiasbouma_twitter
    I have found something on page 36 of 3.3 u (a+b log(c (d+e x)^n))^p. Cheers nonetheless!
    Patrick Scheibe
    @halirutan
    @AlbertRich Someone sent me this comparison, where a change from + to - makes all the difference between Rubi can and cannot integrate it.
    integrals.png
    Do you thing you can do something about this?
    Albert D. Rich
    @AlbertRich

    @halirutan Thanks for pointing out this pattern matching problem. Rubi can integrate

    (2 - 5*x^3)/(Sqrt[1 - x^3]*(1 + x^2*(1 - x^3)))

    but not the equivalent expanded form

    (2 - 5*x^3)/(Sqrt[1 - x^3]*(1 + x^2 - x^5))

    I will add it to Rubi's deficiency list.

    Patrick Scheibe
    @halirutan
    @AlbertRich Thanks
    Albert D. Rich
    @AlbertRich
    @halirutan You're welcome. As I pointed out in my response to Rubi Issue 11 and 14, it is quite easy using differentiation to generate integration problems that any symbolic integrator, including Rubi, cannot get.
    Note that for both forms of the above integrals, Mathematica 11.3 returns a multipage "wall paper" result. Maple 2018 returns the integral unevaluated.