laurent90git / DAE-Scipy

Modifications of Scipy's implicit solvers for the solution of differential-algebraic equations (DAEs)
12 stars 2 forks source link

Minor Error #1

Open griff10000 opened 3 years ago

griff10000 commented 3 years ago

Thank you very much for this excellent work. I have only spent a short while testing, but this is a very good implementation of Radau.

However, all the examples throw a "minor" error, for example from the transistor amplifier example the error on my Windows PC was:

KeyError: 'solver'

During handling of the above exception, another exception occurred:
Traceback (most recent call last):

  File "<ipython-input-25-4ebeafbfaceb>", line 1, in <module>
    sol.solver.nlusove

  File "C:\Users\Graham\Anaconda3\lib\site-packages\scipy\optimize\optimize.py", line 124, in __getattr__
    raise AttributeError(name)

AttributeError: solver

This is caused by trying to print sol.solver.nlusove.

Commenting out the print statement on line 85 solved the problem.

Commenting out similar statements for the other examples allows them all to run without error.

nlusolve appears to be a variable belonging to the class RadauDAE

Regards,

Graham W Griffiths

laurent90git commented 3 years ago

Hi,

indeed I have modified my Scipy code so that the solution structure also contains the solver object, thus allowing me to access more solver-specific data. I have not put that on the current Git repository, as it involves changes to Scipy's base integrate routine, and I forgot to remove these problematic statements. Commenting them is the right solution. Keep me updated on any issue you might find.

Regards, Laurent François

griff10000 commented 3 years ago

Hi, I have modified your one-stage transistor amplifier test example to a two-stage transistor amplifier - see attachment. This is also an index-1 problem with a singular mass matrix. Your code solves it without any problems. The code includes references.

Regards,

Graham W Griffiths transistor_amplifier_2.py.txt

laurent90git commented 3 years ago

Yes I had also implemented a recursive amplifier, but the exponential nonlinearity is exploding too quickly, this requiring a thresholding. I am searching for an easy to implement PDE with algebraic variables to test larger scale systems. Do you have any hint ?

Le sam. 7 nov. 2020 à 15:11, griff10000 notifications@github.com a écrit :

Hi, I have modified your one-stage transistor amplifier test example to a two-stage transistor amplifier - see attachment. This is also an index-1 problem with a singular mass matrix. You code solves it without any problems. The code includes references.

Regards,

Graham W Griffiths transistor_amplifier_2.py.txt https://github.com/laurent90git/DAE-Scipy/files/5504857/transistor_amplifier_2.py.txt

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/laurent90git/DAE-Scipy/issues/1#issuecomment-723451049, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHJ3TFUXZRZLOBDFQXBXSRLSOVIR3ANCNFSM4TNSKUSA .

griff10000 commented 3 years ago

Hi, I do not have a particular PDE problem with algebraic constraints that you could use. Probably there is a tubular chemical reactor problem of this type. I attach two documents that may be of use to you.

Regards,

Graham W Griffiths Cambell and Marszalek (1996) DAEs arising from traveling wave solutions of PDEs.pdf Mazzia, Magherini and Iavernaro (2006) Test Set for Initial Value Problem Solvers.pdf