Skip to content

Commit

Permalink
deploy: 28de1ef
Browse files Browse the repository at this point in the history
  • Loading branch information
cgadal committed Aug 31, 2023
0 parents commit 14e37ac
Show file tree
Hide file tree
Showing 120 changed files with 36,155 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: eea301c30114ab70375befbb91222d16
tags: 645f666f9bcd5a90fca523b33c5a78b7
Empty file added .nojekyll
Empty file.
514 changes: 514 additions & 0 deletions _autosummary/pyudv.amplitude.direct_models.alpha_w.html

Large diffs are not rendered by default.

503 changes: 503 additions & 0 deletions _autosummary/pyudv.amplitude.direct_models.correction_factor.html

Large diffs are not rendered by default.

513 changes: 513 additions & 0 deletions _autosummary/pyudv.amplitude.direct_models.create_MSvoltage.html

Large diffs are not rendered by default.

546 changes: 546 additions & 0 deletions _autosummary/pyudv.amplitude.direct_models.cumulative_trapezoid.html

Large diffs are not rendered by default.

480 changes: 480 additions & 0 deletions _autosummary/pyudv.amplitude.direct_models.html

Large diffs are not rendered by default.

515 changes: 515 additions & 0 deletions _autosummary/pyudv.amplitude.direct_models.near_field_theoretical.html

Large diffs are not rendered by default.

510 changes: 510 additions & 0 deletions _autosummary/pyudv.amplitude.direct_models.sound_velocity.html

Large diffs are not rendered by default.

464 changes: 464 additions & 0 deletions _autosummary/pyudv.amplitude.html

Large diffs are not rendered by default.

503 changes: 503 additions & 0 deletions _autosummary/pyudv.amplitude.inversion.correction_factor.html

Large diffs are not rendered by default.

491 changes: 491 additions & 0 deletions _autosummary/pyudv.amplitude.inversion.explicit_inversion.html

Large diffs are not rendered by default.

468 changes: 468 additions & 0 deletions _autosummary/pyudv.amplitude.inversion.html

Large diffs are not rendered by default.

479 changes: 479 additions & 0 deletions _autosummary/pyudv.helpers.create_arboresence.html

Large diffs are not rendered by default.

473 changes: 473 additions & 0 deletions _autosummary/pyudv.helpers.html

Large diffs are not rendered by default.

495 changes: 495 additions & 0 deletions _autosummary/pyudv.helpers.moving_std.html

Large diffs are not rendered by default.

496 changes: 496 additions & 0 deletions _autosummary/pyudv.helpers.moving_std1d.html

Large diffs are not rendered by default.

565 changes: 565 additions & 0 deletions _autosummary/pyudv.helpers.uniform_filter.html

Large diffs are not rendered by default.

537 changes: 537 additions & 0 deletions _autosummary/pyudv.helpers.uniform_filter1d.html

Large diffs are not rendered by default.

478 changes: 478 additions & 0 deletions _autosummary/pyudv.html

Large diffs are not rendered by default.

488 changes: 488 additions & 0 deletions _autosummary/pyudv.probes.Probe.html

Large diffs are not rendered by default.

484 changes: 484 additions & 0 deletions _autosummary/pyudv.probes.Probe.plot_probe.html

Large diffs are not rendered by default.

479 changes: 479 additions & 0 deletions _autosummary/pyudv.probes.compute_vertical_axis.html

Large diffs are not rendered by default.

476 changes: 476 additions & 0 deletions _autosummary/pyudv.probes.html

Large diffs are not rendered by default.

479 changes: 479 additions & 0 deletions _autosummary/pyudv.probes.probe_crossing_point.html

Large diffs are not rendered by default.

486 changes: 486 additions & 0 deletions _autosummary/pyudv.probes.sketch_probes.html

Large diffs are not rendered by default.

500 changes: 500 additions & 0 deletions _autosummary/pyudv.read_mfprof.amplitude_from_UVPdata.html

Large diffs are not rendered by default.

504 changes: 504 additions & 0 deletions _autosummary/pyudv.read_mfprof.amplitude_from_mfprof_reading.html

Large diffs are not rendered by default.

479 changes: 479 additions & 0 deletions _autosummary/pyudv.read_mfprof.create_variable.html

Large diffs are not rendered by default.

479 changes: 479 additions & 0 deletions _autosummary/pyudv.read_mfprof.filetime_to_dt.html

Large diffs are not rendered by default.

485 changes: 485 additions & 0 deletions _autosummary/pyudv.read_mfprof.html

Large diffs are not rendered by default.

479 changes: 479 additions & 0 deletions _autosummary/pyudv.read_mfprof.mfprof_to_netcdf.html

Large diffs are not rendered by default.

505 changes: 505 additions & 0 deletions _autosummary/pyudv.read_mfprof.read_mfprof.html

Large diffs are not rendered by default.

498 changes: 498 additions & 0 deletions _autosummary/pyudv.read_mfprof.velocity_from_UVPdata.html

Large diffs are not rendered by default.

503 changes: 503 additions & 0 deletions _autosummary/pyudv.read_mfprof.velocity_from_mfprof_reading.html

Large diffs are not rendered by default.

492 changes: 492 additions & 0 deletions _autosummary/pyudv.read_mfprof.write_dictionnary.html

Large diffs are not rendered by default.

506 changes: 506 additions & 0 deletions _autosummary/pyudv.reconstruct_velocity.html

Large diffs are not rendered by default.

488 changes: 488 additions & 0 deletions _autosummary/pyudv.velocity.Probe.html

Large diffs are not rendered by default.

484 changes: 484 additions & 0 deletions _autosummary/pyudv.velocity.Probe.plot_probe.html

Large diffs are not rendered by default.

479 changes: 479 additions & 0 deletions _autosummary/pyudv.velocity.compute_vertical_axis.html

Large diffs are not rendered by default.

476 changes: 476 additions & 0 deletions _autosummary/pyudv.velocity.html

Large diffs are not rendered by default.

479 changes: 479 additions & 0 deletions _autosummary/pyudv.velocity.probe_crossing_point.html

Large diffs are not rendered by default.

503 changes: 503 additions & 0 deletions _autosummary/pyudv.velocity.reconstruct_velocity.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
"""
==================================
Probes and velocity reconstruction
==================================
"""

import matplotlib.pyplot as plt
import numpy as np

from pyudv import reconstruct_velocity
from pyudv.probes import Probe, sketch_probes


def U(z):
u = 5 * (5 - z) ** 2
v = u / 10
U = np.array([u, v])
return U


# %%
# Define probes and plot them
# ===========================

# define probes
r = np.linspace(0, 5, 100)
alpha1, alpha2 = -120, -70 # deg
O1, O2 = np.array([1, 8]), np.array([-1, 7])
probe1_pars = [r, alpha1, [0, O1]]
probe2_pars = [r, alpha2, [0, O2]]
#
probe1 = Probe(*probe1_pars)
probe2 = Probe(*probe2_pars)

fig, ax = plt.subplots(1, 1, layout="constrained")
sketch_probes(
[probe1, probe2],
combinations=[[0, 1]],
probe_colors=[None, None],
combination_colors=["k"],
ax=ax,
)
ax.set_xlabel("x")
ax.set_ylabel("y")
plt.show()

# %%
# Create fake signal
# ==================

u1 = U(probe1.z).T @ probe1.unit_vec
u2 = U(probe2.z).T @ probe2.unit_vec

# %%
# Velocity reconstruction
# =======================

U_rec, z_interp, X, dx_1, dx_2 = reconstruct_velocity(u1, u2, probe1_pars, probe2_pars)
U_th = U(z_interp)
#
fig, axarr = plt.subplots(1, 3, layout="constrained", sharey=True)
for ax, u_th, u_rec in zip(axarr, U_th, U_rec):
ax.plot(u_th, z_interp, ".", label="base")
ax.plot(u_rec, z_interp, ".", label="reconstructed")
ax.legend()
axarr[0].set_xlabel("u")
axarr[1].set_xlabel("v")
axarr[0].set_ylabel("z")
plt.show()
171 changes: 171 additions & 0 deletions _downloads/072ebe5500351177edd3cc97b2ba54e0/plot_direct_inversion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
"""
==============================================
Concentration inference from amplitude signals
==============================================
"""

import matplotlib.pyplot as plt
import numpy as np

