Using Sympy Equations for Plotting

后端 未结 2 1315
眼角桃花
眼角桃花 2020-12-05 11:37

What is the best way to create a Sympy equation, do something like take the derivative, and then plot the results of that equation?

I have my symbolic equation, but

2条回答
  •  难免孤独
    2020-12-05 12:17

    Using SymPy

    You can use directly the plotting functions of SymPy:

    from sympy import symbols
    from sympy.plotting import plot as symplot
    
    t = symbols('t')
    x = 0.05*t + 0.2/((t - 5)**2 + 2)
    symplot(x)
    

    Most of the time it uses matplotlib as a backend.

提交回复
热议问题