On Sun, Nov 6, 2011 at 9:56 PM, Dominik Szczerba <span dir="ltr">&lt;<a href="mailto:dominik@itis.ethz.ch">dominik@itis.ethz.ch</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;">
<div><div></div><div class="h5">On Sun, Nov 6, 2011 at 10:40 PM, Matthew Knepley &lt;<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>&gt; wrote:<br>
&gt; On Sun, Nov 6, 2011 at 9:34 PM, Dominik Szczerba &lt;<a href="mailto:dominik@itis.ethz.ch">dominik@itis.ethz.ch</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; On Sun, Nov 6, 2011 at 6:59 PM, Matthew Knepley &lt;<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt; On Sun, Nov 6, 2011 at 5:52 PM, Dominik Szczerba &lt;<a href="mailto:dominik@itis.ethz.ch">dominik@itis.ethz.ch</a>&gt;<br>
&gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; I want to start small by porting a very simple code using fixed<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; point<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; iterations as follows: A(x)x = b(x) is approximated as A(x0)x =<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; b(x0),<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; then solved by KSP for x, then x0 is updated to x, then repeat<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; until<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; convergence.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Run the usual &quot;Newton&quot; methods with A(x) in place of the true<br>
&gt;&gt; &gt;&gt; &gt; Jacobian.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; When I substitute A(x) into eq. 5.2 I get:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; A(x) dx = -F(x) (1)<br>
&gt;&gt; &gt;&gt; A(x) dx = -A(x) x + b(x) (2)<br>
&gt;&gt; &gt;&gt; A(x) dx + A(x) x = b(x) (3)<br>
&gt;&gt; &gt;&gt; A(x) (x+dx) = b(x) (4)<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; My questions:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; * Will the procedure somehow optimally group the two A(x) terms into<br>
&gt;&gt; &gt;&gt; one, as in 3-4? This requires knowledge, will this be efficiently<br>
&gt;&gt; &gt;&gt; handled?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; There is no grouping. You solve for dx and do a vector addition.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; * I am solving for x+dx, while eq. 5.3 solves for dx. Is this, and<br>
&gt;&gt; &gt;&gt; how, correctly handled? Should I somehow disable the update myself?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Do not do any update yourself, just give the correct A at each iteration<br>
&gt;&gt; &gt; in<br>
&gt;&gt; &gt; your FormJacobian routine.<br>
&gt;&gt; &gt;    Matt<br>
&gt;&gt;<br>
&gt;&gt; OK, no manual update, this is clear now. What is still not clear is<br>
&gt;&gt; that by substituting A for F&#39; I arrive at an equation in x+dx (my eq.<br>
&gt;&gt; 4), and not dx (Petsc eq. 5.3)...<br>
&gt;<br>
&gt; Newton&#39;s equation is for dx. Then you add that to x to get the next guess.<br>
&gt; This<br>
&gt; is described in any book on numerical analysis, e.g. Henrici.<br>
&gt;    Matt<br>
<br>
</div></div>I understand that, but I am asking something else... when taking F&#39; =<br>
A I arrive at an equation in x+dx, which is not Newton equation. What<br>
is wrong in this picture?</blockquote><div><br></div><div>Keep the residual on the rhs, not b</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;">
<font color="#888888"><br>
Dominik</font></blockquote></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>