Simulation of the Fender Rhodes
This section describes the port-Hamiltonian modeling of the Fender Rhodes Piano and gives some audio examples.
This section describes the port-Hamiltonian modeling of the Fender Rhodes Piano and gives some audio examples.
RLC
Python itself does not provide usefool ttools for numerical computations. So we have to import them. Ther is several ways to import modules:
from module import *
f1
and f2
from a given module
withfrom module import f1, f2
import module as label
# Load Plot module
import matplotlib.pyplot as plt
# This line configures matplotlib to show figures embedded in the notebook,
# instead of poping up a new window.
%pylab inline
# Load numerical module
import numpy as np
eps = np.spacing(1) # numerical precision
import seaborn
On souhaite afficher la courbe $A\sin(2\pi f_0t)$ pour $t\in [0,1]$. Tout d'abord on définit un signal $s(f_0)=A\sin(2\pi f_0t)$, puis on l'utilise récursivement.
# Time Vector
t = np.linspace(0,1,300)
# Signal function
A = 10 # Amplitude (V)
s = lambda f0: A*np.sin(2*np.pi*f0*t)
# Plot for a list of f0
for f0 in np.linspace(1,2,3):
label = '$f_0=$'+str(f0)
plt.plot(t, s(f0), label=label)
# Plot axis
plt.xlabel('Temps (s)')
plt.ylabel('Amplitude (V)')
# Plot label and legend
plt.title('$\sin(2\pi f_0 t)$')
plt.legend(loc=0) # option loc=0 set location with minimal overlap
# Show the plot
plt.show()
Ici on somme les trois signaux pour visualiser une forme d'onde complexe i.e. nonpure.
plt.plot(t, [np.sum(e) for e in zip(*[s(f0) for f0 in [1,2,3]])], label='$\sum_{i=1}^3 S_i(t)$')
# Plot axis
plt.xlabel('Temps (s)')
plt.ylabel('Amplitude (V)')
# Plot label and legend
plt.title('$\sin(2\pi f_0 t)$')
plt.legend(loc=1) # option loc=0 set location with minimal overlap
# Show the plot
plt.show()
Write your post here.
Here we details the pH approach to the passive modeling and simulation of complex, multiphysics systems.
- We recall some notions from system theory (state space, passivity, lyapunov function, etc.)
- We give the port-Hamiltonian structure as introuced by A.J. Van der Schaft and B. Maschke
- We show how to build this structure automatically from a netlits description.