0% found this document useful (0 votes)
65 views

Displacement Matrix Using C++

The document contains C++ code to calculate displacement matrix from stiffness and load matrices. It first takes input for rows and columns of stiffness and load matrices, then inputs the matrices. It calculates the inverse of stiffness matrix and stores it in a new matrix. Finally, it calculates the displacement matrix by multiplying the inverse stiffness matrix with the load matrix and displays the result.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views

Displacement Matrix Using C++

The document contains C++ code to calculate displacement matrix from stiffness and load matrices. It first takes input for rows and columns of stiffness and load matrices, then inputs the matrices. It calculates the inverse of stiffness matrix and stores it in a new matrix. Finally, it calculates the displacement matrix by multiplying the inverse stiffness matrix with the load matrix and displays the result.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include <iostream.

h>
#include<conio.h>
int main()
{
clrscr();
int a[5][5],b[5][5],c[5][5],d[5][5],m,n,p,q,i,j,k;
cout<<"Enter rows and columns of STIFFNESS MATRIX:\n";
cin>>m>>n;
cout<<"Enter rows and columns of LOAD MATRIX:\n";
cin>>p>>q;
cout<<"\nEnter STIFFNESS matrix rowwise:\n";
for(i=0;i<m;++i)
for(j=0;j<n;++j)
cin>>a[i][j];
cout<<"\nEnter LOAD matrix:\n";
for(i=0;i<p;++i)
for(j=0;j<q;++j)
cin>>b[i][j];
//Inverse of STIFFNESS MATRIX
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
c[i][j]=a[j][i];
}
}
//Find displacement matrix
cout<<"\n The displacement Matrix:\n\n";
for(i=0;i<m;++i)
{
for(j=0;j<q;++j)
{
d[i][j]=0;
for(k=0;k<n;++k)
d[i][j]=d[i][j]+(c[i][k]*b[k][j]);
cout<<d[i][j]<<" ";
}
cout<<"\n";
}
getch();
return 0;
}

You might also like