vibstring_ellipse
Graham Dennis
Vibrating string with Dirichlet boundary conditions on an ellipse.
const real T = 10.0; const real mass = 1e-3; const real length = 1.0; const real mu = mass/length; const real T_mu = T/mu;

const real ellipse_a = 0.9; const real ellipse_b = 0.5; const real ellipse_focus = sqrt(ellipse_a*ellipse_a - ellipse_b*ellipse_b);

t
u uDot
u = exp(-500.0*((x-ellipse_focus)*(x-ellipse_focus) + y*y)); uDot = 0.0;
bc
real r_norm = sqrt(x*x/ellipse_a/ellipse_a + y*y/ellipse_b/ellipse_b);

if ( r_norm > 1.0) bc = 0.0; else bc = 1.0;
50
L
real r_norm = sqrt(x*x/ellipse_a/ellipse_a + y*y/ellipse_b/ellipse_b);

if ( r_norm > 1.0) L = 0.0; else L = 1.0;
main
du_dt = uDot; duDot_dt = L[-T_mu*(kx*kx+ky*ky)*u];
amp
main
amp = Re(u);