import pyudv.amplitude.direct_models as DM
from pyudv.amplitude.inversion import explicit_inversion
from pyudv.amplitude.sediment_acoustic_models import quartz_sand as quartz


def C_to_phi(C, rho=2.65e3):
return C / rho


def phi_to_C(phi, rho=2.65e3):
return phi * rho


fig_width_small = 11.25

# %%
# Define the parameters for the direct model
# ==========================================

d = 100e-6 # grain mean diameter [m]
rho = 2.65 # grain density [g/cm3]
rho = rho * 1e-3 / 1e-6 # grain density [kg/m3]

F = 2e6 # frequency [Hz]
T = 20 # Temperature [Celsius degrees]
a_w = DM.alpha_w(F, T) # water absorption, [m-1]
k = 2 * np.pi * F / DM.sound_velocity(T) # wavenumber of the wave

Ks, Kt = 1, 1 # sediment and transducer constants
Xi = quartz.Xi(k, d / 2) # sediment attenuation constant
rn = 0.05 # near field distance [cm]
r = np.linspace(0.001, 12, 330) # radial coordinates [cm]

# Volumic fraction of grain
Phi = np.array([0.0001, 0.002, 0.005, 0.01, 0.02, 0.05, 0.1])


# %%
# Influence of the imposed point in the integration
# =================================================

# #### without near field function
psi = DM.near_field_theoretical(r, rn) * 0 + 1 # near field function
# defining a constant grain concentration profile
C = Phi[:, None] * rho * (r[None, :] * 0 + 1)
MSV = DM.create_MSvoltage(C, r, Xi, a_w, Ks, Kt, psi)
#
indexes = [2, 50, 150, 250, 320]

color = []
fig, ax = plt.subplots(
1, 1, figsize=(fig_width_small, fig_width_small), constrained_layout=True
)
for i, phi in enumerate(Phi):
if i == 0:
a = plt.plot(C[i, :], r, lw=4, alpha=0.3, label="imposed")
else:
a = plt.plot(C[i, :], r, lw=4, alpha=0.3)
color.append(a[0].get_color())
for j, index in enumerate(indexes):
C0 = C[:, index]
r0 = r[index]
C_inferred = explicit_inversion(MSV, r, Xi, a_w, psi, C0, r0)
for i, phi in enumerate(Phi):
if i == 0:
plt.plot(
C_inferred[i, :], r, lw=2.5 - (j + 1) / 3, label=str(r0), color=color[i]
)
else:
plt.plot(C_inferred[i, :], r, lw=2.5 - (j + 1) / 3, color=color[i])
plt.xlabel("Concentration~[kg/m3]")
plt.ylabel("Distance from transducer~[m]")
ax.set_xscale("log")
plt.xlim([0.5 * C.min(), 2.5 * C.max()])
plt.ylim([0, r.max()])
ax.invert_yaxis()
secax = ax.secondary_xaxis("top", functions=(C_to_phi, phi_to_C))
secax.set_xlabel("Volumic fraction")
plt.legend(title="Distance of imposed concentration [mm]")
plt.title("Without near field")

# #### with near field function
psi = DM.near_field_theoretical(r, rn) # near field function
# defining a constant grain concentration profile
C = Phi[:, None] * rho * (r[None, :] * 0 + 1)
MSV = DM.create_MSvoltage(C, r[None, :], Xi, a_w, Ks, Kt, psi[None, :])
#
color = []
fig, ax = plt.subplots(
1, 1, figsize=(fig_width_small, fig_width_small), constrained_layout=True
)
for i, phi in enumerate(Phi):
if i == 0:
a = plt.plot(C[i, :], r, lw=4, alpha=0.3, label="imposed")
else:
a = plt.plot(C[i, :], r, lw=4, alpha=0.3)
color.append(a[0].get_color())
for j, index in enumerate(indexes):
C0 = C[:, index]
r0 = r[index]
C_inferred = explicit_inversion(MSV, r, Xi, a_w, psi * 0 + 1, C0, r0)
for i, phi in enumerate(Phi):
if i == 0:
plt.plot(
C_inferred[i, :], r, lw=2.5 - (j + 1) / 3, label=str(r0), color=color[i]
)
else:
plt.plot(C_inferred[i, :], r, lw=2.5 - (j + 1) / 3, color=color[i])
plt.xlabel("Concentration~[kg/m3]")
plt.ylabel("Distance from transducer~[m]")
ax.set_xscale("log")
plt.xlim([0.5 * C.min(), 2.5 * C.max()])
plt.ylim([0, r.max()])
ax.invert_yaxis()
secax = ax.secondary_xaxis("top", functions=(C_to_phi, phi_to_C))
secax.set_xlabel("Volumic fraction")
plt.legend(title="Distance of imposed concentration [mm]")
plt.title("With near field")

