problem with matlab bvp4c

5 views (last 30 days)
Yuri
Yuri on 6 Aug 2015
Commented: Adam Barber on 10 Aug 2015
I have to find a trajectory in 3d space of a particle. The initial and final locations of a particle are given The initial velocity and acceleration are given There is gravitational force towards the closest point on some circle in space (the circle is passing through initial and final locations of the particle). There is also a force at every location of the particle acting in direction parallel to the direction of the tangent vector to the circle at the closest point on a circle to this location, also frequency farce. (The forces constants are the parameters to the problem) I solved the same problem with only initial conditions with ode45 got a good result and used the location after time Tf and the same initial and constant parameters with bvp4c The initial guess is the equation of the circle passing through initial and final locations .which derivative at the initial point gives the initial velocity of the particle.
Error using bvp4c (line 251) Unable to solve the collocation equations -- a singular Jacobian encountered.
I can't figure out where is my mistake My code is attached
  3 Comments
Yuri
Yuri on 7 Aug 2015
I reduce the number of boundary conditions to 6 and got this error:
Error using bvparguments (line 111) Error in calling BVP4C(ODEFUN,BCFUN,SOLINIT,P1,P2...): The boundary condition function BCFUN should return a column vector of length 9.
- the number of parameters to optimize in my prublem is 3 then we have
length(testBC) == (neqn*nregions + nparam) - the parameter check command of bvp4c.m
Yuri
Adam Barber
Adam Barber on 10 Aug 2015
Hi Yuri,
If you are having trouble with the "Singular Jacobian" error, this link may prove helpful:
This is a relatively general error and this article has good steps to take to try and solve the problem. It may not be an explicit mistake in your code, but rather that this is a difficult problem to solve.
Hope that helps,
-Adam

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!