TransWikia.com

Solving multiple systems using Cholesky factorization to find Inverse of a matrix

Mathematica Asked by Bogus on December 17, 2020

I have a matrix:

A = {{1, 1, 1, 1}, {1, 5, 5, 5}, {1, 5, 14, 14}, {1, 5, 14, 30}}

I wrote code in Mathematica (mostly copying what professor gave us, I’m new to Mathematica) for finding the Cholesky factorization. So I have L and L^T = U such that A = L U.

I need to write more code to solve the systems A x = e_1, A x = e_2, A x = e_3, A x = e_4, where e_1, e_2, e_3, and e_4 are the standard basis vectors in R^4.

I get that I need an intermediate form. I am setting up so that: L g_1 = e_1 and U x_1= g_1, but I don’t know how to code Mathematica to solve the system L g_1 = e_1 (or the other, but I imagine I can learn from the first). My professor has this code in another file he used to solve an LU factorization, but it doesn’t seem like enough

g1 = e1

For[i = 0, i <= n - 1, i++; 
  g1[[i]] = e1[[i]] - Sum[LL[[i, j]] g1[[j]], {j, 1, i - 1}]]

I adapted it for my variables. Some help would be nice. I plan on hitting office hours this week, but I have three other problems to work out as well, and was hoping to catch a break on this one.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP