Last active
December 19, 2015 11:58
-
-
Save MechCoder/5951408 to your computer and use it in GitHub Desktop.
Which one is better?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chi = Function('chi')(x, y) | |
chix = chi.diff(x) | |
chiy = chi.diff(y) | |
cpde = chix + h*chiy - hy*chi | |
chieq = Symbol("chi") | |
for i in range(1, deg + 1): | |
chieq += Add(*[ | |
Symbol("chi_" + str(power) + "_" + str(i - power))*x**power*y**(i - power) | |
for power in range(i + 1)]) | |
cnum, cden = cancel(chieq.diff(x) + h*chieq.diff(y) | |
- hy*chieq).as_numer_denom() # Is this better | |
cnum, cden = cancel(cpde.subs({chi : chieq}).doit()).as_numer_denom() ## Or this? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment