I'm new to mathematica and was wondering if someone could help me. I have a differential equation which is:
$\frac{dy}{dx} = 1/2 y(1 - y)(a - y + a y)$
It has initial condition $y(0) = y0$ and it's assumed $0 < a < 1/2$.
So I've been trying to figure out how to use DSolve
. I know the solution $y(x)$ is meant to fall in the range $0 < y(x) < 1$ but DSolve
keeps giving me complex solutions. I'm assuming this is because I haven't provided it any assumptions. Here's what I've tried:
DSolve[{y'[x] ==
1/2 (1 - y[x]) y[x] (a - y[x] + a y[x]), y[0] == y0}, y[x], x]
Which results in:
{{y -> Function[{x},
InverseFunction[(
a Log[1 - #1] + (1 - 2 a) Log[#1] + (-1 + a) Log[
a - #1 + a #1])/(a (-1 + 2 a)) &][-(x/2) + (
a Log[1 - y0] + Log[y0] - 2 a Log[y0] - Log[a - y0 + a y0] +
a Log[a - y0 + a y0])/(a (-1 + 2 a))]]}}
There are a few questions I was wondering someone could help me with:
- Is it possible to pass assumptions to
DSolve
, e.g. to tell it $0 < a < 1/2$ and $0 \leq y \leq 1$? If not how can I handle this in Mathematica - What is the correct ways of assigning the result of
DSolve
to a function whereby I can pass values of $a$, $x_0$ and $x$, e.g. $y(x, x_0, x)$?
InverseFunction
problem: It's similar tohttp://mathematica.stackexchange.com/q/56771
, but the exponential form of your equation has terms of the formy^2
andy^a
. For a generica
, that's hard to solve, unless you're lucky. $\endgroup$