I attempted to solve this differential equation by adapting the code found here.
import sympy as sp
t = sp.symbols('t', real=True)
x = sp.Function('x', real=True)
diffeq = sp.Eq(x(t).diff(t), sp.sqrt(1 - x(t)**2))
res = sp.dsolve(diffeq, ics={x(0): 0})
The math.se post suggests that a piecewise function satisfies the equation, but perhaps my code does not add all the necessary assumptions. I get the following traceback:
Traceback (most recent call last):
File "/usr/lib/python3.10/idlelib/run.py", line 578, in runcode
exec(code, self.locals)
File "/home/galen/testing.py", line 7, in <module>
res = sp.dsolve(diffeq, ics={x(0): 0})
File "/usr/lib/python3/dist-packages/sympy/solvers/ode/ode.py", line 639, in dsolve
return _helper_simplify(eq, hint, hints, simplify, ics=ics)
File "/usr/lib/python3/dist-packages/sympy/solvers/ode/ode.py", line 694, in _helper_simplify
solved_constants = solve_ics([rv], [r['func']], cons(rv), ics)
File "/usr/lib/python3/dist-packages/sympy/solvers/ode/ode.py", line 808, in solve_ics
raise NotImplementedError("Initial conditions produced too many solutions for constants")
NotImplementedError: Initial conditions produced too many solutions for constants
How do I change my code to correctly solve the ODE?