3
$\begingroup$

I'm confused about the output Mathematica is giving me when solving a boundary value problem of the form:

eq = ϵ y''[t] + 2 y'[t] + 2 y[t] == 0;
bc1 = y[0] == 0;
bc2 = y[1] == 1;

aSol = y[t] /. DSolve[{eq, bc1, bc2}, y[t], t][[1]][[1]]

This yields the correct answer, and produces plots like this for ep=1, ep=0.1, and ep=0.01.

Plot[{
  aSol /. ϵ -> 1,
  aSol /. ϵ -> 0.1,
  aSol /. ϵ -> 0.01},
 {t, 0, 1}, Frame -> True, FrameLabel -> {"t", "y(t)"}]

enter image description here

So far, so good!

However, if I simply ask Mathematica to FullSimplify[aSol], the resulting solution is no longer correct, and it does not satisfy one of the boundary conditions:

aSolSimpl = FullSimplify[aSol]

Plot[{
  aSol /. ϵ -> 0.05,
  aSolSimpl /. ϵ -> 0.05
  }, {t, 0, 1}, Frame -> True, FrameLabel -> {"t", "y(t)"}]

enter image description here

What's going wrong here?

$\endgroup$
  • $\begingroup$ i think because you assign Epsilon different values. i used Full Simplify and it was fine with me use it as follow to check aSol = y[t] /. DSolve[{eq, bc1, bc2}, y[t], t] /. [Epsilon] -> 1 aSolSimpl = FullSimplify[aSol] /. [Epsilon] -> 1 Plot[{aSol}, {t, 0, 1}, Frame -> True, FrameLabel -> {"t", "y(t)"}] Plot[{aSolSimpl}, {t, 0, 1}, Frame -> True, FrameLabel -> {"t", "y(t)"}] $\endgroup$ – Alrubaie Mar 21 at 15:19
  • 1
    $\begingroup$ @dpholmes Plotting Plot3D[Evaluate[{aSol, FullSimplify[aSol, \[Epsilon] > 0]}], {t, 0, 1}, {\[Epsilon], 0, 1}] reveals that it might be a precision problem. $\endgroup$ – Henrik Schumacher Mar 21 at 15:20
5
$\begingroup$

This behavior seems due to precision problems, as Henrik suggested in comments:

aSol = DSolveValue[{eq, bc1, bc2}, y[t], t];
aSolSimpl = FullSimplify[aSol];

Plot[Evaluate[aSol /. ϵ -> {1, 1/10, 1/100}], {t, 0, 1}]

Plot[
 Evaluate[aSolSimpl /. ϵ -> {1, 1/10, 1/100}], {t, 0, 1},
 WorkingPrecision -> $MachinePrecision
]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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