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

Matthew Knepley knepley at gmail.com
Thu Jan 20 16:57:11 CST 2022


On Thu, Jan 20, 2022 at 5:45 PM Xiong, Jing via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> 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."
>

If you do not specify anything, we do this by default, so the first thing
to do is just run with your residual function.


> Do you happen to have any examples for this? Maybe I can run a demo and
> test the performance of my problem.
>

Most of the TS examples can be configured to run in these modes. There is a
chapter in the users manual about this.

  Thanks,

     Matt


> 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> 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
>
>
>

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220120/d0f4b308/attachment.html>


More information about the petsc-users mailing list