Ask Your Question

Revision history [back]

val_test is a Python list containing a single symbolic expression:

sage: val_test
[y(x) == _K1*bessel_J(2, -2*sqrt(3)*x) + _K2*bessel_Y(2, -2*sqrt(3)*x)]

If you want to access this expression, you can do:

sage: val_test[0]
y(x) == _K1*bessel_J(2, -2*sqrt(3)*x) + _K2*bessel_Y(2, -2*sqrt(3)*x)

If you want to get its right hand side, you can do:

sage: val_test[0].right_hand_side()
_K1*bessel_J(2, -2*sqrt(3)*x) + _K2*bessel_Y(2, -2*sqrt(3)*x)

If you want to evaluate it at x=4, you can do:

sage: val_test[0].right_hand_side().substitute(x=4)
_K1*bessel_J(2, -8*sqrt(3)) + _K2*bessel_Y(2, -8*sqrt(3))

But note that K1 and K2 should be probably defined first, by the initial conditions of your ODE.