Investigating a Parabolic PDE algorithm

Click For Summary

Homework Help Overview

The discussion revolves around investigating the accuracy and stability of a Fortran program implementing a parabolic partial differential equation (PDE) algorithm. The original poster is tasked with analyzing the program's behavior for various time steps (Δt) and lattice spacings, as well as incorporating sources or sinks into the model.

Discussion Character

  • Exploratory, Assumption checking, Problem interpretation

Approaches and Questions Raised

  • The original poster attempts to run the program with different parameters but finds the outputs too similar to draw meaningful conclusions. They express uncertainty about how to analyze the results further. Some participants suggest alternative derivative approaches, while others question the understanding of sources and sinks in the context of the PDE.

Discussion Status

The discussion is ongoing, with participants exploring various interpretations of the problem. The original poster has moved forward with some tests but remains open to additional insights. There is a request for clarification on how to incorporate sources and sinks into the algorithm, indicating that guidance is sought but not yet fully provided.

Contextual Notes

The original poster notes that the PDE is similar to a diffusion equation and expresses confusion regarding the initialization condition where ∅ vanishes at t = 0, as this is already the default state in the program. There is also mention of deadlines, suggesting time constraints on the discussion.

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 19 ·
Replies
19
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
3
Views
2K
Replies
4
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K