Loop over all time steps
Closed this issue · 2 comments
auddya commented
This is the function where the algorithm of the problem is implemented
We would like to use the Finite Difference Method for our problem
Working algorithm
- Loop over temporal intervals
- Loop over spatial intervals
- Apply finite difference formula
- Insert boundary conditions after each time step
- Switch variables before next time step
def main_function_simulation(arrays, other parameters):
This functions fills up the solution arrays using loops and FD equations
Input
------
- arrays: Arrays from the previous function which will be used in the algorithm
- other parameters: Needed for the FD equation
Working algorithm:
------
- Loop over temporal intervals
- Loop over spatial intervals
- Apply finite difference formula
- Insert boundary conditions after each time step
- Switch variables before next time step
Output
------
- Array containing the solution of our problem for a given PDE, IC and BC
gonuke commented
This is the stage to define your function arguments carefully - here listed as arrays
and other parameters
.
You can defer some of that with containers. For example, it would make sense to have sim_parameters
be a dictionary with as-yet unspecified keys, leaving you flexibility for the future.