[petsc-users] Asking examples about solving DAE in python

Barry Smith bsmith at petsc.dev
Thu Jan 20 16:21:48 CST 2022


  Hong Zhang can give you more correct details but I can get you started. 

   Yes, you can use Petsc4py for this purpose. 

   If you cannot provide a Jacobian then you should be able to use either a matrix-free solver for the Jacobian system or have PETSc build the Jacobian for you with finite differencing and coloring. Or if the problem is small just have PETSc brute force the Jacobian with finite differencing. 



> On Jan 20, 2022, at 5:13 PM, Xiong, Jing via petsc-users <petsc-users at mcs.anl.gov> wrote:
> 
> Hi,
> 
> I hope you are well.
> I'm very interested in PETSc and want to explore the possibility of whether it could solve Differential-algebraic equations (DAE) in python. I know there are great examples in C, but I'm struggling to connect the examples in python. 
> 
> The only example I got right now is for solving ODEs in the paper: PETSc/TS: A Modern Scalable ODE/DAE Solver Library. 
> And I got the following questions:
> Is petsc4py the right package to use?
> Could you give an example for solving DAEs in python?
> Is Jacobian must be specified? If not, could your show an example for solving DAEs without specified Jacobian in python?
> 
> Thank you for your help.
> 
> Best,
> Jing

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220120/8118c69e/attachment.html>


More information about the petsc-users mailing list