1
$\begingroup$

I am trying to solve the PDE for longitudinal vibrations in a bar (as shown for example at Youtube Longitudinal Bar Vibration). My challenge is the application I am trying to solve has these boundary conditions:

Left(x=0) end free; Right end(x=len) forced sinusoidal displacement.

ClearAll[len, ρ, Y, c, x, t, tmax, z]
len = 1; (*meter *)
tmax = 5;
ρ = 7860; (*kg/m^3 for steel*)
Y = 199*^9; (*Newtons/m^2*)
c = Sqrt[Y/ρ];

nsol11 = NDSolve[Derivative[0, 2][z][x, t] == NeumannValue[0, x == 0] + 
    (ρ*Derivative[2, 0][z][x, t])/Y,
    z[len, t] == 0.005*Sin[1*t]}, z[x, t], {x, 0, len}, {t, 0, tmax},
    Method -> {"PDEDiscretization" -> {"FiniteElement"}}]
fnnsol11[x_, t_] = nsol11[[1, 1, 2]];

Plot3D[fnnsol11[x, t], {x, 0, len}, {t, 0, tmax}, 
 PlotLabels -> Automatic, AxesLabel -> Automatic, PlotRange -> All,  
 PlotLabel -> "Displacement vs. Time", 
 ColorFunction -> "TemperatureMap", PerformanceGoal -> "Quality", 
 PlotPoints -> 150]

The problem I have is it solves, but the "free" left end is not oscillating like the forced displacement right end. With the input values used (a 1m long steel bar) the input and output should very closely match in phase and magnitude. My understanding is applying the free boundary condition as a NeumannValue[] was the proper way to do it as learned from this question.NDsolve related problem

In summary, my question is how can I properly apply a free and forced displacement boundary condition to the PDE for a longitudinal vibration in a rod?

Thank You

$\endgroup$
5
  • $\begingroup$ I believe that the ODE should be NDSolve[Derivative[0, 2][z][x, t] == c^2 Derivative[2, 0][z][x, t]. As written in the question, c^2 is replaced by c^-2. By the way, your usage of the Newton condition is fine. $\endgroup$
    – bbgodfrey
    Commented May 2, 2020 at 18:54
  • $\begingroup$ Welcome to Mathematica.SE! I hope you will become a regular contributor. To get started, 1) take the introductory tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign, and 4) give help too, by answering questions in your areas of expertise. $\endgroup$
    – bbgodfrey
    Commented May 2, 2020 at 18:56
  • $\begingroup$ Thank you @bbgodfrey for the help. You absolutely solved my problem. Fantastic! $\endgroup$
    – wpilgri
    Commented May 3, 2020 at 3:35
  • $\begingroup$ Your NDSolve FEM options does not do what you think it does. Have a look at the FiniteElementOptions tutorial to learn more. $\endgroup$
    – user21
    Commented May 4, 2020 at 5:22
  • $\begingroup$ I'll read up for sure and thanks for the reference, but can you be more specific to help point me in the right direction? As a new user it's a bit like drinking from a firehose. Thank you. $\endgroup$
    – wpilgri
    Commented May 4, 2020 at 21:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.