<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Feb 4, 2017, at 7:35 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="gmail_extra">
<div class="gmail_quote">On Sat, Feb 4, 2017 at 7:24 PM, Zhang, Hong <span dir="ltr" class="">
<<a href="mailto:hongzhang@anl.gov" target="_blank" class="">hongzhang@anl.gov</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word" class="">Can you elaborate a bit more on your problem?
<div class=""><br class="">
</div>
<div class="">If your problem is an index-1 DAE, there is no need to use a projection method, and it is perfectly fine to set it up as a DAE in PETSc. For high-index DAEs, you may have to use TSSetPostStep() to implement your own projection algorithm.</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">Please define index.</div>
</div>
</div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div><a href="http://www.scholarpedia.org/article/Differential-algebraic_equations#Index" class="">http://www.scholarpedia.org/article/Differential-algebraic_equations#Index</a></div>
<div><br class="">
</div>
<div>Hong </div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div dir="ltr" class="">
<div class="gmail_extra">
<div class="gmail_quote">
<div class=""><br class="">
</div>
<div class="">   Matt</div>
<div class=""> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word" class="">
<div class="">If you happen to have a Hamiltonian system to solve, I have a symplectic solver in my own branch that you can use directly.</div>
<div class=""><br class="">
</div>
<div class="">Hong (Mr.)</div>
<div class="">
<div class="h5">
<div class=""><br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On Feb 4, 2017, at 9:47 AM, Gideon Simpson <<a href="mailto:gideon.simpson@gmail.com" target="_blank" class="">gideon.simpson@gmail.com</a>> wrote:</div>
<br class="m_-474447080568797388Apple-interchange-newline">
<div class="">
<div style="word-wrap:break-word" class="">Would setting it up as a DAE in petsc be algorithmically euivalent to a projected method (i.e., step of standard RK followed by nonlinear projection)?
<div class=""><br class="">
<div class=""><span class="m_-474447080568797388Apple-style-span" style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;border-spacing:0px">-gideon</span>
</div>
<br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On Feb 3, 2017, at 11:47 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank" class="">knepley@gmail.com</a>> wrote:</div>
<br class="m_-474447080568797388Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">That is one answer. Another one is that this particular system is a DAE and we have methods for that.
<div class=""><br class="">
</div>
<div class="">   Matt</div>
</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Fri, Feb 3, 2017 at 8:40 PM, Barry Smith <span dir="ltr" class="">
<<a href="mailto:bsmith@mcs.anl.gov" target="_blank" class="">bsmith@mcs.anl.gov</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="">
TSSetPostStep(); in your function use TSGetSolution() to get the current solution.<br class="">
<br class="">
  Please let us know how it works out<br class="">
<span class="m_-474447080568797388HOEnZb"><font color="#888888" class=""><br class="">
   Barry<br class="">
</font></span>
<div class="m_-474447080568797388HOEnZb">
<div class="m_-474447080568797388h5"><br class="">
<br class="">
<br class="">
> On Feb 3, 2017, at 7:14 PM, Gideon Simpson <<a href="mailto:gideon.simpson@gmail.com" target="_blank" class="">gideon.simpson@gmail.com</a>> wrote:<br class="">
><br class="">
> I’m interested in implementing a projection method for an ODE of the form:<br class="">
><br class="">
> y’ = f(y),<br class="">
><br class="">
> such that g(y) = 0 for all time (i.e., g is conserved).  Note that in a projection method, a standard time step is made to produce y* from y_{n}, and then this is corrected to obtain y_{n+1} satisfying g(y) = 0.<br class="">
><br class="">
> There were two ways I was thinking of doing this, and I was hoping to get some input:<br class="">
><br class="">
> Idea 1: Manually loop through using taking a time step and then implementing the projection routine.  I see that there is a TSStep command, but this doesn’t  seem to be much documentation on how to use it in this scenario.  Does anyone have any guidance?<br class="">
><br class="">
> Idea 2: Is there some analog to TSMonitor that allows me to modify the solution after each time step, instead of just allowing for some computation of a statistic?<br class="">
><br class="">
><br class="">
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
<br clear="all" class="">
<div class=""><br class="">
</div>
-- <br class="">
<div class="m_-474447080568797388gmail_signature" data-smartmail="gmail_signature">
What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">
-- Norbert Wiener</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
<br clear="all" class="">
<div class=""><br class="">
</div>
-- <br class="">
<div class="gmail_signature" data-smartmail="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">
-- Norbert Wiener</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</body>
</html>