Hi all, I am newly fresh in learning Fortran for Mathematics purpose, I was learning Julia this one year then read the wikipedia :
It is still used for science and engineering, so I am interested to use Fortran for science. In Julia or Python there is a package called SymPy to calculate symbolic integration. I currently learning this integration by parts in calculus and want to know is Fortran able to compute the solution of this:
I read few topics already and saw this, but have no idea how to use this.
I use GNU compiler GCC 11.2.0, able to execute simple average program from the wikipedia pageâŠ
Cecil E. Leith called FORTRAN the âmother tongue of scientific computingâ, adding that its replacement by any other possible language âmay remain a forlorn hopeâ
I have just discovered that @certik , who is very active on this forum, was at the origin of Sympy, and that he also started the github project on Symengine. So he will surely be able to give you pertinent informations.
I contribute to the maxima computer algebra package. I am not aware of any significant general purpose symbolic integration routines in Fortran. Much of the early work in the area - in the period when Fortran was dominant - used lisp.
The wikipedia article List of computer algebra systems will lead you to further information, including the language(s) the systems are written in.
I should add that the recurrence relation for the integral only terminates if α is a positive integer. In the general case you need to evaluate the integral numerically. There are a large number of subroutine libraries for this class of problem, as the algorithm of choice is problem dependent.
Yes, I am the original author of SymPy and SymEngine. I wrote the initial Fortran wrappers to SymEngine, but donât have time currently to make them feature complete. If you, or anybody else, wants to help out, that would be great. I think SymEngine currently cannot do integration, for that you have to use SymPy for now.
I want to help out the SymEngine, but I am just beginning to learn Fortran. Where do I start? (on SymPy, I already have a year of using it in both Julia and Python)
@FreyaGoddess awesome. You can learn Fortran and then help us figure out a good interface to SymEngine and SymPy. I can see here SymPy · Julia Packages that itâs quite easy to use SymPy from Julia, the same for symengine SymEngine · Julia Packages. Are you hoping to use SymPy and SymEngine in a similar way from Fortran?
Yes it is very easy to use SymPy in Julia, and I want to know the technical coding behind it, not just few codes, it takes longer to write FORTRAN codes but I think it will be worth more than write less codes.
In Julia, to get an implicit differentiation is like this :
using SymPy
@syms x, y, u()
ex = y/(exp(0.1*x^2))
ex1 = ex(y => u(x))
# we differentiate both sides in x:
ex2 = diff(ex1, x)
# solve for dy/dx
dydx = diff(u(x), x)
ex3 = solve(ex2, dydx)[1] # pull out lone answer with [1] indexing
# As this represents an answer in terms of u(x),
# we replace that term with the original variable:
dydxâ = ex3(u(x) => y)
If it takes longer for FORTRAN to write the similar code that resulting the same answer, it will be fine by me as long as I can comprehend.
I am on half way learning Calculus from Purcell textbook, and have a Fortran book written by Chapman. I can run a single Fortran file currently like gfortran -o example example.f90, I havenât arrive at the stage how to link it with other Fortran code, combine with C, use CMake as well. I know I still have to learn and improve more. I used MATLAB, but Julia can easily replaced all that MATLAB can do, thus I uninstall MATLAB.
We can prolly also take inspiration from Wolfram Mathematica or Maple. Those are the two commercial suites that Iâve used in the past, thanks to licenses paid by my university back then.