<div class="gmail_extra">On Tue, May 1, 2012 at 10:24 AM, Hong Zhang <span dir="ltr">&lt;<a href="mailto:hzhang@mcs.anl.gov" target="_blank">hzhang@mcs.anl.gov</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Andrew :<div>We have TS examples under</div><div>~/src/ts/examples/tutorials/</div><div>/src/ts/examples/tests</div><div><br></div><div>Hong<br><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

I want to solve a very simple equation:<br>
<br>
u_t = F(t) u<br>
<br>
Where F(t) = H_0 + a(t) H&#39; (H_0 and H&#39; are constant matrices, and a(t) is a time dependent scalar).<br>
<br>
But I&#39;m not sure how to go about doing this using the TS context.<br>
<br>
I don&#39;t have a Jacobian that I need to be worried about, so should I be doing:<br></blockquote></div></div></div></blockquote><div><br></div><div>I am not sure I understand what you mean. Your Jacobian above is F(t), so it does change. You can</div>
<div>of course do this MF since it will be exact, just probably more expensive.</div><div><br></div><div>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
TSSetRHSFunction(ts,PETSC_NULL,myRHSFunction,&amp;appctx);<br>
TSSetRHSJacobian(ts,A,A,TSComputeRHSJacobianConstant,&amp;appctx);<br>
<br>
Where:<br>
myRHSFunction(TS ts,PetscReal t,Vec u,Vec F,void *ctx)<br>
{<br>
        //Create temporary matrix A = H_0 + a(t) H&#39;<br>
        //then do F = A u<br>
}<br>
<br>
Or should I be doing something else?<br>
<br>
Thanks for the help, unfortunately, it looks like the documentation on TS in the manual isn&#39;t accurate.<br>
<span><font color="#888888"><br>
-Andrew</font></span></blockquote></div><br></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>
</div>