Re: [daetools-users] Strange behavior
Object-oriented equation-based modelling and optimisation software
Brought to you by:
ciroki
|
From: Dragan N. <dra...@gm...> - 2017-01-15 21:15:53
|
Yes, the stop time should be specified in IDA solver (with IDASetStopTime) to prevent these kind of situations where the solver takes long time steps, past the time horizon set in the simulation. The default stop time is infinity and that's why your situation happens. I had that before but for some reasons I removed it at some point. I'll check why. I'll update the source at some point soon. Dragan On 15/01/17 00:26, Raymond Smith wrote: > Thanks, and you too! > > I was suspicious it was a result of a overly aggressive time stepping, > as that was the only way this system should get into negative log > regimes, but I hadn't made it print things to actually narrow it down. > In the meantime, I have a similar-looking function which behaves a bit > better, so I can use that for now, but I'll also be curious to hear > what you find. > > On Sat, Jan 14, 2017 at 12:44 PM, Dragan Nikolic > <dra...@gm... <mailto:dra...@gm...>> wrote: > > Hello Ray, > > Greetings to you and happy and prosperous New Year. > > It is strange and it is not :-) Advanced solvers try to take as long > steps as possible. If you switch on daetools.core.printInfo in > daetools.cfg and re-run simulation you can see that IDAS solver take > long steps internally but when the results for intermediate time > points > are requested does some kind of interpolation using the BDF data it > keeps. If the system is not stiff the time steps can be very long. In > your case I get this: > > Calculate residuals at time 126.410696314185998... > > At that time y is probably greater than 1.0 and you get log of a > negative value exception in reg_sln function. > > Honestly, I thought I fixed this long time ago (meaning that DAE > solver > shouldn't take larger steps than TimeHorizon) but I will check what is > going on and appearing again. > > Dragan > > > On 14/01/17 20:24, Raymond Smith wrote: > > Greetings. > > > > I've got a behavior I can't explain in one of my simulations, so I > > tried to come up with a simplified example to demonstrate it. The > > behavior in the simplified version isn't quite the same as the > > behavior in the full version, but it seems like it might be related. > > And in any case, I can't explain the behavior of the simplified > > version either, so it's still curious. > > > > I've attached a simple example of 3 coupled DAE's (inspired by a > > battery model, much like that on the daetools website). When I > use one > > function for the equilibrium potential of the electrode material, it > > behaves nicely. However, when I use a similar function, the > simulation > > crashes with negative log errors which shouldn't be occurring I > > believe. To run the crashing version, start daeplotter, then > > > > $ python battery_simple.py [console] > > > > I get it crashing at ~75.5 time units. This seems wrong to me > because > > when I use a different but similar function for the equilibrium > > potential it works fine. To do this, toggle the comment status of > > lines 44 & 45, then it should run fine. > > > > To demonstrate that the functions are similar, you can run > > > > $ python battery_simple.py plot > > > > and it will compare the two functions we're using for the > equilibrium > > potential. Any ideas why the desired one leads to crashes (and > perhaps > > how to avoid them)? > > > > Thanks, > > Ray > > > > > > > ------------------------------------------------------------------------------ > > Developer Access Program for Intel Xeon Phi Processors > > Access to Intel Xeon Phi processor-based developer platforms. > > With one year of Intel Parallel Studio XE. > > Training and support from Colfax. > > Order your platform today. http://sdm.link/xeonphi > > > > > > _______________________________________________ > > daetools-users mailing list > > dae...@li... > <mailto:dae...@li...> > > https://lists.sourceforge.net/lists/listinfo/daetools-users > <https://lists.sourceforge.net/lists/listinfo/daetools-users> > > > ------------------------------------------------------------------------------ > Developer Access Program for Intel Xeon Phi Processors > Access to Intel Xeon Phi processor-based developer platforms. > With one year of Intel Parallel Studio XE. > Training and support from Colfax. > Order your platform today. http://sdm.link/xeonphi > _______________________________________________ > daetools-users mailing list > dae...@li... > <mailto:dae...@li...> > https://lists.sourceforge.net/lists/listinfo/daetools-users > <https://lists.sourceforge.net/lists/listinfo/daetools-users> > > |