- #1
robby991
- 41
- 1
Hi, I am using the central difference method to solve a diffusion-based partial differential equation. However, my code now will not run because the time step has to be so large that Matlab cannot handle it. The large time step is due to the stability of
Where my space matrix goes from 0 to X with spacings of dx as determined by the number of space nodes (numx) as
my time matrix goes from 0 to t with spacings of dt as determined by the number of time nodes (numt) as
The diffusion coefficient is fixed, my space steps are essentially fixed because I need to have a certain amount of space nodes in my mesh so I cannot reduce them. My total time cannot go below a certain value either for my code to make sense, so the only thing I can do is increase the number of time steps to make dt as small as possible. However this number is unreasonably large that Matlab cannot handle it and runs out of memory.
Is there any other solution method which is essentially independent of time stepping; as there is no stability that requires on the size of the time step. Any computer differential equation solution packages? Thank you.
Code:
stability:
Diffusion coefficient*time step/(space step^2) < .5
Where my space matrix goes from 0 to X with spacings of dx as determined by the number of space nodes (numx) as
Code:
dx = x/numx-1
my time matrix goes from 0 to t with spacings of dt as determined by the number of time nodes (numt) as
Code:
dt = t/numt-1
The diffusion coefficient is fixed, my space steps are essentially fixed because I need to have a certain amount of space nodes in my mesh so I cannot reduce them. My total time cannot go below a certain value either for my code to make sense, so the only thing I can do is increase the number of time steps to make dt as small as possible. However this number is unreasonably large that Matlab cannot handle it and runs out of memory.
Is there any other solution method which is essentially independent of time stepping; as there is no stability that requires on the size of the time step. Any computer differential equation solution packages? Thank you.