Hi ,(adsbygoogle = window.adsbygoogle || []).push({});

I want to compute a geomtric series with matrices. I have the following functions:

add (matrix1,matix2)=function to add 2 matrices.

mult(matirx1,matrix2)=function to multiply two matrices.

I want to create this function in C that computes the following.

I(indentity matrix)

I+A+A^2+A^3+....A^k

I tried

sum=I;

for(i=0;i<k;i++)

{

intermediary=mult(I,A);

sum+=intermediary;

intermediary=mult(intermediary,A)

}

Am I right?

Please, What is wrong here?

Thank you for yout help

B

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Compute a geomtric series with matrices

Loading...

Similar Threads for Compute geomtric series | Date |
---|---|

Edge data center size | Apr 6, 2018 |

Need some advice on an appropriate computer language to use | Feb 13, 2018 |

Compute Fluid drag, Swim Physics | Feb 12, 2018 |

Fortran Fortran for Computational Fluid Dynamics Problems | Jan 11, 2018 |

Algorithm to compute Basis images of an image | May 2, 2015 |

**Physics Forums - The Fusion of Science and Community**