<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div> Hong Zhang can give you more correct details but I can get you started. <div class=""><br class=""></div><div class=""> Yes, you can use Petsc4py for this purpose. </div><div class=""><br class=""></div><div class=""> 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. </div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On Jan 20, 2022, at 5:13 PM, Xiong, Jing via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><div style="margin-top: 0pt; margin-bottom: 0pt; color: rgb(14, 16, 26); background-color: transparent;" class=""><span data-preserver-spaces="true" style="background-color: transparent;" class="">Hi,</span></div><div style="margin-top: 0pt; margin-bottom: 0pt; color: rgb(14, 16, 26); background-color: transparent;" class=""><br class=""></div><div style="margin-top: 0pt; margin-bottom: 0pt; color: rgb(14, 16, 26); background-color: transparent;" class=""><span data-preserver-spaces="true" style="background-color: transparent;" class="">I hope you are well.</span></div><div style="margin-top: 0pt; margin-bottom: 0pt; color: rgb(14, 16, 26); background-color: transparent;" class=""><span data-preserver-spaces="true" style="background-color: transparent;" class="">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. </span></div><div style="margin-top: 0pt; margin-bottom: 0pt; color: rgb(14, 16, 26); background-color: transparent;" class=""><br class=""></div><div style="margin-top: 0pt; margin-bottom: 0pt; color: rgb(14, 16, 26); background-color: transparent;" class=""><span data-preserver-spaces="true" style="background-color: transparent;" class="">The only example I got right now is for solving ODEs in the paper: PETSc/TS: A Modern Scalable ODE/DAE Solver Library. </span></div><div style="margin-top: 0pt; margin-bottom: 0pt; color: rgb(14, 16, 26); background-color: transparent;" class=""><span data-preserver-spaces="true" style="background-color: transparent;" class="">And I got the following questions:</span></div><ol style="color: rgb(14, 16, 26); background-color: transparent; margin-top: 0pt; margin-bottom: 0pt;" class=""><li style="background-color: transparent; margin-top: 0pt; margin-bottom: 0pt; list-style-type: decimal;" class=""><span data-preserver-spaces="true" style="background-color: transparent; margin-top: 0pt; margin-bottom: 0pt;" class=""><b class="">Is petsc4py the right package to use?</b></span></li><li style="background-color: transparent; margin-top: 0pt; margin-bottom: 0pt; list-style-type: decimal;" class=""><span data-preserver-spaces="true" style="background-color: transparent; margin-top: 0pt; margin-bottom: 0pt;" class=""><b class="">Could you give an example for solving DAEs in python?</b></span></li><li style="background-color: transparent; margin-top: 0pt; margin-bottom: 0pt; list-style-type: decimal;" class=""><span data-preserver-spaces="true" style="background-color: transparent; margin-top: 0pt; margin-bottom: 0pt;" class=""><b class="">Is Jacobian must be specified? If not, could your show an example for solving DAEs without specified Jacobian in python?</b></span></li></ol><div class=""><span data-preserver-spaces="true" style="background-color: transparent; margin-top: 0pt; margin-bottom: 0pt;" class=""><br class=""></span></div><div class=""><span data-preserver-spaces="true" style="background-color: transparent; margin-top: 0pt; margin-bottom: 0pt;" class="">Thank you for your help.</span></div><div class=""><span data-preserver-spaces="true" style="background-color: transparent; margin-top: 0pt; margin-bottom: 0pt;" class=""><b class=""><br class=""></b></span></div><div class=""><span data-preserver-spaces="true" style="background-color: transparent; margin-top: 0pt; margin-bottom: 0pt;" class="">Best,</span></div><div class=""><span data-preserver-spaces="true" style="background-color: transparent; margin-top: 0pt; margin-bottom: 0pt;" class="">Jing</span></div></div></div></blockquote></div><br class=""></div></body></html>