Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: 2D finite difference code for non steady state Heat Equation
Replies: 1   Last Post: Oct 10, 2013 12:36 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Nasser Abbasi

Posts: 5,660
Registered: 2/7/05
Re: 2D finite difference code for non steady state Heat Equation
Posted: Oct 10, 2013 12:36 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 10/10/2013 7:32 AM, saheed wrote:
> Hi guys, I am writing a matlab code for 2D non steady state heat equation for non uniform grids.
>i am having a problem with adding the time domain index (k) to my equation:
> for j=1:1:m
> for i=2:1:n
> T(j,i)=T(j,i)+ lambda*( T(j,i+1) -4*T(j,i) + T(j,i-1)+T(j+1,i)+T(j-1,i) )
> end
> end
> Anyone with some hints should help me out. still I would appreciate if
>i can get a template code to solve the problem. Thanks
>


I do not see an 'h_x' and 'h_y' there? How come this is for
non uniform?

Any way. There is no time domain index.

The current matrix represents the current time.

When writing T(i,j)= T(i,j) + .....

you are basically updating in time the LHS from the older
time step in the RHS.

If needed, depending on the algorithm, another copy of the matrix T is used.
That is all. You do not need to keep a copy of T for each time step. THat is not
how things are implemented. Else, you'll run out of RAM soon, and it makes no
sense to keep a copy of T for each time step.

--Nasser








Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.