-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpermittivity.py
More file actions
38 lines (30 loc) · 1.01 KB
/
permittivity.py
File metadata and controls
38 lines (30 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# This file is part of LayerModel_lib
#
# A tool to compute the transmission behaviour of plane electromagnetic waves
# through human tissue.
#
# Copyright (C) 2018 Jan-Christoph Brumm
#
# Licensed under MIT license.
#
"""
This example shows how the complex permittivity of the different tissues is computed.
"""
import numpy as np
import matplotlib.pyplot as plt
from LayerModel_lib import TissueProperties
tp = TissueProperties()
# print all available tissues and their relative permittivity at 4 GHz
for (i, t) in enumerate(tp.tissue_names):
print('%d %s: %.4f' % (i, t, np.real(tp.complex_permittivity(i, 4e9) / tp.epsilon0)))
# get the id of muscle
muscle_id = np.array(tp.get_id_for_name(['Muscle', 'Fat']))
# calculate permittivity for vector f
f = np.linspace(1e6, 10e9, 500)
eps = tp.complex_permittivity(muscle_id, f) / tp.epsilon0
fig, ax = plt.subplots(nrows=2)
ax[0].semilogy(f, np.real(eps))
ax[0].set_title("Real Part")
ax[1].semilogy(f, -np.imag(eps))
ax[1].set_title("negative Imag. Part")
plt.show()