Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Miguel Raz Guzmán Macedo
    @miguelraz
    Hello @AlbertRich , hope all is well.
    Any idea how much the coverage of the RUBI test suite has improved in vanilla Mathematica?
    Albert D. Rich
    @AlbertRich

    @miguelraz Thanks Miguel for your well wishes.

    I imagine @nasser1 will soon let us know how Mathematica 13 does on the integration test-suite.

    Miguel Raz Guzmán Macedo
    @miguelraz
    Sweet. @nasser1 : can the integration test suite print in such a way so that the timings and results can be read in a tabular data format?
    Perhaps my last dive missed something but it I wanted to aggregate the results and couldn’t do so easily.
    Nasser M. Abbasi
    @nasser1

    @miguelraz There are two phases to CAS integrations. The first phase run each CAS and generates a plain text file for each CAS per each test. There are 208 tests. And there are 8 CAS systems. Second phase reads these plain text files (TABLES) and generates the PDF and web pages.

    I can make the TABLEs available. There is ONE line per one integral result. It is comma delimited. It is described here https://12000.org/my_notes/CAS_integration_tests/reports/summer_2021/inch1.htm#x2-150001.9 Here is a link to one such TABLE. This was for Rubi result for the Timofeev test file. The TABLE contains everything. Timing, results, Latex, input, pass/fail, code of fail, etc... as described in the above link. Here is TABLE file mentioned above, https://12000.org/tmp/CAS_integration_RESULT_file_example/rubi_listA.txt If this works for you, I can makes all these in one large zip file. but will take me little time to do.

    Miguel Raz Guzmán Macedo
    @miguelraz
    @nasser1 Thanks a lot for your response! Truly great work.
    One large zip file would be ideal, yes
    Nasser M. Abbasi
    @nasser1
    @miguelraz I've put the ZIP file link at the main web page for CAS integration test https://12000.org/my_notes/CAS_integration_tests/reports/summer_2021/index.htm The tree structure is the same as in Rubi original tests tree. You'll find the TABLES under each folder there. one plain text TABLE per each CAS per each test folder. It is about 90 MB in size. Hope this helps.
    Miguel Raz Guzmán Macedo
    @miguelraz
    Awesome - I will share results with due credit.
    Anixx
    @Anixx
    It seems, Mathematica 13 now gives the same results as Rubi.
    Rubis is obsolete?
    Nasser M. Abbasi
    @nasser1
    @Anixx The current CAS integration test uses Mathematica 12.3 and not 13.0. The versions are listed here https://12000.org/my_notes/CAS_integration_tests/reports/summer_2021/inch1.htm. The ZIP file of the TABLES mentioned above is the result of those tests. No tests were yet run using version 13 of Mathematica, so do not know how it will do on Rubi's tests suite. What is meant by the tree structure of the TABLES is the same as Rubi's just refers to the the folder layout of the ZIP file.
    Anixx
    @Anixx
    @nasser1 at least, the examples given in the Rubi intro as those that Rubi can solve and Mathematica cannot, now can be solved by M13 with absolutely the same results as Rubi does.
    Nasser M. Abbasi
    @nasser1
    @Anixx Could you provide a link to this document called "Rubi intro" that you mention in your post above?
    Albert D. Rich
    @AlbertRich

    @Anixx The 3-year old Wolfram Community article "Rubi - The Rule-based Integrator for Mathematica" you reference gives just one example integral on which Mathematica 11.3 is inferior to that returned by Rubi.

    Before you say "Mathematica 13 now gives the same results as Rubi" you need to wait and see how Mma 13 performs on the rest of the 1000's of problems in the integration test-suite Nasser uses.

    Anixx
    @Anixx
    @AlbertRich well, I looked through integrals in his post here: https://mathematica.stackexchange.com/questions/169209/some-indefinite-integrals-evaluate-in-11-2-but-not-in-11-3-what-can-be-done and particularly, the answer by gvr https://mathematica.stackexchange.com/a/169285/651 which gives other examples of Rubi superiority. Now Mathematica gives the same answers as Rubi on all of them.
    Albert D. Rich
    @AlbertRich
    @Anixx I glad to see Wolfram Research is making an effort to catch up with Rubi when deficiencies are pointed out.
    edmontz
    @edmontz
    Two questions, for Albert.
    edmontz
    @edmontz
    Do you ever wonder why yours is mostly a solo endeavor, I certainly do; especially considering the potential importance of the RUBI approach. Having browsed some code for RUBI 5, and being aware of sympy with a convoluted implementation of RUBI 4.x.x; might RUBI 5 be implemented more readily in python, and in such a way that the user is able to comprehend the code and easily build upon the existing rules. I suppose what I'm asking for are python equivalents for expressions such as; Int[(a./x)^p_,x_Symbol] :=
    -a*(a/x)^(p-1)/(p-1) /;
    FreeQ[{a,p},x] && Not[IntegerQ[p]]
    Albert D. Rich
    @AlbertRich
    @edmontz Yes, I've wondered about that a lot. Rubi's source code provides the mathematical knowledge required to implement a powerful symbolic integrator in virtually any CAS. I heartily encourage CAS implementors to translate that knowledge into code no matter what language their system is written in.
    Nasser M. Abbasi
    @nasser1
       Int[(a_./x)^p_,x_Symbol] :=-a*(a/x)^(p-1)/(p-1) /;FreeQ[{a,p},x] && Not[IntegerQ[p]]

    The above gives an integration rule. It says for an integrand of the form (symbol/x)^p its anti derivative is what it shows on the RHS. The stuff after /; gives conditions on arguments for this to apply.

    It says this rule applies when p is NOT an integer and when a and p are free of the integration variable x. The small DOT next to a is to allow 1 there. For example if you type the above, now you can do Int[(1/x)^(1/3),x] and it will return 3/(2 (1/x)^(2/3)) but if you have typed Int[(1/x)^3,x] then it will not have matched the rule, since p is an integer here. You can also type Int[(n/x)^(1/3),x] and it will return (3 n)/(2 (n/x)^(2/3)). And if you type Int[(1/x)^(x/3),x] then it will not match, so the rule will not be applied, since p now has x in it. So it is NOT free of x.

    To translate all this to Python, one would need to know Mathematica pattern matching and know Python pretty well also. As for how to do this in Python, that will be a question for the Python forum.

    Axel Kramer
    @axkr
    @edmontz We've implemented a pattern-matcher in Java which uses the Rubi rules in translated internal form:
    https://github.com/axkr/symja_android_library/tree/master/symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/integrate/rubi
    but of course there are many JUnit tests in the test case suite:
    https://github.com/axkr/symja_android_library/tree/master/symja_android_library/matheclipse-io/src/test/java/org/matheclipse/core/rubi
    which fail because of bugs/subtle differences which occur in the matcher and the Simplify, PossibleZeroQ implementation...
    tringocao
    @tringocao
    I just start with Rubi, I have read the intro's Rubi already but I don't know how to use Rubi with sympy, somebody can help me, pls?
    Anixx
    @Anixx
    Hello, guys! I am currently working on a Mathematica package that would allow to manipulate divergent integrals. Particularly, I plan the following functions: DivergentMultiply - multiplication of two divergent integrals, producing a new one, DivergentMultiplyUmbral - umbral multiplication, Divergent Integrate - evaluation of divergent integrals in terms of DiracDelta, DeltaToIntegrals - representing an expression of Dela functions as divergent integrals, ListEquivalents - list divergent integrals equal to the given one via Laplace transform (or maybe NextEquivalent and PrevEquivalent), Regularize - give the regularized value of a divergent integral, maybe UmbralFunction - apply a given analytic function to a divergent integral based on umbral multiplication. There is also a plan for a third kind of multiplication. What do you think? I need some help with advice. I already have some progress: have working DivergentMultiply and Regularize functions, UmbralMultiply is also working in part of cases, PrevEquivalent and NextEquivalent are also mostly functional.
    Nasser M. Abbasi
    @nasser1

    How to find number of Rules in Rubi? I am using 14.6.1.

    Is there a command that returns this number? my loop now goes up to 6874 with no problem. But this is trial and error. I'd like to know before the loop starts exactly the number of rules.

    Thanks.

    Nasser M. Abbasi
    @nasser1
    opps typo above, I meant using Rubi version 4.16.1 and not 14.6.1
    Albert D. Rich
    @AlbertRich
    @nasser1 The Mathematica command Length[DownValues[Int]] returns 6881 Int rules for Rubi 4.16.1.
    Nasser M. Abbasi
    @nasser1

    @AlbertRich Thanks. That works. Do you know why when I print the rules using the following, it shows always as Removed[Int] in there and not just Int? Here is an example

    $LoadShowSteps = False;
     << Rubi`
     BeginPackage["Rubi`"];
     Begin["`Private`"];
     Do[
         Print[InputForm[DownValues[Int][[n]]]]
        ,
         {n, 1, 1}(*Length[DownValues[Int]]}*)
      ]

    Which gives

    HoldPattern[Removed["Int"][(u_.)*((a_) + (b_.)*(x_)^(n_.))^(p_.), x_Symbol]] :> Removed["Int"][u*(b*x^n)^p, x] /; FreeQ[{a, b, n, p}, x] && EqQ[a, 0]

    Now I remove this as follows

      BeginPackage["Rubi`"];
      Begin["`Private`"];
      Do[
          res = InputForm[DownValues[Int][[n]]];
          res = ToString[ReleaseHold[res]];
          res = StringReplace[res, "Defer[Removed[\"Int\"]]" -> "Int"];
          res = StringReplace[res, "Removed[\"Int\"]" -> "Int"];
          Print[res]
           ,
            {n, 1, 1}(*Length[DownValues[Int]]}*)
           ]

    Which gives

    Int[(u_.)*((a_) + (b_.)*(x_)^(n_.))^(p_.), x_Symbol] :> Int[u*(b*x^n)^p, x] /; FreeQ[{a, b, n, p}, x] && EqQ[a, 0]

    Starting from clean Kernel did not help. The Removed[Int] is always there. It is not big deal as I can remove it, this is for just printing the rules, but I wondered why it happens.

    tringocao
    @tringocao
    image.png
    Why WildCards have option S(1)? Can you help me to explain that?
    Anixx
    @Anixx
    I would be glad if anyone commented on my work, particularly, the code that allows to multiply divergent integrals. Here is my post with a Mathematica code, it is like a calculator that allows to multiply two divergent integrals: https://mathoverflow.net/q/421354/10059
    edmontz
    @edmontz
    Int[Sin[Sin[a*x]],x] appears to be beyond any CAS I've encountered thus far. Is this type of function beyond integration. Maybe related to a
    Bessel function.
    Nasser M. Abbasi
    @nasser1
    AAA.png

    You can't get closed form antiderivative. You could find approximate series solution.

       (a x^2)/2 - (a^3 x^4)/12 + (a^5 x^6)/60 - (a^7 x^8)/315 + (
       13 a^9 x^10)/25200 - (47 a^11 x^12)/598752 + (
      15481 a^13 x^14)/1362160800 - (3947 a^15 x^16)/2554051500 + (
      451939 a^17 x^18)/2273570208000 - (
      23252857 a^19 x^20)/950352346944000 + (
      186846623 a^21 x^22)/64568056512960000 - (
      831520891 a^23 x^24)/2524611009656736000 + (
      1108990801 a^25 x^26)/30644204599008000000 - (
      143356511198507 a^27 x^28)/37217815504359602112000000 + (
      920716137922619 a^29 x^30)/2312821392056632416960000000 + 
      C[1]

    Here is a plot comparing the derivative of the above antiderivative above with the integrand showing good agreement. More terms gives better agreemeent.

       ode = y'[x] == Sin[Sin[a*x]];
       antiderivative = AsymptoticDSolveValue[ode, y[x], {x, 0, 30}]
       Plot[Evaluate[{Sin[Sin[a*x]], D[antiderivative, x]} /. a -> 1], {x, -3, 3}]
    edmontz
    @edmontz
    I tried something different, I attempted an adaptive method to find the principle components from a sample that I applied an fft to. Initially just two peaks appeared to be relevant, more iterations showed otherwise.
    So time to investigate your approach.
    edmontz
    @edmontz
    I did manage to run all of the RUBI test suites, this took about a day; I did wonder if this might be sped up with a GPU. It required about a days worth of CPU time, I just let run in the background while I continued with all of the usual computer related tasks.
    edmontz
    @edmontz
    Then, with the RUBI package loaded I attempted to solve some demanding nonlinear, second order differential equations; thinking that with RUBI the process is much more proficient . This didn't appear to be the instance. Perhaps RUBI isn't completely incorporated into Mathematica calculus routines yet.
    edmontz
    @edmontz
    Okay, I just tried your method, for a particular domain this gives the appearance of a good fit; outside of that it becomes asymptotically inaccurate. The formula for a geometric sequence, as found in math tables, sometimes returns a closed form representation.
    Albert D. Rich
    @AlbertRich

    The following Issue was recently posted on the Rubi's GitHub repository:

    • With the last public update to this repo being over a year ago, it would be great to hear if this is still actively being worked on 🙂.

    I posted the following response:

    • Yes, Rubi 4 is currently undergoing a major redesign that will significantly expand the class of mathematical expressions it can integrate, produce simpler antiderivatives, and provide more elegant derivations. Also it is necessary to perfect Rubi 4 before compiling its pattern matching rules into an if-then-else decision tree for the next release of Rubi.

    • I'm working fulltime on what has turned out to be a massive project. It's driven by my figuring out the math required to integrate expressions symbolically. I will release a new version of Rubi 4 as-soon-as it's perfected to my satisfaction. But it's impossible to predict when that will be, given the creative nature of this open-ended work.

    Albert