Thanks for sharing. One thing I would suggest, to avoid mixing SymPy and
NumPy functions, is to only import sympy and numpy as
import sympy as sym
import numpy as np
and then use sym.cos or np.cos. Otherwise, one cell has SymPy cos and
another has NumPy cos, and it can be very confusing, since you cannot use
SymPy functions on NumPy arrays or NumPy functions on SymPy expressions.
You can also use sympy.lambdify to convert a SymPy expression into a NumPy
function for use with matplotlib, like
x = sympy.Symbol('x')
expr = sympy.cos(x) + 1
f = lambdify(x, expr)
t = np.linspace(-10, 10, 100)
plt.plot(t, f(t))
That way you don't have to rewrite the expression if you already have it in
SymPy.
Aaron Meurer
On Thu, May 4, 2017 at 1:46 AM, chu-ching huang <[email protected]>
wrote:
> As title, sympy package had been introduced in these lectures, especially
> for Multiple-variable functions. If interested, welcome to visit the site:
>
> https://github.com/cchuang2009/2016-1/tree/master/calculus
>
> cch
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/ms
> gid/sympy/eb12b241-373a-4cf4-a9f1-6cedad8e1be0%40googlegroups.com
> <https://groups.google.com/d/msgid/sympy/eb12b241-373a-4cf4-a9f1-6cedad8e1be0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/CAKgW%3D6%2BgcP5xtox8S_TNnMR0YT20OyXNXGF1WEx4BKgP8ZRqkQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.