logistic differential equation
Using:
y = function('y', x)
desolve(diff(y,x) == y*(100-y), y)
results in
-1/100*log(y(x) - 100) + 1/100*log(y(x)) == _C + x
This is correct but not very helpful. I found out that "manually" feeding the answer above to solve() changing _C to a defined variable and the function y(x) for a variable and using the argument to_poly_solve=True gives the expected result: y == 100e^(100C + 100x)/(e^(100C + 100*x) - 1)
But I cannot get it to work in one calculation like this:
y = function('y', x)
de = diff(y,x) == y*(100-y)
sol=desolve(de,y)
print("Not so nice:")
sol
print("Better:")
solve(sol, y, to_poly_solve=True)
Would like to know:
a) Is there a way to get desolve or similar solver to return the y= answer directly?
b) If not a) how do I make the desolve -> solve calculation without manually rewriting the solution?