2
$\begingroup$

can anyone please help solving this simple coupled differential equations analytically? The solution should be some cosine actually..

x1Eqn = {x1'[t] == I*omr*(Conjugate[x2[t]] - x2[t]), x1[0] == 1}
x2Eqn = {x2'[t] == -I*omr*(2*x1[t] - 1.0), x2[0] == 0}

constXSol = DSolve[{x1Eqn, x2Eqn}, {x1[t], x2[t]}, t]
```
$\endgroup$
3
  • $\begingroup$ Mathematica evaluates constXSol={} ! No solution exists! $\endgroup$ Oct 19, 2022 at 12:13
  • $\begingroup$ First, use 1 instead of 1.0. Second, what is omr? Is it supposed to be a real number? Third, if you remove initial conditions x1[0] == 1 and x2[0] == 0, you will get a solution, but it is non-elementary, with integrals. Lastly, are you sure you have your equations right? Where did you get the "cosine" solution? $\endgroup$
    – Domen
    Oct 19, 2022 at 12:16
  • $\begingroup$ this simple coupled differential I do not think this is simple. $\endgroup$
    – Nasser
    Oct 19, 2022 at 12:18

2 Answers 2

2
$\begingroup$

My guess is that Conjugate[] is difficult to deal with. So would be Im[] if you simplified the first equation. It's probably best to break the variables down into real and imaginary parts:

neweqs = {x1Eqn, x2Eqn} /. 
       {x1 -> Function[t, x1R[t] + I x1I[t]], 
        x2 -> Function[t, x2R[t] + I x2I[t]]} //
      Map[ReIm, #, {3}] & //
     Simplify[#, {x1R[t], x1R'[t], x1I[t], x1I'[t], x2R[t], x2R'[t], 
        x2I[t], x2I'[t], x1R[0], Derivative[1][x1R][0], x1I[0], 
        Derivative[1][x1I][0], x2R[0], Derivative[1][x2R][0], x2I[0], 
        Derivative[1][x2I][0], t, omr} \[Element] Reals] & //
   Map[Thread, #, {2}] & //
  Flatten
(*
{Derivative[1][x1R][t] == 2 omr x2I[t], 
  Derivative[1][x1I][t] == 0, 
  x1R[0] == 1, x1I[0] == 0, 
 Derivative[1][x2R][t] == 2 omr x1I[t], 
  Derivative[1][x2I][t] == omr - 2 omr x1R[t], 
  x2R[0] == 0, x2I[0] == 0}
*)

DSolve[neweqs, {x1R[t], x1I[t], x2R[t], x2I[t]}, t]
(*
{{x1R[t] -> 1/2 (Cos[2 omr t] + Cos[2 omr t]^2 + Sin[2 omr t]^2), 
  x2I[t] -> -(1/2) Sin[2 omr t], 
  x1I[t] -> 0, 
  x2R[t] -> 0}}
*)

Note: I changed the floating-point 1.0 to an exact 1 in the OP's system.

$\endgroup$
1
  • $\begingroup$ ComplexExpand won't simplify the derivatives Re[x1R'[t]] etc. although it will simplify Re[x1R[t]] -- anyone know a short way to get it to do so? $\endgroup$
    – Michael E2
    Oct 19, 2022 at 12:50
2
$\begingroup$

As pointed out in MichaelE2's answer, the problem is the Conjugate. An alternative to introducing real and imaginary parts is to introduce new names for the complex conjugates, I call them x1c and x2c, and solve the system for all four unknown:

{x1[t],x2[t]}/.DSolve[{
                 x1'[t] ==  I*omr*(x2c[t]-x2[t]), x1[0] == 1,
                x1c'[t] == -I*omr*(x2[t]-x2c[t]), x1c[0] == 1,
                 x2'[t] == -I*omr*(2*x1[t]-1), x2[0] == 0,
                x2c'[t] ==  I*omr*(2*x1c[t]-1), x2c[0] == 0
},{x1,x1c,x2,x2c},t]//FullSimplify

(* {{Cos[omr t]^2, -(1/2) I Sin[2 omr t]}} *)

In this case I wrote down the differential equations for x1c and x2c by hand, this could in principle be automated. Also, I assumed omr is real.

$\endgroup$

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.