Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
fluiddyn
fluidsim
Commits
834fd0420d26
Commit
190bec86
authored
Mar 11, 2021
by
Jason Reneuve
Browse files
plot dispersion relation as a step function
parent
fe3265e88c02
Changes
1
Hide whitespace changes
Inline
Side-by-side
fluidsim/solvers/ns3d/output/spatiotemporal_spectra.py
View file @
834fd042
...
@@ -250,13 +250,13 @@ class SpatioTemporalSpectraNS3D(SpatioTemporalSpectra):
...
@@ -250,13 +250,13 @@ class SpatioTemporalSpectraNS3D(SpatioTemporalSpectra):
return
return
if
equation
.
startswith
(
r
"$\omega"
):
if
equation
.
startswith
(
r
"$\omega"
):
kz_disp
=
(
N
**
2
/
omega
**
2
-
1
)
*
xaxis
kz_disp
=
(
N
**
2
/
omega
**
2
-
1
)
*
xaxis
ax
.
plot
(
xaxis
,
kz_disp
,
"k
:
"
,
linewidth
=
2
)
ax
.
step
(
xaxis
,
kz_disp
,
"k"
,
linewidth
=
2
)
elif
equation
.
startswith
(
r
"$k_h"
):
elif
equation
.
startswith
(
r
"$k_h"
):
omega_disp
=
kh
/
np
.
sqrt
(
kh
**
2
+
xaxis
**
2
)
omega_disp
=
kh
/
np
.
sqrt
(
kh
**
2
+
xaxis
**
2
)
ax
.
plot
(
xaxis
,
omega_disp
,
"k
:
"
,
linewidth
=
2
)
ax
.
step
(
xaxis
,
omega_disp
,
"k"
,
linewidth
=
2
)
elif
equation
.
startswith
(
r
"$k_z"
):
elif
equation
.
startswith
(
r
"$k_z"
):
omega_disp
=
xaxis
/
np
.
sqrt
(
xaxis
**
2
+
kz
**
2
)
omega_disp
=
xaxis
/
np
.
sqrt
(
xaxis
**
2
+
kz
**
2
)
ax
.
plot
(
xaxis
,
omega_disp
,
"k
:
"
,
linewidth
=
2
)
ax
.
step
(
xaxis
,
omega_disp
,
"k"
,
linewidth
=
2
)
else
:
else
:
raise
ValueError
(
"wrong equation for dispersion relation"
)
raise
ValueError
(
"wrong equation for dispersion relation"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment