<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Good afternoon Dr. Smith,
<div><br>
</div>
<div>Thank you for your quick response.</div>
<div>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."
</div>
<div><br>
</div>
Do you happen to have any examples for this? Maybe I can run a demo and test the performance of my problem.<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Best,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Jing</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Barry Smith <bsmith@petsc.dev><br>
<b>Sent:</b> Thursday, January 20, 2022 2:21 PM<br>
<b>To:</b> Xiong, Jing <jxiong@anl.gov><br>
<b>Cc:</b> petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov>; Zhao, Dongbo <dongbo.zhao@anl.gov>; Hong, Tianqi <thong@anl.gov><br>
<b>Subject:</b> Re: [petsc-users] Asking examples about solving DAE in python</font>
<div> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">
<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="x_Apple-interchange-newline">
<div class="">
<div class="" 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; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<div class="" style="margin-top:0pt; margin-bottom:0pt; color:rgb(14,16,26); background-color:transparent">
<span class="" style="background-color:transparent">Hi,</span></div>
<div class="" style="margin-top:0pt; margin-bottom:0pt; color:rgb(14,16,26); background-color:transparent">
<br class="">
</div>
<div class="" style="margin-top:0pt; margin-bottom:0pt; color:rgb(14,16,26); background-color:transparent">
<span class="" style="background-color:transparent">I hope you are well.</span></div>
<div class="" style="margin-top:0pt; margin-bottom:0pt; color:rgb(14,16,26); background-color:transparent">
<span class="" style="background-color:transparent">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 class="" style="margin-top:0pt; margin-bottom:0pt; color:rgb(14,16,26); background-color:transparent">
<br class="">
</div>
<div class="" style="margin-top:0pt; margin-bottom:0pt; color:rgb(14,16,26); background-color:transparent">
<span class="" style="background-color:transparent">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 class="" style="margin-top:0pt; margin-bottom:0pt; color:rgb(14,16,26); background-color:transparent">
<span class="" style="background-color:transparent">And I got the following questions:</span></div>
<ol class="" style="color:rgb(14,16,26); background-color:transparent; margin-top:0pt; margin-bottom:0pt">
<li class="" style="background-color:transparent; margin-top:0pt; margin-bottom:0pt; list-style-type:decimal">
<span class="" style="background-color:transparent; margin-top:0pt; margin-bottom:0pt"><b class="">Is petsc4py the right package to use?</b></span></li><li class="" style="background-color:transparent; margin-top:0pt; margin-bottom:0pt; list-style-type:decimal">
<span class="" style="background-color:transparent; margin-top:0pt; margin-bottom:0pt"><b class="">Could you give an example for solving DAEs in python?</b></span></li><li class="" style="background-color:transparent; margin-top:0pt; margin-bottom:0pt; list-style-type:decimal">
<span class="" style="background-color:transparent; margin-top:0pt; margin-bottom:0pt"><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 class="" style="background-color:transparent; margin-top:0pt; margin-bottom:0pt"><br class="">
</span></div>
<div class=""><span class="" style="background-color:transparent; margin-top:0pt; margin-bottom:0pt">Thank you for your help.</span></div>
<div class=""><span class="" style="background-color:transparent; margin-top:0pt; margin-bottom:0pt"><b class=""><br class="">
</b></span></div>
<div class=""><span class="" style="background-color:transparent; margin-top:0pt; margin-bottom:0pt">Best,</span></div>
<div class=""><span class="" style="background-color:transparent; margin-top:0pt; margin-bottom:0pt">Jing</span></div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</body>
</html>