2

I have the following ODE

c + (p + r) y[p] == p (u + (-1 + p) y'[p])

where car and u are parameters of the problem. I want to solve the ODE using a symbolic initial condition y(0)=x for some x, or also to impose an initial condition of the form y(z)=x where both x and y are symbols. For both these issues I tried to do DSolve, getting the solution with the constant C[1] and then using Solve[y(0)==x, c[1]] but I get error. I guess I should define a function y which maps p and c[1] and use that in Solve. Is there any straightforward way to do this?

ensue
  • 63
  • 4
  • There are some mistakes in the code. If you try the o.d.e without a boundary condition you get an answer sol = DSolveValue[{c + (p + r) y[p] == p (u + (-1 + p) y'[p])}, y[p], {p, 0, 1}] // FullSimplify and then taking the limit Limit[sol, p -> 0] you should be able to see something – bmf Apr 11 '22 at 00:22
  • Another comment: you should NOT be using K --- see this answer. – bmf Apr 11 '22 at 00:25
  • Your syntax is also wrong. You need {...} around the ode and the bc. Also you really do not need to say {p,0,1} as this is analytical solution. You are not using NDSolve here. Try this from clean systemode = c + (p + r) y[p] == p (u + (-1 + p) y'[p]); ic = y[0] == k; DSolve[{ode, ic}, y[p], p] which gives {} as solution. – Nasser Apr 11 '22 at 01:34
  • Your IC does not give solution. If you do this sol = DSolveValue[ode, y[p], p] then eq = k == Limit[sol, p -> 0] // InputForm it will give ConditionalExpression[k == ComplexInfinity, Element[c | u, Reals] && r > 1 && C[1] > 0] so it is not possible to solve the constant for the integration C[1] that is why Mathematica can't find solution. If you copied from this a book, make sure you copied the IC correctly. – Nasser Apr 11 '22 at 01:41
  • thank you for your comments. I am totally new to mathematic and I need this for my research. I edited the question to make it more meaningful. – ensue Apr 11 '22 at 18:10

0 Answers0