<div dir="ltr">This matrix is SPD so you want to use -ksp_type cg<div><br></div><div>Without a matrix, preconditioning is hard. You can give it a shot. You need to make a MatShell and use -pc_type none.</div><div><br></div><div>You will probably want to make a matrix and you should research solver methods that have been used for problems like yours.</div><div><br></div><div>Mark</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 19, 2022 at 12:07 PM Alejandro Castro <alejandro.castro@tri.global> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello PETSc users,<div><br></div><div>I am looking to solve a (sparse) system of equations H⋅x=b where matrix H has the form H=D+Jᵀ⋅R⋅J, where both D and R are positive diagonal matrices. This is very similar to a set of normal equations, though not quite. J is square and most often with a large condition number κ(J) (and thus H's condition number will scale with the square of κ(J)).<br><br>What method would you recommend for solving H⋅x=b? In particular, I imagine I do not want to form H directly. Also, what iterative method would you recommend given the large condition number?</div><div><br></div><div>Thank you in advance,</div><div><br></div><div>A.</div><div><br></div><div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><b style="color:rgb(0,0,0);font-family:sans-serif;font-size:14px"><table cellpadding="0" cellspacing="0" style="font-weight:400;border-spacing:0px;border-collapse:collapse;color:rgb(68,68,68);width:500px;font-size:9pt;font-family:Verdana,sans-serif;line-height:12px"><tbody><tr><td valign="middle" style="padding:0px;width:128px;vertical-align:top"><a href="https://www.tri.global/" style="background-color:transparent;color:rgb(51,122,183)" target="_blank"><img border="0" alt="Toyota Research Institute Logo" width="128" height="53" src="https://www.goforecho.com/tri/images/TRI_Signature-small.jpg" style="border: 0px; vertical-align: middle; width: 128px; height: 53px; display: block;"></a></td><td valign="top" style="padding:0px;width:372px;color:rgb(19,19,19);font-family:Verdana,sans-serif;vertical-align:middle;display:flex"><table cellpadding="0" cellspacing="0" height="100%" style="border-spacing:0px;border-collapse:collapse;background-color:transparent"><tbody><tr><td colspan="2" style="padding:0px 0px 2px;width:480px;color:black;line-height:9px"><b style="font-family:sans-serif;font-size:14px">Alejandro Castro</b><span style="font-family:sans-serif;font-size:14px"> (he/him)</span><br></td></tr><tr><td colspan="2" style="padding:3px 0px 0px;width:480px"><span style="font-family:"Open Sans",Verdana,sans-serif;font-size:9pt;color:black"></span></td></tr><tr style="height:20px"><td colspan="2" style="padding:5px 0px 8px;width:480px"><span style="font-family:"Open Sans",Verdana,sans-serif;font-size:9pt;color:black">Manager, Dynamics & Simulation</span></td></tr><tr><td style="padding:1px"></td></tr><tr><td style="padding:1px"></td></tr><tr style="height:20px"><td style="padding:6px 1px 1px;font-family:"Open Sans",Verdana,sans-serif;font-size:8pt"><a href="http://www.tri.global/" style="background-color:transparent;font-size:8pt" target="_blank"><span style="font-size:9pt;text-transform:uppercase"><font color="#ff0000"><b>TOYOTA</b></font><font color="#000000"> <b>RESEARCH</b> </font><font color="#666666"><b>INSTITUTE</b></font></span></a></td></tr><tr style="height:20px"><td style="padding:1px"><a href="https://goo.gl/maps/3MF8fCYh8vV5YMHE6" style="font-family:"Open Sans",Verdana,sans-serif;font-size:8pt;color:rgb(89,89,89)" target="_blank">Los Altos</a> <span style="font-family:"Open Sans",Verdana,sans-serif;font-size:8pt;color:rgb(89,89,89)">/</span> <a href="https://goo.gl/maps/9QWtf6NV6oNrdJih8" style="font-family:"Open Sans",Verdana,sans-serif;font-size:8pt;color:black;font-weight:bold" target="_blank">Cambridge</a></td></tr></tbody></table></td></tr></tbody></table></b><br></div></div></div></div>

<br>
<div style="font-size:1.3em"><hr></div><font color="#808080" size="1">Confidential or protected information may be contained in this email and/or attachment. Unless otherwise marked, all TRI email communications are considered "PROTECTED" and should not be shared or distributed. Thank you.</font></blockquote></div>