0
$\begingroup$
eq=D[f[x,y],y]+ f[x,y]/y == Q[x,y]

The equation doesn't have any derivative with respect to x. If I use the following syntax for NDSolve will it give me the correct result?

NDSolve[{eq, boundary condition},{x,x_min,x_max},{y,y_min,y_max}]
$\endgroup$
  • 1
    $\begingroup$ Have you defined the value of $Q$? NDSolve is a numerical solver so everything must reduce to a numerical value for it to work. Also, have you tried to run your syntax and see what happens? $\endgroup$ – MarcoB Feb 7 at 13:52
  • $\begingroup$ Yes, I have defined Q numerically. My syntax is working but the answer I am getting from it is not the one I am looking for. I want to know if this syntax works properly for my differential equation. $\endgroup$ – Prantik Sarmah Feb 8 at 11:15
  • 2
    $\begingroup$ Prantik, you should include the definition of $Q$, the results you get from the NDSolve, and your reason why those results do not make sense to you. It’s hard to help further otherwise. $\endgroup$ – MarcoB Feb 8 at 17:58
  • $\begingroup$ The form of Q is "y x^-2" kind. The exact expression is difficult to write here. $\endgroup$ – Prantik Sarmah Feb 10 at 4:19
1
$\begingroup$

Some insight can be obtained by solving this differential equation symbolically.

DSolveValue[eq, f[x, y], {x, y}]
(* C[1][x]/y + Inactive[Integrate][K[1]*Q[x, K[1]], {K[1], 1, y}]/y *)

If Q[x,y] is given by y/x^2, the solution reduces to

(* y^2/(3*x^2) + C[1][x]/y *)

And, to answer the question explicitly posed, the code in the question should yield the correct answer, barring numerical instabilities and the like.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thank you very much for your help $\endgroup$ – Prantik Sarmah Feb 12 at 6:04

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