-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Review #388
Review #388
Changes from 1 commit
33aaee8
d147666
645e337
5d6d754
638bd3c
f9d98e1
4bf0008
3d04ad1
ef4291b
bfa5113
b08307e
5b30c49
1a7e35d
c543234
a8b1322
cb34c1a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
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) |
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) |
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/ | ||
""" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does this function tell us about the harmonic oscillator? I am not wondering what the harmonic oscillator does, but what this file is about. The documentation of the harmonic oscillator should go into the harmonic oscillator problem class and nowhere else. |
||
# 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about a more descriptive function name such as
get_default_harmonic_oscillator_description
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!