Python Forum
Heat equation (not stationary)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Heat equation (not stationary)
#2
I do not know if you copied your code incorrectly or that's that way it is, but indent on line 66 is wrong. Then, you have 2 opening braces on line 67.

Besides - writhing veeeeery long calculations in one string without spaces makes an unreadable and unsupportable code. In Python, it is customary to surround operation symbols with spaces, for readability.
Couple of more points:
  • One-letter variable name add to code unreadability. Variable names should be meaningful and recognizable, and yes - if you ask help in an international forum, in English
  • In Python, you don't iterate over indices - you can, but you should not. Below - instant readability improvement, much clearer than L[k][i] **hand**
    for l_row in L:
    ....
        for l_cell in in l_row:
        ......
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,411 Nov-20-2022, 10:00 PM
Last Post: schniefen
  Heat equation HugoL 1 36,563 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