Fortran for Symbolic Integration

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.

1 Like