0
$\begingroup$

I have the following ODE

Bfull'[t] == - (p0/(
    p0 + (1 - p0) E^Integrate[α[s], {s, 0, t}])) * α[
    t] (S[t] - Bfull[t]) + α[t]*c + δ * Bfull[t]

where α and S are some functions. I would like the solution to integrate from 0, instead of 1, which is the default of mathematica.

$\endgroup$
1
  • $\begingroup$ Did you try to specify α[s] and α[t] and S[t]? $\endgroup$
    – user64494
    Apr 29, 2022 at 16:59

2 Answers 2

2
$\begingroup$

I would like the solution to integrate from 0, instead of 1

Clear["Global`*"]
ode = Bfull'[
   t] == -(p0/(p0 + (1 - p0) E^
           Integrate[\[Alpha][s], {s, 0, t}]))*\[Alpha][
     t] (S[t] - Bfull[t]) + \[Alpha][t]*c + \[Delta]*Bfull[t]
sol = Bfull[t] /. First@DSolve[ode, Bfull[t], t]

Mathematica graphics

Then

sol /. Inactive[Integrate][any_, {any2_, 1, t}] :> 
  Inactive[Integrate][any, {any2, 0, t}]

Mathematica graphics

If you want also the integrals that have K[1] and K[2] to start from 0, then do the same for these.

sol /. Inactive[Integrate][any_, {any2_, 1, K[1]}] :> 
  Inactive[Integrate][any, {any2, 0, K[1]}]
$\endgroup$
2
$\begingroup$

I used a dummy variable in DSolve returning "Indeterminate" to set location of the initial condition, which in turn sets the starting point for an unevaluated integral.

But in this case we could just set an initial condition for Bfull with an arbitrary parameter, and DSolve can still handle the system:

DSolve[
 {Bfull'[t] == -(p0/(p0 +
    (1 - p0) E^Integrate[α[s], {s, 0, t}]))*
    α[t] (S[t] - Bfull[t]) + α[t]*c + δ*Bfull[t], 
  Bfull[0] == B0},
 Bfull, t]

Mathematica graphics

$\endgroup$

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.