我试图将V(\ phi)绘制为\ phi的函数,但是此错误阻止了我。我在做什么错了?
from sympy import symbols
from sympy.plotting import plot as symplot
from sympy import varfrom sympy import plot_implicit, Eq
V_phi, phi, lamb, mu = symbols(r'V \phi \lambda \mu')
V_phi = mu*phi**2 + lamb*phi**4
symplot(Eq(V_phi),(phi,-100,100))
错误:
ValueError Traceback (most recent call last)
<ipython-input-26-a4e0c44827e2> in <module>
----> 1 symplot(Eq(V_phi),(phi,-100,100))
~/Anaconda3/envs/Py37/lib/python3.7/sitepackages/sympy/plotting/plot.py in plot(*args, **kwargs)
1351 if len(free) > 1:
1352 raise ValueError(
-> 1353 'The same variable should be used in all '
1354 'univariate expressions being plotted.')
1355 x = free.pop() if free else Symbol('x')
ValueError: The same variable should be used in all univariate expressions being plotted.