-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I cleaned up my code and separated classes to make it easier to work …
…with. It is not ready yet; if Codecov fails, I will include more tests.
- Loading branch information
1 parent
f9d98e1
commit 4bf0008
Showing
15 changed files
with
908 additions
and
1,003 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 0 additions & 65 deletions
65
pySDC/projects/Second_orderSDC/dampedharmonic_oscillator_run_points.py
This file was deleted.
Oops, something went wrong.
59 changes: 0 additions & 59 deletions
59
pySDC/projects/Second_orderSDC/dampedharmonic_oscillator_run_stab_interval.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
pySDC/projects/Second_orderSDC/harmonic_oscillator_run_points.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import numpy as np | ||
from pySDC.projects.Second_orderSDC.harmonic_oscillator_params import harmonic_oscillator_params | ||
from pySDC.projects.Second_orderSDC.stability_simulation import compute_and_check_stability | ||
|
||
if __name__ == '__main__': | ||
# Define lists for the number of nodes and maximum iterations | ||
description=harmonic_oscillator_params() | ||
helper_params={'quad_type_list':['GAUSS', 'LOBATTO'], | ||
'Num_iter':(2, 2), | ||
'num_nodes_list':np.arange(3, 6, 1), | ||
'max_iter_list':np.arange(2, 10, 1)} | ||
description['helper_params']=helper_params | ||
points=((1, 100), (3, 100), (10, 100)) | ||
# Iterate through points and perform stability check | ||
for ii in points: | ||
compute_and_check_stability(description, ii, check_stability=True) |
16 changes: 16 additions & 0 deletions
16
pySDC/projects/Second_orderSDC/harmonic_oscillator_run_stab_interval.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import numpy as np | ||
from pySDC.projects.Second_orderSDC.harmonic_oscillator_params import harmonic_oscillator_params | ||
from pySDC.projects.Second_orderSDC.stability_simulation import compute_and_check_stability | ||
|
||
if __name__ == '__main__': | ||
# Define lists for the number of nodes and maximum iterations | ||
description=harmonic_oscillator_params() | ||
helper_params={'quad_type_list':['GAUSS'], | ||
'Num_iter':(2000, 1), | ||
'num_nodes_list':np.arange(2, 7, 1), | ||
'max_iter_list':np.arange(1, 11, 1)} | ||
description['helper_params']=helper_params | ||
points=((100, 1e-10),) | ||
# Iterate through points and perform stability check | ||
for ii in points: | ||
compute_and_check_stability(description, ii, compute_interval=True) |
22 changes: 22 additions & 0 deletions
22
pySDC/projects/Second_orderSDC/harmonic_oscillator_run_stability.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from pySDC.projects.Second_orderSDC.harmonic_oscillator_params import harmonic_oscillator_params | ||
from pySDC.projects.Second_orderSDC.stability_simulation import StabilityImplementation | ||
|
||
|
||
if __name__ == '__main__': | ||
""" | ||
Damped harmonic oscillator as a test problem for the stability plot: | ||
x' = v | ||
v' = -kappa * x - mu * v | ||
kappa: spring constant | ||
mu: friction | ||
Source: https://beltoforion.de/en/harmonic_oscillator/ | ||
""" | ||
# Execute the stability analysis for the damped harmonic oscillator | ||
description = harmonic_oscillator_params() | ||
model_stab = StabilityImplementation(description, kappa_max=30, mu_max=30, Num_iter=(200, 200)) | ||
|
||
model_stab.run_SDC_stability() | ||
model_stab.run_Picard_stability() | ||
model_stab.run_RKN_stability() | ||
model_stab.run_Ksdc() | ||
# model_stab.run_Kpicard |
Oops, something went wrong.