Skip to main content
1-Visitor
July 31, 2012
Solved

flood calculation

  • July 31, 2012
  • 1 reply
  • 2442 views

Hi,

I am trying to solve differential equations with ODE solver. In defining the solver, there is always a message " the number of rows returned from the function arguments does not match the number of equations to be solved.

Anyone can help?

Thanks

Krisnandito

Best answer by AlanStevens

AlanStevens wrote:

... I suspect one of your square root terms becomes imaginary (probably the H4-Hmcr term which is close to zero at 620 seconds) and odesolve doesn't like this.

Yes, if you prevent H4-Hmcr from going negative it works ok - see attached. In the attached I set H4-Hmcr to zero if it tries to go negative. This might or might not be the right thing to do physically for your flood scenario.

Alan

1 reply

19-Tanzanite
August 1, 2012

Set tend to no more than 620 seconds and it works fine. After that I suspect one of your square root terms becomes imaginary (probably the H4-Hmcr term which is close to zero at 620 seconds) and odesolve doesn't like this. The error message is not helpful!

Alan

19-Tanzanite
August 1, 2012

AlanStevens wrote:

... I suspect one of your square root terms becomes imaginary (probably the H4-Hmcr term which is close to zero at 620 seconds) and odesolve doesn't like this.

Yes, if you prevent H4-Hmcr from going negative it works ok - see attached. In the attached I set H4-Hmcr to zero if it tries to go negative. This might or might not be the right thing to do physically for your flood scenario.

Alan

1-Visitor
August 1, 2012

Thanks Alan. This is really helpful

I modified the equation little bit knowing that Hmcr tent to have higher level than H4 by using Hmcr-H4 if Hmcr

Krisnandito