# Solving a time-dependent structural mechanics problem with Finite Element

I'm trying to solve a time-dependent structural mechanics problem with Finite Element. I modified one of the last samples in the "Solving Partial Differential Equations with Finite Elements" Tutorial.

The following equations should ideally represents a beam initially at rest and then stimulated by a sinusoidal force per unit volume directed ad the $y$ axis.

Needs["NDSolveFEM"]

\[CapitalOmega] = Rectangle[{0, 0}, {5, 1}];
mesh = ToElementMesh[\[CapitalOmega]];
mesh["Wireframe"];

op = {Inactive[
Div][({{0, -((Y \[Nu])/(1 - \[Nu]^2))}, {-((Y (1 - \[Nu]))/(
v[x, y, t], {x, y}]), {x, y}] +
Inactive[
Div][({{-(Y/(1 - \[Nu]^2)),
0}, {0, -((Y (1 - \[Nu]))/(2 (1 - \[Nu]^2)))}}.Inactive[
Grad][u[x, y, t], {x, y}]), {x, y}],
Inactive[
Div][({{0, -((Y (1 - \[Nu]))/(2 (1 - \[Nu]^2)))}, {-((
u[x, y, t], {x, y}]), {x, y}] +
Inactive[
Div][({{-((Y (1 - \[Nu]))/(2 (1 - \[Nu]^2))),
v[x, y, t], {x, y}]), {x, y}]} /. {Y -> 10^3, \[Nu] ->
33/100};

Subscript[\[CapitalGamma], D] =
DirichletCondition[{u[x, y, t] == 0., v[x, y, t] == 0.}, x == 0];
ic = {
u[x, y, 0] == 0, v[x, y, 0] == 0,
Derivative[0, 0, 1][u][x, y, 0] == 0,
Derivative[0, 0, 1][v][x, y, 0] == 0
};

{uif, vif} =
NDSolveValue[{op == {0, Sin[t]}, Subscript[\[CapitalGamma], D],
ic}, {u, v}, {x, y} \[Element] mesh, {t, 0, 2 \[Pi]},
Method -> {"PDEDiscretization" -> {"MethodOfLines",
"TemporalVariable" -> t,
"SpatialDiscretization" -> {"FiniteElement"}}}];


My real problem is different and more complex but the result is the same

NDSolveValue::tvic: t cannot be used as the temporal independent variable because the conditions {u[x,y,0]==0,v[x,y,0]==0,(u^(0,0,1))[x,y,0]==0,(v^(0,0,1))[x,y,0]==0} for that dimension do not constitute sufficient initial conditions given at only one value of t. >>

NDSolveValue::ivone: Boundary values may only be specified for one independent variable. Initial values may only be specified at one value of the other independent variable. >>

I tried different forms of the force (also op == {0,0} which should end with the stationary solution) and also adding $t>0$ ad a predicate under DirichletCondition without success.

• I can't look at it right now, try to put t in first position. May 18 '15 at 16:15
• @user21 Thanks, tried, but unfortunately nothing changes. But, sorry, I made some confusions while translating from my real problem to this simplified version, I'l try to update the question soon... May 18 '15 at 17:54

This works:

Needs["NDSolveFEM"]

\[CapitalOmega] = Rectangle[{0, 0}, {5, 1}];
mesh = ToElementMesh[\[CapitalOmega]];
mesh["Wireframe"];

op = {Inactive[
Div][({{0, -((Y \[Nu])/(1 - \[Nu]^2))}, {-((Y (1 - \[Nu]))/(2 \
(1 - \[Nu]^2))), 0}}.Inactive[Grad][v[t, x, y], {x, y}]), {x, y}] +
Inactive[
Div][({{-(Y/(1 - \[Nu]^2)),
0}, {0, -((Y (1 - \[Nu]))/(2 (1 - \[Nu]^2)))}}.Inactive[
Grad][u[t, x, y], {x, y}]), {x, y}],
Inactive[
Div][({{0, -((Y (1 - \[Nu]))/(2 (1 - \[Nu]^2)))}, {-((Y \
\[Nu])/(1 - \[Nu]^2)), 0}}.Inactive[Grad][u[t, x, y], {x, y}]), {x,
y}] + Inactive[
Div][({{-((Y (1 - \[Nu]))/(2 (1 - \[Nu]^2))),
v[t, x, y], {x, y}]), {x, y}]} /. {Y -> 10^3, \[Nu] ->
33/100};

Subscript[\[CapitalGamma], D] =
DirichletCondition[{u[t, x, y] == 0., v[t, x, y] == 0.}, x == 0];
ic = {u[0, x, y] == 0, v[0, x, y] == 0};

{uif, vif} =
NDSolveValue[{D[{u[t, x, y], v[t, x, y]}, t] + op == {0, Sin[t]},
Subscript[\[CapitalGamma], D], ic}, {u, v}, {t, 0,
2 \[Pi]}, {x, y} \[Element] mesh,
Method -> {"PDEDiscretization" -> {"MethodOfLines",
"TemporalVariable" -> t,
"SpatialDiscretization" -> {"FiniteElement"}}}]


You only need to specify derivatives of the initial condition up to degree one less then the time derivative - zero in this case. (For a wave equation, you'd specify the first derivative of the initial condition)

• I'm very sorry for posting this stupid question. And of course you are right, the initial condition on speed is not necessary. When translating from my real problem to a simplified version to poste here I forgot to include the inertial forces, i.e. the right Cauchy's equation of motion is something like op + {0 - Derivative[2, 0, 0][u][t, x, y], Sin[t] - Derivative[2, 0, 0][v][t, x, y]} == {0, 0} and with this equation the ic on speed are required and NDSolve doesn't complain. My real problem is still there, but is not related with this question at this point. Thanks and sorry again. May 18 '15 at 18:29
• @unlikely, that's alright. Sometimes this happens when one tries to simplify things. I am looking forward to see your final application ;-) May 18 '15 at 18:32
• It is mandatory to put t independent variable before {x,y} or {x,y,z} spatial variables? It appears that the error messages are related to the use of [x,y,z,t] as arguments for unknowns... I'm develoving different models for my problem, (2D stationary, 3D stationary, and 3D time dependent) so for me it is more natural to add independent variables of more realistic model at the end, at least for the final resulting InterpolatingFunction(s)... May 19 '15 at 8:33
• @unlikely, for now yes. It works for some cases to have the t last but not all yet. May 19 '15 at 13:00