# #### with real type concentration profiles
psi = DM.near_field_theoretical(r, rn) # near field function
# C = Phi[:, None]*rho*np.exp(-r[None, :]/1) # defining an exponentially decreasing profile
# C = Phi[:, None]*rho*np.exp(r[None, :]/10) # defining an exponentially increasing profile
C = Phi[:, None] * rho * (r[None, :] * 0 + 1) # defining sedimentation-like profile
C[..., :230] = 0
#
MSV = DM.create_MSvoltage(C, r[None, :], Xi, a_w, Ks, Kt, psi[None, :])
#
color = []
fig, ax = plt.subplots(
1, 1, figsize=(fig_width_small, fig_width_small), constrained_layout=True
)
for i, phi in enumerate(Phi):
if i == 0:
a = plt.plot(C[i, :], r, lw=4, alpha=0.3, label="imposed")
else:
a = plt.plot(C[i, :], r, lw=4, alpha=0.3)
color.append(a[0].get_color())
for j, index in enumerate(indexes):
C0 = C[:, index]
r0 = r[index]
C_inferred = explicit_inversion(MSV, r, Xi, a_w, psi * 0 + 1, C0, r0)
for i, phi in enumerate(Phi):
if i == 0:
plt.plot(
C_inferred[i, :], r, lw=2.5 - (j + 1) / 3, label=str(r0), color=color[i]
)
else:
plt.plot(C_inferred[i, :], r, lw=2.5 - (j + 1) / 3, color=color[i])
plt.xlabel("Concentration~[kg/m3]")
plt.ylabel("Distance from transducer~[m]")
ax.set_xscale("log")
plt.xlim([0.2 * C[:, -1].min(), 2.5 * C.max()])
plt.ylim([0, r.max()])
ax.invert_yaxis()
secax = ax.secondary_xaxis("top", functions=(C_to_phi, phi_to_C))
secax.set_xlabel("Volumic fraction")
plt.legend(title="Distance of imposed concentration [mm]")
plt.title("With exponential concentration profiles")


plt.show()
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
"""
==========================
Read and plot .mfprof data
==========================
"""

import matplotlib.colors as colors
import matplotlib.pyplot as plt
import numpy as np

from pyudv.read_mfprof import (
amplitude_from_mfprof_reading,
read_mfprof,
velocity_from_mfprof_reading,
)

#
path_data = "src/data_sample.mfprof"

# #### Loading data
Data, Parameters, Info, Units = read_mfprof(path_data)
Amplitude_data = amplitude_from_mfprof_reading(Data, Parameters)
Velocity_data = velocity_from_mfprof_reading(Data, Parameters)
time = Data["profileTime"]
z_coordinates = Data["DistanceAlongBeam"] * 1e2
indmax_time = np.argwhere(Data["transducer"] == 0)[1][0] - 1
indmax_z = -1
ind_bottom = 572

# #### plotting velocity
divnorm = colors.TwoSlopeNorm(vcenter=0, vmin=-0.2, vmax=0.2)
fig, ax = plt.subplots(1, 1, constrained_layout=True)
c = ax.pcolormesh(
time[:indmax_time],
z_coordinates[:indmax_z],
Velocity_data[:indmax_z, :indmax_time],
cmap="PuOr",
norm=divnorm,
rasterized=True,
shading="auto",
)
ax.axhline(y=z_coordinates[ind_bottom], color="k", lw="0.5", ls="--")
ax.invert_yaxis()
fig.colorbar(c, label="Velocity [m/s]")
ax.set_xlabel("Time [s]")
ax.set_ylabel("DistanceAlongBeam [cm]")
# fig.draw_without_rendering()
plt.savefig("plots/Spatio_temporal_velocity.pdf", dpi=600)
plt.show()

