Python Forum
Heat equation (not stationary)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Heat equation (not stationary)
#4
One more point - default variable values; instead of this monstrosity
def lambd(T,coeff1,coeff2):
     '''O si prends les valeurs exp, 1 si prends les valeurs entrées pour coeff1 et coeff2'''
     if coeff1==0 and coeff2==0:
           coeff1=lambda1
           coeff2=lambda2
that shorthand
def lambd(T, coeff1=lambda1, coeff2=lambda2):
And lambd(L[k][i],0,0) turns into lambd(L[k][i])

PS lambda being a reserved word in Python, using names very similar to it may be not such a good idea
Test everything in a Python shell (iPython, Azure Notebook, etc.)
  • Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
  • Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
  • You posted a claim that something you did not test works? Be prepared to eat your hat.
Reply


Messages In This Thread
Heat equation (not stationary) - by Zulian - May-13-2017, 07:19 AM
RE: Heat equation (not stationary) - by volcano63 - May-13-2017, 08:56 AM
RE: Heat equation (not stationary) - by Zulian - May-13-2017, 09:01 AM
RE: Heat equation (not stationary) - by volcano63 - May-13-2017, 09:03 AM
RE: Heat equation (not stationary) - by Zulian - May-13-2017, 03:03 PM
RE: Heat equation (not stationary) - by Zulian - May-14-2017, 12:54 PM
RE: Heat equation (not stationary) - by volcano63 - May-14-2017, 04:03 PM
RE: Heat equation (not stationary) - by Ofnuts - May-15-2017, 06:33 AM
RE: Heat equation (not stationary) - by Zulian - May-15-2017, 02:19 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  animating 2d heat map schniefen 0 1,457 Nov-20-2022, 10:00 PM
Last Post: schniefen
  Heat equation HugoL 1 38,745 Mar-07-2017, 05:22 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020