0
$\begingroup$

I am new to Mathematica in general. Just trying to solve a couple of coupled ODES. Dont really understand the error it throws.

DSolve[{y'[t] == A*x[t]/((x[t]^2 + y[t]^2)*(1 - R/Sqrt[(x[t]^2 + y[t]^2)])), 
  x'[t] == A*y[t]/((x[t]^2 + y[t]^2)*(1 - R/Sqrt[(x[t]^2 + y[t]^2)])),
   x[0] == 1, y[0] == 1}, {x, y}, t, 
 Assumptions -> x \[Element] Reals, y \[Element] Reals].

This gives the error "DSolve::derlen: The length of the derivative operator Derivative[1] in y'[t] is not the same as number of arguements." Now this system actually has a singularity if x^2+y^2=R. I just don't understand how to put in that as an assumption. I have tried "Assumptions-> x[t]^2+y[t]^2<R", it doesnt work. Moreover I have a physical understanding that if the system starts at x[0]=1 and y[0]=1 it should not reach this singularity since the solution would go in a circle around the centre. I might have made some superflous errors as well, so I am grateful for any help

$\endgroup$
3
  • 1
    $\begingroup$ Put braces {} around assumptions: Assumptions -> {…..} $\endgroup$
    – Michael E2
    Commented Jun 24, 2021 at 1:28
  • $\begingroup$ You might want to report this to WRI as a bug. It probably ought to do a better job of parsing here, because an option precedes the Element[y, Reals] argument that looks like a domain spec. It’s an unhelpful error message in any case. $\endgroup$
    – Michael E2
    Commented Jun 24, 2021 at 1:32
  • 1
    $\begingroup$ Miraculously, DSolve can find the general solution (remove the initial conditions). You’ll have to solve for the integration parameters yourself. The solutions is rather complicated and it might be difficult. $\endgroup$
    – Michael E2
    Commented Jun 24, 2021 at 1:42

1 Answer 1

1
$\begingroup$

Try “homogeneous” initial conditions:

DSolve[{y'[t] == A*x[t]/((x[t]^2 + y[t]^2)*(1 - R/Sqrt[(x[t]^2 + y[t]^2)])), 
  x'[t] == A*y[t]/((x[t]^2 + y[t]^2)*(1 - R/Sqrt[(x[t]^2 + y[t]^2)])),
   x[0] == a*R, y[0] == b*R}, 
 {x, y}, t]
(* long output *)

It gives two solutions, perhaps from rationalizing the square roots. You should check which satisfy a particular initial conditions.

$\endgroup$
3
  • $\begingroup$ I tried it with some numerical value of R and A,with a,b<1 and x,y=Real, then it gives errors which state "For some branches of the general solution, the given boundary \ conditions lead to an empty solution" and "Unable to resolve some of the arbitrary constants in the general \ solution using the given boundary conditions. It is possible that \ some of the conditions have been specified at a singular point for \ the equation.". Which is interesting because if it starts from some radius lower than R and x and y are real then it should not hit singularity. $\endgroup$ Commented Jun 24, 2021 at 23:03
  • $\begingroup$ @SarthakChoudhury The boundary conditions are not easy equations to solve symbolically. I would check the DSolve solution from my code against NDSolve for numerical values of R etc. You can plug values in with mysol /. {R -> 2} and so forth. I wouldn't plug the numerical values into the ODEs and call DSolve again. (I guess I might try it, but I'm not surprised DSolve had trouble.) $\endgroup$
    – Michael E2
    Commented Jun 24, 2021 at 23:27
  • $\begingroup$ Thanks a lot @Michael E2. I really appreciate your help $\endgroup$ Commented Jun 25, 2021 at 1:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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