Warning during integration: Matrix is close to singular or badly scaled

4 views (last 30 days)
I have multiple doubts in this regard.
My system components are best represented as matrices (three coupled components in a physical unit which interact with different neighboring units [an array of units]).
But to pass it to an ODE solver I need vectorize the output of the odefun. This also requires me to convert y that is passed to odefun into a matrix which I implement using vec2mat. The vector size comes to ~1800. I was using ode23s with RelTol = 1e-5 and AbsTol = 1e-6
With a computer config of 2x2GHz-4-core processor and 8GB RAM the equation is taking a long time to solve and the solver starts giving a warning "Matrix is close to singular or badly scaled". The solution is also not in the expected range.
I have the following doubts:
1. Which ode solver to use (i was thinking of using 113 because I dont expect the system to be very stiff along with setting NonNegative on)
2. Will quadv be a better option
3. Is there any other way to reduce computation time
  3 Comments
Bharat
Bharat on 27 Nov 2012
a single unit in an array consists of three coupled equations with basically three variables. This equation is also coupled with same variables of the adjacent unit. Maximum no of neighbors is 6.
equation is of the form:
dN i /dt = a1 + b1.N i + c1[N i <D j > i]
dD i /dt = a2 + b2.D i + c2[D i <N j > i]
.....
where <Y j > i means the average of Y amongst neighbors of unit 'i'
On an average there will be about 1800x3x6 rate calculations. But the vector still is 1800 dimensional because it represents 3 components in a 12x50 array of coupled units.

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!