Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F61297218
plots_multiple.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, May 5, 19:01
Size
991 B
Mime Type
text/x-python
Expires
Tue, May 7, 19:01 (2 d)
Engine
blob
Format
Raw Data
Handle
17492341
Attached To
R12587 DD_1D-SRA
plots_multiple.py
View Options
import
numpy
as
np
import
matplotlib.pyplot
as
plt
from
ddm_wave_prop
import
*
dataset_path
=
r'C:/Travail/EPFL/Cours/M2/Projet CSE/LAMMPS/Dataset/'
gif_path
=
r'C:/Travail/EPFL/Cours/M2/Projet CSE/CODE/DDM/img/'
create_gif
=
True
plot_energies
=
True
plot_displacements
=
True
# PARAMETERS
L
=
0.05
# element length (m)
A
=
L
**
2
# element cross-section area (m2)
E
=
2e6
# young modulus (only useful for strain energy)
rho
=
2000
# = 2500*0.8 kg/m3
periods
=
[
0.07
,
0.11
,
0.2
]
# sinus periods (s)
ampl
=
0.01
# sinus amplitude (m)
# DATASET
dataset
=
load_dataset
(
dataset_path
)
all_displacements
=
{}
for
t0
in
periods
:
dt
=
t0
/
100.
# timestep to get 100 points per periods
Ttime
=
3
*
t0
# plot 3 periods
displacement
=
lambda
t
:
ampl
*
np
.
sin
(
2
*
np
.
pi
*
t
/
t0
)
coords
,
all_displacements_t0
,
KE
,
SE
,
TE
=
wave_propagation_pressure
(
dataset
,
E
,
A
,
L
,
displacement
,
Ttime
,
dt
,
rho
)
all_displacements
[
t0
]
=
all_displacements_t0
save_gif_T
(
gif_path
,
coords
,
all_displacements
)
Event Timeline
Log In to Comment