1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#include <iostream>
#include<windows.h>
#include <cmath>
#include <string>
using namespace std;
int main()
{
float x1, x2, x3, y1, y2, y3, y4;
float a1, a2, a3, b1, b2, b3, c1, c2, c3;
float area, l1, l2, l3, si1, si2, si3, fi1, fi2, fi3, fi4, fi5, fi6;
float d[6][6];
float m[6][6];
float k[6][6]= {{1,0,0,-1,0,-1},{0,1,0,-1,-1,0},{0,0,1,0,-1,-1},{0,0,0,0,0,0},{0,0,0,0,0,0},{0,0,0,0,0,0}};
float s[6][6]={{1,0,0,0,0,0},{0,1,0,0,0,0},{0,0,1,0,0,0},{-1,-1,0,0,0,0},{0,-1,-1,0,0,0},{-1,0,-1,0,0,0}};
cout<<"Value of Mass Matrix :"<<"\n\n";
for(int i=0; i<=5; i++){
for(int j=0; j<=5; j++){
for(int p=0; p<=5; p++){
d[i][j]=0;
d[i][j]=(k[i][p]*s[p][j])+d[i][j];
}}}
cout<<"Mass Matrix =:"<<"\n";
{for(int i=0;i<=5;i++)
for(int j=0;j<=5;j++){
cout<<"\t\t"<<d[i][j];
}cout<<"\n";}
return0;
}
|