I am trying to use sympy to solve a second order ODE. When I run the code below, I get the error: 'f' object is not callable. T don't understand what that means. When I delete the initial conditions from dsolve line, the code works. But when I include it, the error appears. Any help will be greatly appreciated. I am a newby to Python.
from sympy import*
from sympy.solvers import dsolve
import sympy as sp
from pylab import*
import matplotlib.pyplot as plt
x = symbols('x')
f = Function("f")(x)
gamma = 0.01
ode1 = gamma*f.diff(x,2)+4*x
sol1 = dsolve(ode1, f, ics={f(x): 0, sp.diff(f, x).subs(x,0): 1})
print(ode1, sol1)
