Solving Equations Symbolically And Using LaTeX In Python!

preview_player
Показать описание
There are some nice ways to pretty up your codes in python. I use Jupyter Notebook along with libraries like sympy to output equations from my codes in LaTeX format. Keeping things in variable form in addition to passing numerical values to functions is a nice way to keep tabs on what your code is doing.
Рекомендации по теме
Комментарии
Автор

Finally real how to's LaTeX into Anaconda nice to use in explaining algorithms in line and then implementing them in Phyton. Thank you very much Andrew Dotson

bernsbuenaobra
Автор

You Andrew, are a top shagger. My physics grades this year thank you in advance

drover
Автор

Good video, but you don't need to "declare" your function with "func = sp.Function('func')". "func = sp.sin(x)" is sufficient.
For example,



import sympy as sp


x = sp.symbols('x', real=True)


func = sp.Function('func')
print(type(func))


func = sp.sin(x)
print(type(func))


func = "stuff"
print(type(func))


<class
sin
<class 'str'>


"func = sp.Function('func')" creates a variable called func referring to an object of type UndefinedFunction. "func = sp.sin(x)" overwrites this variable reference and creates an object of type "sin". Finally, func = "stuff" overwrites this reference again and creates a string.

danielsears
Автор

If you're doing physics, try to the vector module in dumpy. Also mpmath is good for changing how precise your values are

sciencestararvinsinghk
Автор

This is what we want! Big thumbs up! Great stuff Andy!

davidsweeney
Автор

Great video! Very useful! Please continue with this line of videos!

thomasblackwell
Автор

if you're using np.power(a, b) just replace it to sp.Pow(a, b). Unfortunately, sp.power(a, b) will not work, the function is slightly different.

tehyonglip
Автор

I used to do sympy, and I don't see the need to define a function f(x). I used to do it in spyder, and I would just define my symbols, then say f = some equation, then do sp.integrate(f, ('variable I'm integrating', 'lower bound', 'upper bound').eval()

_Nibi
Автор

would be helpful if jupyter notebook could live render LaTex so that you instantaneously could see what you are typing (and not wait to finish the markdown scripting before seeing the mathematical expression)

kisho
Автор

Thank you sir. We use markdown to write an equation by latex mode. But is there some way to do other mathematical stuff in python like evaluation etc using latex mode ? I faced a big problem writing subscripts when there are many, even with split_super_sub module. This problem can be circumvented by using latex kind of command.

DrIlyas-sqpz
Автор

Will simpy not lower your computation speed? I would expect this to be the case but have not used it enough to be sure

KillGui
Автор

Thanks! This really helped a lot. The output kinda looks weird in Spyder but it's still comprehensible.

paranoidcomet
Автор

This is an excellent job!! I tried applying $$ z=\dfrac{2x}{3y} $$ but it did not work and giving error "invalid syntax". Can you please help me in this?

shivajishinde
Автор

do you know, guys, how to display equations with latex on tkinter??? HELLLP!!

sddbakirova
Автор

Why don’t you try VSCode. It has built in support for Jupyter, can debug step in/over, show variables etc

StarbaseX-comv
Автор

Did you learn to code in uni or did you know how to before?

gabrielavendano
Автор

Thank you for the Vedio. I was wondering if we can solve an equation written in Latex code without going back to python code. For example is it possible for python in Jupyter notebook to identify x^2 same as x**2

abdelhamidalbaid
Автор

I started understanding a little about how python coding works but you lost me when you started talking in LaTeX xD
I'll have to take computer science and learn to code at some point, just a matter of time now
Maybe I can add this to my list of summer things 👍🏾

umaoio
Автор

Please i want to help with single degree linear eq how to solve(solce(eq, x) ) it with sympy.. I tried but it takes laege time

alaasleem
Автор

How is print used like a statement instead as a function? Is this Python2?

faleru