# #### plotting amplitude
divnorm = colors.TwoSlopeNorm(vcenter=0, vmin=-0.1, vmax=0.1)
fig, ax = plt.subplots(1, 1, constrained_layout=True)
c = ax.pcolormesh(
time[:indmax_time],
z_coordinates[:indmax_z],
Amplitude_data[:indmax_z, :indmax_time],
rasterized=True,
shading="auto",
cmap="PuOr",
norm=divnorm,
)
ax.axhline(y=z_coordinates[ind_bottom], color="k", lw="0.5", ls="--")
ax.invert_yaxis()
fig.colorbar(c, label="Amplitude [V]")
ax.set_xlabel("Time [s]")
ax.set_ylabel("DistanceAlongBeam [cm]")
plt.savefig("plots/Spatio_temporal_amplitude.pdf", dpi=600)
plt.show()
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n# Concentration inference from amplitude signals\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\nimport numpy as np\n\nimport pyudv.amplitude.direct_models as DM\nfrom pyudv.amplitude.inversion import explicit_inversion\nfrom pyudv.amplitude.sediment_acoustic_models import quartz_sand as quartz\n\n\ndef C_to_phi(C, rho=2.65e3):\n return C / rho\n\n\ndef phi_to_C(phi, rho=2.65e3):\n return phi * rho\n\n\nfig_width_small = 11.25"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Define the parameters for the direct model\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"d = 100e-6 # grain mean diameter [m]\nrho = 2.65 # grain density [g/cm3]\nrho = rho * 1e-3 / 1e-6 # grain density [kg/m3]\n\nF = 2e6 # frequency [Hz]\nT = 20 # Temperature [Celsius degrees]\na_w = DM.alpha_w(F, T) # water absorption, [m-1]\nk = 2 * np.pi * F / DM.sound_velocity(T) # wavenumber of the wave\n\nKs, Kt = 1, 1 # sediment and transducer constants\nXi = quartz.Xi(k, d / 2) # sediment attenuation constant\nrn = 0.05 # near field distance [cm]\nr = np.linspace(0.001, 12, 330) # radial coordinates [cm]\n\n# Volumic fraction of grain\nPhi = np.array([0.0001, 0.002, 0.005, 0.01, 0.02, 0.05, 0.1])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Influence of the imposed point in the integration\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# #### without near field function\npsi = DM.near_field_theoretical(r, rn) * 0 + 1 # near field function\n# defining a constant grain concentration profile\nC = Phi[:, None] * rho * (r[None, :] * 0 + 1)\nMSV = DM.create_MSvoltage(C, r, Xi, a_w, Ks, Kt, psi)\n#\nindexes = [2, 50, 150, 250, 320]\n\ncolor = []\nfig, ax = plt.subplots(\n 1, 1, figsize=(fig_width_small, fig_width_small), constrained_layout=True\n)\nfor i, phi in enumerate(Phi):\n if i == 0:\n a = plt.plot(C[i, :], r, lw=4, alpha=0.3, label=\"imposed\")\n else:\n a = plt.plot(C[i, :], r, lw=4, alpha=0.3)\n color.append(a[0].get_color())\nfor j, index in enumerate(indexes):\n C0 = C[:, index]\n r0 = r[index]\n C_inferred = explicit_inversion(MSV, r, Xi, a_w, psi, C0, r0)\n for i, phi in enumerate(Phi):\n if i == 0:\n plt.plot(\n C_inferred[i, :], r, lw=2.5 - (j + 1) / 3, label=str(r0), color=color[i]\n )\n else:\n plt.plot(C_inferred[i, :], r, lw=2.5 - (j + 1) / 3, color=color[i])\nplt.xlabel(\"Concentration~[kg/m3]\")\nplt.ylabel(\"Distance from transducer~[m]\")\nax.set_xscale(\"log\")\nplt.xlim([0.5 * C.min(), 2.5 * C.max()])\nplt.ylim([0, r.max()])\nax.invert_yaxis()\nsecax = ax.secondary_xaxis(\"top\", functions=(C_to_phi, phi_to_C))\nsecax.set_xlabel(\"Volumic fraction\")\nplt.legend(title=\"Distance of imposed concentration [mm]\")\nplt.title(\"Without near field\")\n\n# #### with near field function\npsi = DM.near_field_theoretical(r, rn) # near field function\n# defining a constant grain concentration profile\nC = Phi[:, None] * rho * (r[None, :] * 0 + 1)\nMSV = DM.create_MSvoltage(C, r[None, :], Xi, a_w, Ks, Kt, psi[None, :])\n#\ncolor = []\nfig, ax = plt.subplots(\n 1, 1, figsize=(fig_width_small, fig_width_small), constrained_layout=True\n)\nfor i, phi in enumerate(Phi):\n if i == 0:\n a = plt.plot(C[i, :], r, lw=4, alpha=0.3, label=\"imposed\")\n else:\n a = plt.plot(C[i, :], r, lw=4, alpha=0.3)\n color.append(a[0].get_color())\nfor j, index in enumerate(indexes):\n C0 = C[:, index]\n r0 = r[index]\n C_inferred = explicit_inversion(MSV, r, Xi, a_w, psi * 0 + 1, C0, r0)\n for i, phi in enumerate(Phi):\n if i == 0:\n plt.plot(\n C_inferred[i, :], r, lw=2.5 - (j + 1) / 3, label=str(r0), color=color[i]\n )\n else:\n plt.plot(C_inferred[i, :], r, lw=2.5 - (j + 1) / 3, color=color[i])\nplt.xlabel(\"Concentration~[kg/m3]\")\nplt.ylabel(\"Distance from transducer~[m]\")\nax.set_xscale(\"log\")\nplt.xlim([0.5 * C.min(), 2.5 * C.max()])\nplt.ylim([0, r.max()])\nax.invert_yaxis()\nsecax = ax.secondary_xaxis(\"top\", functions=(C_to_phi, phi_to_C))\nsecax.set_xlabel(\"Volumic fraction\")\nplt.legend(title=\"Distance of imposed concentration [mm]\")\nplt.title(\"With near field\")\n\n# #### with real type concentration profiles\npsi = DM.near_field_theoretical(r, rn) # near field function\n# C = Phi[:, None]*rho*np.exp(-r[None, :]/1) # defining an exponentially decreasing profile\n# C = Phi[:, None]*rho*np.exp(r[None, :]/10) # defining an exponentially increasing profile\nC = Phi[:, None] * rho * (r[None, :] * 0 + 1) # defining sedimentation-like profile\nC[..., :230] = 0\n#\nMSV = DM.create_MSvoltage(C, r[None, :], Xi, a_w, Ks, Kt, psi[None, :])\n#\ncolor = []\nfig, ax = plt.subplots(\n 1, 1, figsize=(fig_width_small, fig_width_small), constrained_layout=True\n)\nfor i, phi in enumerate(Phi):\n if i == 0:\n a = plt.plot(C[i, :], r, lw=4, alpha=0.3, label=\"imposed\")\n else:\n a = plt.plot(C[i, :], r, lw=4, alpha=0.3)\n color.append(a[0].get_color())\nfor j, index in enumerate(indexes):\n C0 = C[:, index]\n r0 = r[index]\n C_inferred = explicit_inversion(MSV, r, Xi, a_w, psi * 0 + 1, C0, r0)\n for i, phi in enumerate(Phi):\n if i == 0:\n plt.plot(\n C_inferred[i, :], r, lw=2.5 - (j + 1) / 3, label=str(r0), color=color[i]\n )\n else:\n plt.plot(C_inferred[i, :], r, lw=2.5 - (j + 1) / 3, color=color[i])\nplt.xlabel(\"Concentration~[kg/m3]\")\nplt.ylabel(\"Distance from transducer~[m]\")\nax.set_xscale(\"log\")\nplt.xlim([0.2 * C[:, -1].min(), 2.5 * C.max()])\nplt.ylim([0, r.max()])\nax.invert_yaxis()\nsecax = ax.secondary_xaxis(\"top\", functions=(C_to_phi, phi_to_C))\nsecax.set_xlabel(\"Volumic fraction\")\nplt.legend(title=\"Distance of imposed concentration [mm]\")\nplt.title(\"With exponential concentration profiles\")\n\n\nplt.show()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Loading

0 comments on commit 14e37ac

Please sign in to comment.