Filter löschen
Filter löschen

Error in ODE15s

2 Ansichten (letzte 30 Tage)
Ranjeev Kumar Bhatia
Ranjeev Kumar Bhatia am 20 Mai 2021
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 . :-)

Akzeptierte Antwort

Jan
Jan am 20 Mai 2021
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 Kommentar
Ranjeev Kumar Bhatia
Ranjeev Kumar Bhatia am 23 Mai 2021
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)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by