1
$\begingroup$

My input is: DSolve[{m*n1''[t] + k*n1[t] - k*n2[t] == f*E^(I*w*t), m*n2''[t] - k*n1[t] + 2*k*n2[t] - k*n3[t] == 0, m*n3''[t] - k*n2[t] + k*n3[t] == 0}, {n1[t], n2[t], n3[t]}, t] What's wrong with me? Thanks.

$\endgroup$
2
  • $\begingroup$ E^[I*w*t] should read: E^(I*w*t) $\endgroup$ Commented Nov 30, 2022 at 19:13
  • $\begingroup$ I changed into E^(Iwt) but still failed. $\endgroup$ Commented Nov 30, 2022 at 19:17

1 Answer 1

3
$\begingroup$
$Version

(* "13.1.0 for Mac OS X x86 (64-bit) (June 16, 2022)" *)

Clear["Global`*"]

eqns = {m*n1''[t] + k*n1[t] - k*n2[t] == f*E^(I*w*t), 
   m*n2''[t] - k*n1[t] + 2*k*n2[t] - k*n3[t] == 0, 
   m*n3''[t] - k*n2[t] + k*n3[t] == 0};

(sol = DSolve[eqns, {n1, n2, n3}, t]) // Short[#, 5] &

enter image description here

Verifying the solutions,

eqns /. sol // Simplify

(* {{True, True, True}} *)

Simplifying the solutions,

solt = {n1[t], n2[t], n3[t]} /. sol // FullSimplify

(* {{1/18 (6 (-((3 E^(I t w) f (k^2 - 3 k m w^2 + m^2 w^4))/(
         m w^2 (3 k^2 - 4 k m w^2 + m^2 w^4))) + C[1] + C[3] + C[5] + 
        t (C[2] + C[4] + C[6])) + 9 (C[1] - C[5]) Cos[(Sqrt[k] t)/Sqrt[m]] + 
     3 (C[1] - 2 C[3] + C[5]) Cos[(Sqrt[3] Sqrt[k] t)/Sqrt[m]] + (
     Sqrt[m] (9 (C[2] - C[6]) Sin[(Sqrt[k] t)/Sqrt[m]] + 
        Sqrt[3] (C[2] - 2 C[4] + C[6]) Sin[(Sqrt[3] Sqrt[k] t)/Sqrt[m]]))/
     Sqrt[k]), 
  1/9 (-3 (C[1] - 2 C[3] + C[5]) Cos[(Sqrt[3] Sqrt[k] t)/Sqrt[
       m]] + (-9 f k^(3/2) Cos[t w] + 
        m w^2 (-3 k + 
           m w^2) (-3 Sqrt[k] (C[1] + C[3] + C[5] + t (C[2] + C[4] + C[6])) + 
           Sqrt[3] Sqrt[
            m] (C[2] - 2 C[4] + C[6]) Sin[(Sqrt[3] Sqrt[k] t)/Sqrt[m]]) - 
        9 I f k^(3/2) Sin[t w])/(Sqrt[k] m w^2 (3 k - m w^2))), 
  1/18 (6 (-((3 E^(I t w) f k^2)/(3 k^2 m w^2 - 4 k m^2 w^4 + m^3 w^6)) + C[
        1] + C[3] + C[5] + t (C[2] + C[4] + C[6])) + 
     9 (-C[1] + C[5]) Cos[(Sqrt[k] t)/Sqrt[m]] + 
     3 (C[1] - 2 C[3] + C[5]) Cos[(Sqrt[3] Sqrt[k] t)/Sqrt[m]] + (
     Sqrt[m] (9 (-C[2] + C[6]) Sin[(Sqrt[k] t)/Sqrt[m]] + 
        Sqrt[3] (C[2] - 2 C[4] + C[6]) Sin[(Sqrt[3] Sqrt[k] t)/Sqrt[m]]))/
     Sqrt[k])}} *)

Making use of Sinc

solt2 = solt /. Sin[x_] :> x*Sinc[x] // Simplify

(* {{1/6 (-((6 E^(I t w) f (k^2 - 3 k m w^2 + m^2 w^4))/(
      m w^2 (3 k^2 - 4 k m w^2 + m^2 w^4))) + 2 C[1] + 2 C[3] + 
     2 C[5] + 2 t (C[2] + C[4] + C[6]) + 
     3 (C[1] - C[5]) Cos[(Sqrt[k] t)/Sqrt[
       m]] + (C[1] - 2 C[3] + C[5]) Cos[(Sqrt[3] Sqrt[k] t)/Sqrt[
       m]] + 3 t (C[2] - C[6]) Sinc[(Sqrt[k] t)/Sqrt[m]] + 
     t (C[2] - 2 C[4] + C[6]) Sinc[(Sqrt[3] Sqrt[k] t)/Sqrt[m]]), 
  1/9 (-3 (C[1] - 2 C[3] + C[5]) Cos[(Sqrt[3] Sqrt[k] t)/Sqrt[
       m]] + (-9 f k^(3/2) Cos[t w] + 
        m w^2 (-3 k + 
           m w^2) (-3 Sqrt[
            k] (C[1] + C[3] + C[5] + t (C[2] + C[4] + C[6])) + 
           3 Sqrt[k]
             t (C[2] - 2 C[4] + C[6]) Sinc[(Sqrt[3] Sqrt[k] t)/Sqrt[
             m]]) - 9 I f k^(3/2) t w Sinc[t w])/(Sqrt[k]
         m w^2 (3 k - m w^2))), 
  1/6 (-((6 E^(I t w) f k^2)/(3 k^2 m w^2 - 4 k m^2 w^4 + m^3 w^6)) + 
     2 C[1] + 2 C[3] + 2 C[5] + 2 t (C[2] + C[4] + C[6]) + 
     3 (-C[1] + C[5]) Cos[(Sqrt[k] t)/Sqrt[
       m]] + (C[1] - 2 C[3] + C[5]) Cos[(Sqrt[3] Sqrt[k] t)/Sqrt[
       m]] + 3 t (-C[2] + C[6]) Sinc[(Sqrt[k] t)/Sqrt[m]] + 
     t (C[2] - 2 C[4] + C[6]) Sinc[(Sqrt[3] Sqrt[k] t)/Sqrt[m]])}} *)
$\endgroup$
1
  • $\begingroup$ Thank you so much! $\endgroup$ Commented Dec 26, 2022 at 23:17

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.