[petsc-users] Matlab gets a different solution to Petsc

Jed Brown jed at jedbrown.org
Tue Jul 8 18:41:45 CDT 2014


Andrew Cramer <andrewdalecramer at gmail.com> writes:

> I get *significantly *different results from backslash and petsc using
> the *same
> matrix*.
>
>                  Deflection  |Au-b|/|b|
> Euler-Bernoulli:       4000
> Petsc:                 4386        0.3
> Matlab:                4013    1.6e-10
>
> I'm exporting to 6 significant figures. Condition number is rather poor
> (~2e7) but I get similar or worse results with problems having lower
> conditions numbers (~1e3).

Are you sure the matrices are the same?  Use "-ksp_view_mat binary",
then in MATLAB, A = PetscBinaryRead('binaryoutput') if you want to get
both matrices in the same environment.  Or explicitly compute the norms
in PETSc.

To debug, start with the simplest and most well-conditioned problem
that exhibits the issue.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140708/5d2223e2/attachment.pgp>


More information about the petsc-users mailing list