Investigating a Parabolic PDE algorithm

Click For Summary
The discussion revolves around a Fortran program implementing a parabolic PDE algorithm, specifically focusing on accuracy and stability analysis for various Δt and lattice spacings. The user struggles to identify meaningful output from the program, noting that results appear similar across different input sets, and seeks guidance on how to incorporate sources and sinks into the model. They clarify that sources and sinks represent inflow and outflow within the studied volume, and express confusion about how to implement these concepts in the existing code. The user also questions how to analyze solutions when the initial condition for the variable ∅ is set to zero. Overall, the thread highlights challenges in understanding the algorithm's implementation and the mathematical concepts involved.
ognik
Messages
626
Reaction score
2

Homework Statement


Hi - I'm on the last chapter of this book and am a bit stuck. I am given a very basic fortran program (code attached in the zip file) and asked to 'investigate its accuracy and stability, for various values of Δt and lattice spacings'. The program is an implementation of the equation recursion relation below (H is hermitian).

The second (and probably prime) part of the exercise says 'Incorporate sources or sinks along the lattice and study the solutions that arise when ∅ vanishes everywhere at t = 0

Homework Equations


$$ {\phi}_{n+1}= \frac{1}{1+H\Delta t} \left[{\phi}^{n}{S}^{n}{\Delta t}\right] $$

The Attempt at a Solution


Part 1:
I have run the program for various sets of values - and the output all looks so similar that I can't see anything to discuss. The errors reported are of a similar magnitude. Some combinations of input don't produce any output - but that is probably just a validation issue, as I say it is a simple program with no frills (so it doesn't reject 'forbidden' values, just doesn't do anything).
I have done similar exercises in previous chapters, and there was always lots to talk about, so I must be missing some subtlety here - could someone try and give me a clue or 2 please...

Part 2:
The text hasn't used the concept of sources/sinks before, but I think the PDE in question is similar to a diffusion equation so - please correct me - sources and sinks would be where there is inflow/outflow from the volume under study? And they are related to the Sn term in the equation? Earlier in this chapter I did some exercises on discretization, so I am familiar with that and lattices, but I am clueless otherwise (this course is about computational physics and as it happens I won't do equations like this until next year, C'est la vie)
 

Attachments

Physics news on Phys.org
If I understand, your algorithm is:
$$ \frac{f_{n+1}-f_n}{\Delta{t}} = Hf_n + S_n $$
which use forward 1s derivative. You can try to convert to central 1st derivative:
$$ \frac{f_{n+1}-f_{n-1}}{2\Delta{t}} = Hf_n + S_n $$
 
theodoros.mihos said:
If I understand, your algorithm is:
$$ \frac{f_{n+1}-f_n}{\Delta{t}} = Hf_n + S_n $$
which use forward 1s derivative. You can try to convert to central 1st derivative:
$$ \frac{f_{n+1}-f_{n-1}}{2\Delta{t}} = Hf_n + S_n $$
Hi - thanks but the program I have to study uses the algorithm I gave up front, so I have to stick with that.
 
I guess people are having the same problem as I am - not sure what to do ...I have added the output (output_n.txt files) rom a few runs that I did, the parameters are shown at the start of each file. I see them all with a gauss-like bell curve, but that was expected. I just don't know what else to look at? Really appreciate some help with this!
 

Attachments

Hi again, I have had to move on, deadlines etc. So I did a bunch more tests and just wrote it up objectively with the conclusions I could reach (mainly that this implicit method is more stable and a little more accurate than an explicit algorithm used in a previous exercise). That dispenses with part 1 (although I am open to any additional thoughts)

As above, part 2 says: "The second (and probably prime) part of the exercise says 'Incorporate sources or sinks along the lattice and study the solutions that arise when ∅ vanishes everywhere at t = 0"

How can I incorporate sources or sinks into this algorithm (code in the attached zip file)?

I also don't understand studying the solutions when ∅ vanishes everywhere at t = 0, the program initializes ∅ to 0 at t=0 , so this condition is a fixed default anyway?
 
Final, desperate call - assignment is due tomorrow, so will appreciate anyone who can help me quickly ...I think I have the method right, there is probably just some piece of the puzzle I don't know ...if you need more info. please just ask.
 
Hi, I have edged a bit further along with this:

Please correct me carefully here - sources and sinks would be where there is inflow/outflow from the volume/area under study? Therefore, for a sink, should I be looking at something like $$ \frac{\partial \phi}{\partial t} < 0 $$
and > 0 for a source?

If so, how does one' incorporate them, along the lattice', into the attached program? I really am just blank about this...an example would be very useful! Thanks.
 

Similar threads

Replies
2
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 19 ·
Replies
19
Views
2K
Replies
3
Views
2K
Replies
4
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
1
Views
4K