Re: [daetools-users] Strange behavior
Object-oriented equation-based modelling and optimisation software
Brought to you by:
ciroki
|
From: Raymond S. <sm...@mi...> - 2017-01-17 17:47:51
|
Wonderful, thanks! It does fix the simple case as you could test, and it also fixes the more complete case, which is not surprising, but very nice. I also see that the structured grid can accept Quantity objects now. If I remember, I'll update the battery simulation example once 1.6.0 comes out or you release a new beta. Ray On Tue, Jan 17, 2017 at 4:39 AM, Dragan Nikolic <dra...@gm...> wrote: > I committed a new revision with the fix for the issue you discovered. I > tried and it should work well now. > > Dragan > > > On 15/01/17 22:29, Raymond Smith wrote: > >> Cool, thanks for the update. That strikes me as a curious choice for the >> default, but I'm guessing the SUNDIALS developers have their reasons. >> >> Tangentially, daetools builds and runs fine with with py36 (as well as >> py35), which I learned when Arch Linux updated to py36. I'm happy to build >> and share the binaries with you if you want to host them. Up to you. >> >> Ray >> >> On Sun, Jan 15, 2017 at 1:15 PM, Dragan Nikolic <dra...@gm... >> <mailto:dra...@gm...>> wrote: >> >> 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...> >> <mailto: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...> >> <mailto:dae...@li... >> <mailto:dae...@li...>> >> > >> https://lists.sourceforge.net/lists/listinfo/daetools-users >> <https://lists.sourceforge.net/lists/listinfo/daetools-users> >> <https://lists.sourceforge.ne >> t/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...> >> <mailto:dae...@li... >> <mailto:dae...@li...>> >> https://lists.sourceforge.net/lists/listinfo/daetools-users >> <https://lists.sourceforge.net/lists/listinfo/daetools-users> >> <https://lists.sourceforge.ne >> t/lists/listinfo/daetools-users >> <https://lists.sourceforge.net/lists/listinfo/daetools-users>> >> >> >> >> >> > |