Problem with ODE15s: negative dxdt but increasing x(t)

Hi all,
I am running a simulation of droplet drying and I use ode15s as the solver. The droplet is assumed to be perfectly spherical, and its size decreases due to water evaporation.
My matrix is [c ... T Rd Rsh] where c is concentration (spacially distributed), T temperature, Rd the droplet radius, and Rsh the inner radius of the shell of solid created below droplet surface, respectively. Accordingly, the solution matrix in the ode function is [dc_dt ... dT_dt dRd_dt dRsh_dt].
Initially Rd and Rsh have the same value (no shell of solid in at first), and as the drying process continues shell is formed below the surface and Rsh become smaller than Rd (the shell thickness is thus Rd-Rsh). In the code dRd_dt is always negative (because water evaporates). The dRsh_dt is given as a function of dRd_dt, and the value is same as or smaller than dRd_dt. In other words, one will expect that Rsh will decrease faster than Rd.
Then I found an anomaly: after some point Rsh increases and even surpasses Rd. At first I thought it's because of coding or numerical errors that cause dRsh_dt to become positive (thus increasing Rsh). However, I have checked (by printing the variable values) that there was nothing wrong with the dRsh_dt: it stayed negative and was equal to or less than dRd_dt.
Below is the changes at the end of the simulation:
t= 6.378e-03; dRsh_dt= -3.75e-04; dRd_dt= -3.75e-04; Rsh= 8.48e-01; Rd= 8.35e-01
t= 6.378e-03; dRsh_dt= -1.00e-03; dRd_dt= -3.79e-04; Rsh= 8.66e-01; Rd= 8.35e-01
t= 6.379e-03; dRsh_dt= -9.54e-04; dRd_dt= -3.82e-04; Rsh= 8.91e-01; Rd= 8.35e-01
t= 6.380e-03; dRsh_dt= -8.93e-04; dRd_dt= -3.85e-04; Rsh= 9.25e-01; Rd= 8.35e-01
t= 6.381e-03; dRsh_dt= -7.88e-04; dRd_dt= -3.89e-04; Rsh= 9.90e-01; Rd= 8.35e-01
t= 6.381e-03; dRsh_dt= -7.88e-04; dRd_dt= -3.89e-04; Rsh= 9.90e-01; Rd= 8.35e-01
t= 6.381e-03; dRsh_dt= -3.93e-04; dRd_dt= -3.93e-04; Rsh= 1.08e+00; Rd= 8.35e-01
As can be seen, both dRsh_dt and dRd_dt remained negative but Rsh increased very fast.
How is it possible? What would be the cause? I never experienced this before.

Respuestas (0)

Categorías

Más información sobre General Applications en Centro de ayuda y File Exchange.

Productos

Versión

R2014a

Preguntada:

el 16 de Nov. de 2018

Comentada:

el 16 de Nov. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by