I generally have a lot of trouble getting Mathematica to produce readable versions of solutions.
For example, today, when solving a symbolic system of homogenous ODEs (with boundaries provided as constants), Mathematica provides one of the two of my solutions with the following output form:
exp = (p0 (E^((I k z (Ωc^2 + Ωd^2 -
Sqrt[Ωc^4 -
2 Ωc^2 Ωd^2 +
4 E^(I θc +
I θd) Ωc^2 Ωd^2 + \ Ωd^4]))/(2 Den L)) Ωc^2 -
E^((I k z (Ωc^2 + Ωd^2 +
Sqrt[Ωc^4 -
2 Ωc^2 Ωd^2 +
4 E^(I θc +
I θd) Ωc^2 Ωd^2 + \ Ωd^4]))/(2 Den L)) Ωc^2 -
E^((I k z (Ωc^2 + Ωd^2 -
Sqrt[Ωc^4 -
2 Ωc^2 Ωd^2 +
4 E^(I θc +
I θd) Ωc^2 Ωd^2 + \ Ωd^4]))/(2 Den L)) Ωd^2 +
E^((I k z (Ωc^2 + Ωd^2 +
Sqrt[Ωc^4 -
2 Ωc^2 Ωd^2 +
4 E^(I θc +
I θd) Ωc^2 Ωd^2 + \ Ωd^4]))/(2 Den L)) Ωd^2 +
E^((I k z (Ωc^2 + Ωd^2 -
Sqrt[Ωc^4 -
2 Ωc^2 Ωd^2 +
4 E^(I θc +
I θd) Ωc^2 Ωd^2 + \ Ωd^4]))/(
2 Den L)) √(Ωc^4 -
2 Ωc^2 Ωd^2 +
4 E^(I θc +
I θd) Ωc^2 Ωd^2 + \ Ωd^4) +
E^((I k z (Ωc^2 + Ωd^2 +
Sqrt[Ωc^4 -
2 Ωc^2 Ωd^2 +
4 E^(I θc +
I θd) Ωc^2 Ωd^2 + \ Ωd^4]))/(
2 Den L)) √(Ωc^4 -
2 Ωc^2 Ωd^2 +
4 E^(I θc +
I θd) Ωc^2 Ωd^2 + \ Ωd^4)))/(2 √(Ωc^4 -
2 Ωc^2 Ωd^2 +
4 E^(I θc +
I θd) Ωc^2 Ωd^2 + \ Ωd^4)); exp2 =
In my opinion this is "messy." If you look at the output, you can see visually that there are some very "big" terms (which are actually the eigenvalues of the ODE system) that are repeated instead of being simplified.
Ideally I would like to have Mathematica self-identify that these expressions and do the simplification for me. But if that's not possible, then I just want to come up with symbols that reduce my system into a more readable form. Any tips or ideas how I can do that?
Here are some of my unsuccessful attempts to try to get Mathematica to put it in a better form:
Refine[exp, Element[#,
Reals] & /@ {Ωc, Ωd, θc, \ θd, k, p0, s0, L, Den}] Simplify[exp2, √(Ωc^4 -
2 Ωc^2 Ωd^2 +
4 E^(I θc +
I θd) Ωc^2 Ωd^2 + \ Ωd^4) == b]