ME 581
Assignment #1 - Solution
In the following questions show the derivations that you used to write your program.
1. Write a subroutine to do matrix multiplication [C] = [A] [B] of arbitrary sized matrices. The input to the
program should be:
The first
Chapter 1 Math Review: Vectors and Matrices
1. Vectors
v1
v
2
v
cfw_v 3
vn 1
vn
cfw_vT v1 v2
v3 vn 1 vn
cfw_v is an n-vector. The vector has n components.
Notations
Matrix notation:
cfw_v
v
Vector notation:
Matrix component notation as
function [F]=cholesky(A,option)
%Function to find the Cholesky factor of a Positive Definite matrix A
%Author Mathuranathan for http:/www.gaussianwaves.com
%Licensed under Creative Commons: CC-NC-BY-SA 3.0
%A = positive definite matrix
%Option can be one
ME 581
Assignment #2
In the following questions write the derivations and algorithm steps that you used to write your program.
1. Write a Gauss elimination subroutine with partial pivoting. Use it to solve the following linear system of
equations of the f
Chapter 2 Solving a System of Linear Algebraic Equations
Given a system of equations:
[ A]cfw_x cfw_c . We want to solve this system for the vector cfw_x and we know [A] and cfw_c.
The following operations do not change the system of equations (i.e. the s
Chapter 3 Linear Least Squares
The least squares method is a method to find the approximate solution for sets of equations in which there are more equations than
unknowns (over-determined systems). "Least squares" means that the overall solution minimizes
Chapter 4 Eigenvalue Problem
[ M ]cfw_ [ K ]cfw_x cfw_0
x
Note: For structural and finite element problems [M ] and [K ] are symmetric.
Try the solution:
xi (t ) X i cos(t )
xi (t ) X i sin(t )
i (t ) X i 2 cos(t )
x
cfw_x(t ) cfw_ X cos(t )
cfw_x(t )
#include<stdio.h>
int main()
cfw_
int i,j,k,n;
float A[20][20],c[10],x[10],sum=0.0,w=0.0,w1=0.0;
printf("\nEnter the order of matrix: ");
scanf("0",&n);
printf("\nEnter the elements of augmented matrix row-wise:\n\n");
for(i=1; i<=n-1; i+)
cfw_
for(j=1; j