[petsc-users] Asking examples about solving DAE in python
Xiong, Jing
jxiong at anl.gov
Thu Jan 20 16:45:51 CST 2022
Good afternoon Dr. Smith,
Thank you for your quick response.
I would like to know more details for "a matrix-free solver for the Jacobian system or have PETSc build the Jacobian for you with finite differencing and coloring."
Do you happen to have any examples for this? Maybe I can run a demo and test the performance of my problem.
Best,
Jing
________________________________
From: Barry Smith <bsmith at petsc.dev>
Sent: Thursday, January 20, 2022 2:21 PM
To: Xiong, Jing <jxiong at anl.gov>
Cc: petsc-users at mcs.anl.gov <petsc-users at mcs.anl.gov>; Zhao, Dongbo <dongbo.zhao at anl.gov>; Hong, Tianqi <thong at anl.gov>
Subject: Re: [petsc-users] Asking examples about solving DAE in python
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<mailto: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:
1. Is petsc4py the right package to use?
2. Could you give an example for solving DAEs in python?
3. 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/5420e472/attachment-0001.html>
More information about the petsc-users
mailing list