0
$\begingroup$

So I am trying to solve:

***DSolve[{Derivative[1][c1][
    t] == (0. - 
      9.48262*10^33 I) ((-2.40987*10^-22 + 4.97993*10^-23 B^2 + 
         1.84752*10^-23 \[Xi]1 + 1.24163*10^-23 \[Xi]2) c1[
        t] + (-3.68681*10^-23 + 3.1645*10^-24 B^2 + 
         2.0369*10^-24 \[Xi]1 + 2.0369*10^-24 \[Xi]2) c2[t]), 
  Derivative[1][c2][
    t] == (0. - 
      9.48262*10^33 I) ((-3.68681*10^-23 + 3.1645*10^-24 B^2 + 
         2.0369*10^-24 \[Xi]1 + 2.0369*10^-24 \[Xi]2) c1[
        t] + (-2.40987*10^-22 + 4.97993*10^-23 B^2 + 
         1.24163*10^-23 \[Xi]1 + 1.84752*10^-23 \[Xi]2) c2[t]), 
  c1[0] == 0.948683, c2[0] == 0.316228}, {c1[t], c2[t]}, t]***

But mathematica does nothing; it just gives me back the expression. What am I doing wrong? Thanks!

$\endgroup$

1 Answer 1

1
$\begingroup$
Clear["Global`*"]

Rationalize the equations

eqns = {Derivative[1][c1][
      t] == (0. - 
        9.48262*10^33 I) ((-2.40987*10^-22 + 4.97993*10^-23 B^2 + 
           1.84752*10^-23 \[Xi]1 + 1.24163*10^-23 \[Xi]2) c1[
          t] + (-3.68681*10^-23 + 3.1645*10^-24 B^2 + 2.0369*10^-24 \[Xi]1 + 
           2.0369*10^-24 \[Xi]2) c2[t]), 
    Derivative[1][c2][
      t] == (0. - 
        9.48262*10^33 I) ((-3.68681*10^-23 + 3.1645*10^-24 B^2 + 
           2.0369*10^-24 \[Xi]1 + 2.0369*10^-24 \[Xi]2) c1[
          t] + (-2.40987*10^-22 + 4.97993*10^-23 B^2 + 
           1.24163*10^-23 \[Xi]1 + 1.84752*10^-23 \[Xi]2) c2[t]), 
    c1[0] == 0.948683, c2[0] == 0.316228} // Rationalize[#, 0] &;

sol = DSolve[eqns, {c1, c2}, t];

Verifying the solutions,

eqns /. sol // Simplify

(* {{True, True, True, True}} *)
$\endgroup$
2
  • $\begingroup$ It worked, thanks a lot! But could you explain why? $\endgroup$ Nov 20, 2020 at 13:33
  • $\begingroup$ Exact solvers (e.g., Solve, Reduce, DSolve) can encounter difficulties in working with approximate real numbers. For example, you may encounter a warning message that Solve was unable to solve an equation with inexact coefficients, that it solved by rationalizing the coefficients, and then numericized the result. However, Mma does not appear to try this workaround with DSolve. Consequently, when DSolve returns unevaluated with approximate real numbers, it is worth trying to solve after converting all equations to exact forms. This won't help in all cases, but did in this case. $\endgroup$
    – Bob Hanlon
    Nov 20, 2020 at 14:01

Your Answer

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

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