Error in ODE15s

2 次查看(过去 30 天)
Ranjeev Kumar Bhatia
I am trying to solve Richards equation for 1D soil column. All the state variables are vectorized. and the functions are defined below the main body of the code. Since the ode is of the form M(t,y)*dy/dt = f(t,y). We can define M(t,y) using the ode options structure i.e. options =odeset('RelTol',1e-6,'AbsTol',1e-6,'Mass',@(t,hw) Richardmass(t,hw,soilPar,modPar), 'MStateDependence','strong').
when I Include the options structure in ode15s solver I get an error saying :-
' Warning: Failure at t=5.661773e+00. Unable to meet integration tolerances without reducing the step size below the
smallest value allowed (1.421085e-14) at time t.
In ode15s (line 655)
In Richards (line 93) '
but without the mass matrix i get a solution but it is not correct
In the code given the variables are t and hw ( time and pressure head) , soilPar and modPar are structures containing the soil properties and model properties repsectively. A staggeredgrid approach was used to deinfe the model parameters
Any hep woul dbe greatky appreciated, Thanks in Advance . :-)

采纳的回答

Jan
Jan 2021-5-20
Reduce tspan to tspan = [0, 0.0023] and check the results. It seems, like the values implode such that the integration must fail. I'd assume a typo in the fomula.
  1 个评论
Ranjeev Kumar Bhatia
Thank your for Help. Much Appreciated.
and your correct there was a typo in the formula.
the errpr was this
soilPar.thsat-soilPar.thres(corrected)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by