[mesa-users] Simple matrix inversion function?

Bill Paxton paxton at kitp.ucsb.edu
Thu Jun 2 12:21:40 EDT 2016


On Jun 2, 2016, at 8:27 AM, Warrick Ball wrote:

> Hi again, fellow MESA users,
> 
> I'm busy modifying the part of the astero module that computes the separation ratios (currently r_010 and r_02) so that it will (a) correctly incorporate the covariance matrix and (b) also use r_13.
> 
> Once this is up and running, I'll post again, but for now, can someone tell me how to use the existing MESA subroutines to invert a matrix? I've computed the covariance matrix but I need it's inverse to compute the chi^2.
> 
> I've had a look around the mtx module but, though I can find routines to solve matrix equations like A*x=B, I can't seem to find a subroutine to invert.  I found the subroutine DGETRI in mtx/lapack_src/dgetri.f and, under the impression that this was linked in mtx_lib, I tried adding
> 
>  use mtx_lib, only: dgetri
> 
> (or DGETRI) in star/astero/src/astero_support.f, but I get a compiler error that seems to say that dgetri isn't in mtx_lib.
> 
>         use mtx_lib, only: dgetri
>                           1
> Error: Symbol 'dgetri' referenced at (1) not found in module 'mtx_lib'

Hi Warrick,

we are not using the f90 interfaces to the LAPACK routines, so we don't have wrappers for them in mlt_lib.

what happens if you just do a call on DGETRI without any "use" statement for it?  

for a stripped-down no-frills set of routines, you can include "mtx_solve_routines.inc" -- check them out in mtx/public.

Cheers,
Bill







> 
> I'm pretty sure a relevant routine should be in the MESA or the MESA SDK somewhere...
> 
> Alternatively, if there's a simple (even if inefficient) way to invert a (positive definite) matrix, I can just implement that in the astero module.  The inverse only needs to be computed once and only has dimensions slightly less than the total number of observed modes (up to about 50x50).
> 
> Cheers,
> Warrick
> 
> 
> 
> 
> ------------
> Warrick Ball
> Postdoc, Institut für Astrophysik Göttingen
> wball at astro.physik.uni-goettingen.de
> +49 (0) 551 39 5069------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are 
> consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
> J-Flow, sFlow and other flows. Make informed decisions using capacity 
> planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e_______________________________________________
> mesa-users mailing list
> mesa-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mesa-users





More information about the Mesa-users mailing list