SlideShare a Scribd company logo
>> IN THE NAME OF GOD <
Critical Buckling Load Geometric Nonlinearity Analysis of Springs with Rigid Element
Displacement Control Large Deformation Formulated in C programming
C program is written by Salar Delavar Ghashghaei – Publication Date: 02/November/2018
E-mail: salar.d.ghashghaei@gmail.com
C Code:
#include <stdio.h>
#include <windows.h> // text color
#include <conio.h>
#define N 10000
#define ShowText01 "RigidElementSpringDCStrainGNPcr-inputDATA.csv"
#define ShowText02 "RigidElementSpringDCStrainGNPcr-outputEXCEL.csv"
#define ShowText03 "RigidElementSpringDCStrainGNPcr-outputMATLAB.m"
#define ShowText04 "Graph-outputHTML.html"
void IMPORT_DATA01(double Import_Data[]);
void MessageNegative_IMPORT_DATA01(double Import_Data[]);
void MessageInputDataTEXT();
void MessageAnalysisReportTEXT();
void MessageErrorReportTEXT();
void MessageInitialData(double Import_Data[],int n);
void MessageStarinStressTEXT(double STARIN01[],double STRESS01[],double STARIN02[],double STRESS02[],int n);
void textcolor(int ForgC);
void Distance(int i);
void ANALYSIS(double Import_Data[],int n,int m);
double ABS(double B);
double Horizental_Disp(double L,double &x,double y);
double SQRT2(double D);
double MAX_ABS(double A[],int n);
void OUTPUT_excel(double A[],double B[],double C[],int n);
void OUTPUT_HTML_GRAPH(double X[],double Y[],int n,const char text1[],const char text2[],const char text3[]);
int main(){
int k;
double Import_Data[13];
IMPORT_DATA01(Import_Data);
MessageNegative_IMPORT_DATA01(Import_Data);
int m = 1 + ABS(Import_Data[12]/Import_Data[10]);
textcolor(10);
MessageInitialData(Import_Data,m);
textcolor(14);
ANALYSIS(Import_Data,k,m);
getch();
return 0;
}
void IMPORT_DATA01(double Import_Data[]){
int i=0;
FILE *InputFile;
InputFile = fopen(ShowText01, "r");
if (!InputFile){
MessageErrorReportTEXT();
printf(" File is not available! -> [%s] n",ShowText01);
Sleep(6000);
exit(1);
}
char line[100],a[100];
while(i < N && fgets(line,sizeof(line),InputFile) != NULL){
sscanf(line,"%s",a);
//printf("a[%d]: %sn",i,a);
Import_Data[i]= atof(a);
i++;
}
}
void MessageNegative_IMPORT_DATA01(double Import_Data[]){
if ( Import_Data[0] < 0 || Import_Data[1] < 0 || Import_Data[2] < 0 || Import_Data[3] < 0 || Import_Data[4] < 0 || Import_Data[5] < 0 || Import_Data[10] < 0|| Import_Data[12] < 0){
MessageErrorReportTEXT();
printf(" Please check this file! -> [%s]n",ShowText01);
printf(" *** Negative data input value is not acceptable ***n");
printf(" Rotational Spring Stiffness: %fn",Import_Data[0]);
printf(" Length of rigid element: %fn",Import_Data[1]);
printf(" Spring length 1: %fn",Import_Data[2]);
printf(" Spring length 2: %fn",Import_Data[3]);
printf(" Spring area 1: %fn",Import_Data[4]);
printf(" Spring area 2: %fn",Import_Data[5]);
printf(" Spring modulus of elasticity 1: %fn",Import_Data[6]);
printf(" Spring modulus of elasticity 2: %fn",Import_Data[7]);
printf(" External applied load in spring 1: %fn",Import_Data[8]);
printf(" External applied load in spring 2: %fn",Import_Data[9]);
printf(" Initial applied displacement: %fn",Import_Data[10]);
printf(" Distance of spring 1 from rigid element: %fn",Import_Data[11]);
printf(" Ultimate absolute displacement: %fn",Import_Data[12]);
Sleep(40000);
exit(1);
}
}
void textcolor(int ForgC){
WORD wColor;
//This handle is needed to get the current background attribute
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO csbi;
//csbi is used for wAttributes word
if(GetConsoleScreenBufferInfo(hStdOut, &csbi)){
//To mask out all but the background attribute, and to add the color
wColor = (csbi.wAttributes & 0xF0) + (ForgC & 0x0F);
SetConsoleTextAttribute(hStdOut, wColor);
}
return;
}
void MessageErrorReportTEXT(){
int i;
char Ql;
Ql=176;
textcolor(12);
printf("an ");
for (i=1;i<50;i++)
printf("%c",Ql);
printf(" Error Report ");
for (i=1;i<50;i++)
printf("%c",Ql);
printf("n");
}
void MessageInputDataTEXT(){
int i;
char Ql=176;
printf("n ");
for (i=1;i<50;i++)
printf("%c",Ql);
printf(" Input Data ");
for (i=1;i<50;i++)
printf("%c",Ql);
printf("n");
}
void MessageAnalysisReportTEXT(){
int i;
char Ql=176;
printf("n ");
for (i=1;i<47;i++)
printf("%c",Ql);
printf(" Analysis Report ");
for (i=1;i<47;i++)
printf("%c",Ql);
printf("n");
printf("nt ");
for (i=1;i<98;i++)
printf("-");
printf("n");
printf("t Increment Base Shear Incremental Displacement[DOF(1)] Critical Pressure Load n");
printf("t ");
for (i=1;i<98;i++)
printf("-");
printf("n");
}
void Distance(int i){
if (i < 10)
printf("b");
if (i >= 10 && i <= 99)
printf("btb");
if (i >= 100 && i <= 999)
printf("btbb");
if (i >= 1000 && i <= 9999)
printf("btbbb");
if (i >= 10000 && i <= 20000)
printf("btbbbb");
}
double ABS(double B){
if (B < 0)
B = -B;//Absolute number
else
B = B;
return B;
}
void ANALYSIS(double Import_Data[],int n,int m){
double L,Dx,a=0,Le[2],Area[2],Elas[2],Force[2],K[2],Dini,Dmax,Du,up,K_rotation;
int z,well_done=0;
double output_u[N],output_Pcr[N],output_base[N];
K_rotation = Import_Data[0];
L = Import_Data[1];
Le[0] = Import_Data[2];
Le[1] = Import_Data[3];
Area[0] = Import_Data[4];
Area[1] = Import_Data[5];
Elas[0] = Import_Data[6];
Elas[1] = Import_Data[7];
Force[0] = Import_Data[8];
Force[1] = Import_Data[9];
Dini = Import_Data[10];
Du = Import_Data[11];
Dmax = Import_Data[12];
double F[2],LE[2];
MessageAnalysisReportTEXT();
for (z=0;z<m;z++){
up = Dini*(z+1);// Define the applied Displacement
Horizental_Disp(L,Dx,up);
LE[0] = SQRT2((Le[0]+.5*up)*(Le[0]+.5*up)+Dx*Dx);
K[0] = Elas[0]*Area[0]/LE[0];
F[0] = (((Le[0]+.5*up)/LE[0])*((Le[0]+.5*up)/LE[0]))*K[0]*0.5*up + Import_Data[8];
LE[1] = SQRT2((Le[1]-up)*(Le[1]-up) + Dx*Dx);
K[1] = Elas[1]*Area[1]/LE[1];
F[1] = (((Le[1]-up)/LE[1])*((Le[1]-up)/LE[1]))*K[1]*up + Import_Data[9];
output_u[z] = up;
output_Pcr[z] = (-Import_Data[8]*((.5*L*L)/(L-Dx))-Import_Data[9]*((L*L)/(L-Dx))+F[0]*((.5*L*L)/(L-Dx))+F[1]*((L*L)/(L-Dx))+K_rotation*(up/(L-Dx)))/up;//up/(L-Dx)
output_base[z] = F[0] + F[1];
Distance(z);
printf("tt%dtt%ett%ettt%en",z+1,output_base[z],output_u[z],output_Pcr[z]);
if (ABS(up) >= Dmax){
well_done = 1;
textcolor(13);
printf("ntt Increment displacement reach to ultimate displacementnn");
break;
}
}// for
if (well_done == 1){
OUTPUT_excel(output_u,output_Pcr,output_base,z);
OUTPUT_HTML_GRAPH(output_u,output_Pcr,z+1,"Displacement - Critical Buckling Load Graph","Displacement","Critical Buckling Load");
textcolor(15);
printf("na - Output data is written in Excel file -");
system("start /w Graph-outputHTML.html");
}
}
void OUTPUT_excel(double A[],double B[],double C[],int n){
// EXCEL OUTPUT
int i;
FILE *OutputFile;
OutputFile = fopen(ShowText02, "w");
fprintf(OutputFile," ### Critical Pressure Load Geometric Nonlinearity Analysis of Springs with Displacement Control Large Deformation Formulated ###n");
fprintf(OutputFile,"Increment,Displacement [DOF(1)],Critical Pressure Load,Base Shearn");
for(i=0;i<n;i++)
fprintf(OutputFile,"%d,%e,%e,%en",i+1,A[i],B[i],C[i]);
fclose(OutputFile);
}
void MessageInitialData(double Import_Data[],int n){
char Qa,Qb,Qc,Qd,Qe,Qf,Qg,Qk;
int i;
Qa=201;Qb=205;Qc=187;Qd=200;Qe=188,Qf=186,Qg=204,Qk=185;
printf("tttt%c",Qa);
for (i=1;i<71;i++)
printf("%c",Qb);
printf("%cn",Qc);
printf("tttt%c >> IN THE NAME OF GOD << %cn",Qf,Qf);
printf("tttt%c Critical Pressure Load Geometric Nonlinearity Analysis of Springs %cn",Qf,Qf);
printf("tttt%c with Displacement Control Large Deformation Formulated %cn",Qf,Qf);
printf("tttt%c UNIT: Free Unit %cn",Qf,Qf);
printf("tttt%c",Qg);
for (i=1;i<71;i++)
printf("%c",Qb);
printf("%cn",Qk);
printf("tttt%c This program is written by Salar Delavar Ghashghaei %cn",Qf,Qf);
printf("tttt%c E-mail: salar.d.ghashghaei@gmail.com %cn",Qf,Qf);
printf("tttt%c",Qd);
for (i=1;i<71;i++)
printf("%c",Qb);
printf("%cn",Qe);
MessageInputDataTEXT();
printf("t Rotational Spring Stiffness: %fn",Import_Data[0]);
printf("t Length of rigid element: %fn",Import_Data[1]);
printf("t Spring length 1: %fn",Import_Data[2]);
printf("t Spring length 2: %fn",Import_Data[3]);
printf("t Spring area 1: %fn",Import_Data[4]);
printf("t Spring area 2: %fn",Import_Data[5]);
printf("t Spring modulus of elasticity 1: %fn",Import_Data[6]);
printf("t Spring modulus of elasticity 2: %fn",Import_Data[7]);
printf("t External applied load in spring 1: %fn",Import_Data[8]);
printf("t External applied load in spring 2: %fn",Import_Data[9]);
printf("t Initial applied displacement: %fn",Import_Data[10]);
printf("t Distance of spring 1 from rigid element: %fn",Import_Data[11]);
printf("t Ultimate absolute displacement: %fn",Import_Data[12]);
printf("t Number of increments: %dn",n);
}
double Horizental_Disp(double L,double &x,double y){
int it,itermax;
double residual,tolerance,dx,dx_ABS,f,df;
it = 0; // initialize iteration count
itermax = 100000;
residual = 100; // initialize residual
tolerance = 1e-12;
x = 1;// initialize answer
while (residual > tolerance){
f = x*x + y*y - 2*L*x;
df = 2*x - 2*L;
dx = f/df;
x -= dx;
residual = ABS(dx); // abs residual
it = it + 1; // increment iteration count
//printf("f: %f -tdx: %f -tresidual: %fn",f,dx,residual);
if (it == itermax){
printf("tSQRT2(number,power) : SQRT2(%f) - iteration: %d -> ## The solution is not converged ##n",y,it);
break;
}
}
if (it < itermax){
//printf("tSQRT(number,power) - SQRT(%f,%f) : %f n",D,n, x);
return x;
}
}
double SQRT2(double D){
int it,itermax;
double residual,tolerance,x,dx,dx_ABS,f,df;
it = 0; // initialize iteration count
itermax = 100000;
residual = 100; // initialize residual
tolerance = 1e-8;
x = 1;// initialize answer
while (residual > tolerance){
f = x*x - D;
df = 2 * x;
dx = f/df;
x= x - dx;
residual = ABS(dx); // abs residual
it = it + 1; // increment iteration count
//printf("f: %f -tdx: %f -tresidual: %fn",f,dx,residual);
if (it == itermax){
printf("tSQRT2(number,power) : SQRT2(%f) - iteration: %d -> ## The solution is not converged ##n",D,it);
break;
}
}
if (it < itermax){
//printf("tSQRT(number,power) - SQRT(%f,%f) : %f n",D,n, x);
return x;
}
}
void OUTPUT_HTML_GRAPH(double X[],double Y[],int n,const char text1[],const char text2[],const char text3[]){
// HTML GRAPH OUTPUT
int i;
double x,y,NorX[N],NorY[N],Xmax,Ymax;
Xmax=MAX_ABS(X,n);
Ymax=MAX_ABS(Y,n);
for (i=0;i<n;i++){
NorX[i] = X[i]/Xmax;
NorY[i] = Y[i]/Ymax;
//printf("t %f %f n",NorX[i],NorY[i]);
}
FILE *OutputFile;
OutputFile = fopen(ShowText04, "w");
fprintf(OutputFile,"<!DOCTYPE HTML><html><body style="background-color:black;"><font color="white"><head><script> n");
fprintf(OutputFile,"window.onload = function(){ n");
fprintf(OutputFile,"var canvas = document.getElementById("myCanvas");var s1 = canvas.getContext("2d");var s2 = canvas.getContext('2d'); n");
fprintf(OutputFile,"var s3 = canvas.getContext("2d");var s4 = canvas.getContext("2d");var s5 = canvas.getContext("2d"); n");
fprintf(OutputFile,"var x=120,y=100,X,Y,Lx=1100,Ly=500,i; n");
fprintf(OutputFile,"s3.beginPath();s3.lineWidth = 3;s3.strokeStyle = "cyan";s3.rect(x,y,Lx,Ly); n");
fprintf(OutputFile,"for(i=0;i<9;i++){s3.moveTo(x+Lx*(i+1)*.1,y+Ly);s3.lineTo(x+Lx*(i+1)*.1,y+Ly-10);}; n");
fprintf(OutputFile,"for(i=0;i<9;i++){s3.moveTo(x,y+Ly*(i+1)*.1);s3.lineTo(x+10,y+Ly*(i+1)*.1);};s3.stroke();n");
fprintf(OutputFile,"s1.beginPath();s1.lineWidth = 3;s1.strokeStyle = "yellow"; n");
for (i=0;i<n-1;i++){
fprintf(OutputFile,"s1.moveTo(%f,%f); n",120+NorX[i]*1100,100+500-NorY[i]*500);
fprintf(OutputFile,"s1.lineTo(%f,%f); n",120+NorX[i+1]*1100,100+500-NorY[i+1]*500);
}
fprintf(OutputFile,"s1.stroke(); n");
fprintf(OutputFile,"s2.beginPath();s2.lineWidth = 1;s2.strokeStyle = "cyan";s2.setLineDash([5, 5]); n");
fprintf(OutputFile,"for(i=0;i<19;i++){s2.moveTo(x+Lx*(i+1)*.05,y);s2.lineTo(x+Lx*(i+1)*.05,y+Ly);} n");
fprintf(OutputFile,"s2.lineWidth = 1;s2.strokeStyle = "cyan";for(i=0;i<19;i++){s2.moveTo(x,y+Ly*(i+1)*.05);s2.lineTo(x+Lx,y+Ly*(i+1)*.05);} s2.stroke();n");
fprintf(OutputFile,"X=x+.25*Lx;Y=.7*y;s4.translate(X,Y);s4.font="30px serif";s4.fillStyle = "#7fff00";s4.fillText("%s",0,0); n",text1);
fprintf(OutputFile,"s4.save();X=-X+.2*x;Y=-Y+y+.6*Ly;s4.translate(X,Y);s4.rotate(3*Math.PI/2);s4.font="15px serif"; n");
fprintf(OutputFile,"s4.fillStyle = "#7fff00";s4.textAlign = "left";s4.fillText("%s",0,0);s4.restore(); n",text3);
fprintf(OutputFile,"s4.save();X=.2*Lx;Y=y+Ly-20;s4.translate(X,Y);s4.rotate(2*Math.PI);s4.font="15px serif";s4.fillStyle = "#7fff00"; n");
fprintf(OutputFile,"s4.textAlign = "left";s4.fillText("%s",0,0);s4.restore(); n",text2);
for(i=0;i<10;i++){
x=.1*(i+1)*Xmax;
fprintf(OutputFile,"s5.save();X=-.29*Lx+Lx*(%d+1)*.1;Y=.3*y+Ly+20;s5.rotate(2*Math.PI);s5.font="16px serif"; n",i);
fprintf(OutputFile,"s5.fillStyle = "#7fff00";s5.textAlign = "left";s5.fillText("%.3e",X,Y);s5.restore(); n",x);
}
for(i=0;i<10;i++){
y=.1*(i+1)*Ymax;
fprintf(OutputFile,"s5.save();X=-.28*Lx-50;Y=Ly+.3*y-Ly*(%d+1)*.1;s5.rotate(2*Math.PI);s5.font="16px serif"; n",i);
fprintf(OutputFile,"s5.fillStyle = "#7fff00";s5.textAlign = "left";s5.fillText("%.3e",X,Y);s5.restore(); n",y);
}
fprintf(OutputFile,"s5.save();X=-.25*Lx;Y=.3*y+Ly+20;s5.rotate(2*Math.PI);s5.font="16px serif";s5.fillStyle = "#7fff00";s5.fillText(0,X,Y);s5.restore(); n");
fprintf(OutputFile,"s5.save();X=-.25*Lx-50;Y=Ly+.3*y;s5.rotate(2*Math.PI);s5.font="16px serif";s5.fillStyle = "#7fff00";s5.textAlign = "left";s5.fillText(0,X,Y);s5.restore();}; n");
fprintf(OutputFile,"</script></head><body><canvas id="myCanvas" width="1300" height="1300" style="border:1px solid black;"></canvas></body></html> n");
fclose(OutputFile);
}
double MAX_ABS(double A[],int n){
int i;
double B[N];
double Amax;
// abs value
for (i=0;i<n;i++){
B[i] = A[i];
if(B[i] < 0)
B[i] = -B[i];
}
// Max of abs
Amax = B[0];
for (i=1;i<n;i++){
if(Amax < B[i])
Amax = B[i];
}
return Amax;
}
Plot :
Figure(1) Analysis file
Figure(2) Input csv file
Figure(3) Displacement-Critical Buckling Load Graph in Html

More Related Content

What's hot

C PROGRAMS
C PROGRAMSC PROGRAMS
design and analysis of algorithm Lab files
design and analysis of algorithm Lab filesdesign and analysis of algorithm Lab files
design and analysis of algorithm Lab files
Nitesh Dubey
 
c-programming-using-pointers
c-programming-using-pointersc-programming-using-pointers
c-programming-using-pointers
Sushil Mishra
 
C++ file
C++ fileC++ file
C++ file
Mukund Trivedi
 
Data Structures Practical File
Data Structures Practical File Data Structures Practical File
Data Structures Practical File
Harjinder Singh
 
programs
programsprograms
programs
Vishnu V
 
Os lab file c programs
Os lab file c programsOs lab file c programs
Os lab file c programs
Kandarp Tiwari
 
C lab excellent
C lab excellentC lab excellent
C lab excellent
Srinivas Reddy Amedapu
 
Data structure new lab manual
Data structure  new lab manualData structure  new lab manual
Data structure new lab manual
SANTOSH RATH
 
Data Structures Using C Practical File
Data Structures Using C Practical File Data Structures Using C Practical File
Data Structures Using C Practical File
Rahul Chugh
 
Cpds lab
Cpds labCpds lab
Practical File of C Language
Practical File of C LanguagePractical File of C Language
Practical File of C Language
RAJWANT KAUR
 
SANER 2019 Most Influential Paper Talk
SANER 2019 Most Influential Paper TalkSANER 2019 Most Influential Paper Talk
SANER 2019 Most Influential Paper Talk
Nikolaos Tsantalis
 
C++ TUTORIAL 4
C++ TUTORIAL 4C++ TUTORIAL 4
C++ TUTORIAL 4
Farhan Ab Rahman
 
Basic Programs of C++
Basic Programs of C++Basic Programs of C++
Basic Programs of C++
Bharat Kalia
 
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILECOMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
Anushka Rai
 
Cn os-lp lab manual k.roshan
Cn os-lp lab manual k.roshanCn os-lp lab manual k.roshan
Cn os-lp lab manual k.roshan
riturajj
 
CS6311- PROGRAMMING & DATA STRUCTURE II LABORATORY
CS6311- PROGRAMMING & DATA STRUCTURE II LABORATORYCS6311- PROGRAMMING & DATA STRUCTURE II LABORATORY
CS6311- PROGRAMMING & DATA STRUCTURE II LABORATORY
Radha Maruthiyan
 
VTU Data Structures Lab Manual
VTU Data Structures Lab ManualVTU Data Structures Lab Manual
VTU Data Structures Lab Manual
Nithin Kumar,VVCE, Mysuru
 
Data structures lab manual
Data structures lab manualData structures lab manual
Data structures lab manual
Syed Mustafa
 

What's hot (20)

C PROGRAMS
C PROGRAMSC PROGRAMS
C PROGRAMS
 
design and analysis of algorithm Lab files
design and analysis of algorithm Lab filesdesign and analysis of algorithm Lab files
design and analysis of algorithm Lab files
 
c-programming-using-pointers
c-programming-using-pointersc-programming-using-pointers
c-programming-using-pointers
 
C++ file
C++ fileC++ file
C++ file
 
Data Structures Practical File
Data Structures Practical File Data Structures Practical File
Data Structures Practical File
 
programs
programsprograms
programs
 
Os lab file c programs
Os lab file c programsOs lab file c programs
Os lab file c programs
 
C lab excellent
C lab excellentC lab excellent
C lab excellent
 
Data structure new lab manual
Data structure  new lab manualData structure  new lab manual
Data structure new lab manual
 
Data Structures Using C Practical File
Data Structures Using C Practical File Data Structures Using C Practical File
Data Structures Using C Practical File
 
Cpds lab
Cpds labCpds lab
Cpds lab
 
Practical File of C Language
Practical File of C LanguagePractical File of C Language
Practical File of C Language
 
SANER 2019 Most Influential Paper Talk
SANER 2019 Most Influential Paper TalkSANER 2019 Most Influential Paper Talk
SANER 2019 Most Influential Paper Talk
 
C++ TUTORIAL 4
C++ TUTORIAL 4C++ TUTORIAL 4
C++ TUTORIAL 4
 
Basic Programs of C++
Basic Programs of C++Basic Programs of C++
Basic Programs of C++
 
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILECOMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
 
Cn os-lp lab manual k.roshan
Cn os-lp lab manual k.roshanCn os-lp lab manual k.roshan
Cn os-lp lab manual k.roshan
 
CS6311- PROGRAMMING & DATA STRUCTURE II LABORATORY
CS6311- PROGRAMMING & DATA STRUCTURE II LABORATORYCS6311- PROGRAMMING & DATA STRUCTURE II LABORATORY
CS6311- PROGRAMMING & DATA STRUCTURE II LABORATORY
 
VTU Data Structures Lab Manual
VTU Data Structures Lab ManualVTU Data Structures Lab Manual
VTU Data Structures Lab Manual
 
Data structures lab manual
Data structures lab manualData structures lab manual
Data structures lab manual
 

Similar to Critical buckling load geometric nonlinearity analysis of springs with rigid element displacement control large deformation formulated in c programming

week-5x
week-5xweek-5x
week-3x
week-3xweek-3x
C lab programs
C lab programsC lab programs
C lab programs
Dr. Prashant Vats
 
C lab programs
C lab programsC lab programs
C lab programs
Dr. Prashant Vats
 
Cquestions
Cquestions Cquestions
Cquestions
mohamed sikander
 
C Programming lab
C Programming labC Programming lab
C Programming lab
Vikram Nandini
 
Data Structure using C
Data Structure using CData Structure using C
Data Structure using C
Bilal Mirza
 
'C' language notes (a.p)
'C' language notes (a.p)'C' language notes (a.p)
'C' language notes (a.p)
Ashishchinu
 
C Programming Example
C Programming Example C Programming Example
C Programming Example
University of Potsdam
 
Chapter 8 c solution
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solution
Azhar Javed
 
Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020
vrgokila
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2
Koshy Geoji
 
C programming BY Mazedur
C programming BY MazedurC programming BY Mazedur
C programming BY Mazedur
Mazedurr rahman
 
Computer graphics lab assignment
Computer graphics lab assignmentComputer graphics lab assignment
Computer graphics lab assignment
Abdullah Al Shiam
 
The solution manual of c by robin
The solution manual of c by robinThe solution manual of c by robin
The solution manual of c by robin
Abdullah Al Naser
 
DataStructures notes
DataStructures notesDataStructures notes
DataStructures notes
Lakshmi Sarvani Videla
 
Pointer basics
Pointer basicsPointer basics
Pointer basics
Mohammed Sikander
 
Pnno
PnnoPnno
Chapter 7 functions (c)
Chapter 7 functions (c)Chapter 7 functions (c)
Chapter 7 functions (c)
hhliu
 
C Programming
C ProgrammingC Programming
C Programming
Sumant Diwakar
 

Similar to Critical buckling load geometric nonlinearity analysis of springs with rigid element displacement control large deformation formulated in c programming (20)

week-5x
week-5xweek-5x
week-5x
 
week-3x
week-3xweek-3x
week-3x
 
C lab programs
C lab programsC lab programs
C lab programs
 
C lab programs
C lab programsC lab programs
C lab programs
 
Cquestions
Cquestions Cquestions
Cquestions
 
C Programming lab
C Programming labC Programming lab
C Programming lab
 
Data Structure using C
Data Structure using CData Structure using C
Data Structure using C
 
'C' language notes (a.p)
'C' language notes (a.p)'C' language notes (a.p)
'C' language notes (a.p)
 
C Programming Example
C Programming Example C Programming Example
C Programming Example
 
Chapter 8 c solution
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solution
 
Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2
 
C programming BY Mazedur
C programming BY MazedurC programming BY Mazedur
C programming BY Mazedur
 
Computer graphics lab assignment
Computer graphics lab assignmentComputer graphics lab assignment
Computer graphics lab assignment
 
The solution manual of c by robin
The solution manual of c by robinThe solution manual of c by robin
The solution manual of c by robin
 
DataStructures notes
DataStructures notesDataStructures notes
DataStructures notes
 
Pointer basics
Pointer basicsPointer basics
Pointer basics
 
Pnno
PnnoPnno
Pnno
 
Chapter 7 functions (c)
Chapter 7 functions (c)Chapter 7 functions (c)
Chapter 7 functions (c)
 
C Programming
C ProgrammingC Programming
C Programming
 

More from Salar Delavar Qashqai

Pushover 2order (p delta effect) analysis force analogy method with force con...
Pushover 2order (p delta effect) analysis force analogy method with force con...Pushover 2order (p delta effect) analysis force analogy method with force con...
Pushover 2order (p delta effect) analysis force analogy method with force con...
Salar Delavar Qashqai
 
Pushover analysis of frame by force analogy method with force control based o...
Pushover analysis of frame by force analogy method with force control based o...Pushover analysis of frame by force analogy method with force control based o...
Pushover analysis of frame by force analogy method with force control based o...
Salar Delavar Qashqai
 
Truss optimization with excel solver
Truss optimization with excel solverTruss optimization with excel solver
Truss optimization with excel solver
Salar Delavar Qashqai
 
Pushover analysis of triangular steel membrane element subjected to lateral d...
Pushover analysis of triangular steel membrane element subjected to lateral d...Pushover analysis of triangular steel membrane element subjected to lateral d...
Pushover analysis of triangular steel membrane element subjected to lateral d...
Salar Delavar Qashqai
 
Pushover analysis of simply support steel section beam based on plastic hinge...
Pushover analysis of simply support steel section beam based on plastic hinge...Pushover analysis of simply support steel section beam based on plastic hinge...
Pushover analysis of simply support steel section beam based on plastic hinge...
Salar Delavar Qashqai
 
Pushover analysis of steel section beam subjected to incremental vertical loa...
Pushover analysis of steel section beam subjected to incremental vertical loa...Pushover analysis of steel section beam subjected to incremental vertical loa...
Pushover analysis of steel section beam subjected to incremental vertical loa...
Salar Delavar Qashqai
 
Moment curvature analysis of unconfined concrete section with matlab and sap2000
Moment curvature analysis of unconfined concrete section with matlab and sap2000Moment curvature analysis of unconfined concrete section with matlab and sap2000
Moment curvature analysis of unconfined concrete section with matlab and sap2000
Salar Delavar Qashqai
 
Large deformation analysis of cantilever beam subjected to concentrated const...
Large deformation analysis of cantilever beam subjected to concentrated const...Large deformation analysis of cantilever beam subjected to concentrated const...
Large deformation analysis of cantilever beam subjected to concentrated const...
Salar Delavar Qashqai
 
Moment curvature analysis unconfined concrete section with different tension...
Moment curvature analysis unconfined concrete section  with different tension...Moment curvature analysis unconfined concrete section  with different tension...
Moment curvature analysis unconfined concrete section with different tension...
Salar Delavar Qashqai
 
Optimization of steel section based on moment and section ductility
Optimization of steel section based on moment and section ductilityOptimization of steel section based on moment and section ductility
Optimization of steel section based on moment and section ductility
Salar Delavar Qashqai
 
Nonlinear analysis of 2 d cantilever nonprismatic beam with plastic hinge con...
Nonlinear analysis of 2 d cantilever nonprismatic beam with plastic hinge con...Nonlinear analysis of 2 d cantilever nonprismatic beam with plastic hinge con...
Nonlinear analysis of 2 d cantilever nonprismatic beam with plastic hinge con...
Salar Delavar Qashqai
 
Import data from csv excel file and export to xml excel file in c programming
Import data from csv excel file and export to xml excel file in c programmingImport data from csv excel file and export to xml excel file in c programming
Import data from csv excel file and export to xml excel file in c programming
Salar Delavar Qashqai
 
Elastic response pseudo spectrum in c programming
Elastic response pseudo spectrum in c programmingElastic response pseudo spectrum in c programming
Elastic response pseudo spectrum in c programming
Salar Delavar Qashqai
 
Structural eigen value analysis in c programming
Structural eigen value analysis in c programmingStructural eigen value analysis in c programming
Structural eigen value analysis in c programming
Salar Delavar Qashqai
 
Pushover analysis force analogy method with force control based on timoshenko...
Pushover analysis force analogy method with force control based on timoshenko...Pushover analysis force analogy method with force control based on timoshenko...
Pushover analysis force analogy method with force control based on timoshenko...
Salar Delavar Qashqai
 
Analysis of 1st order and 2nd order nonlinear semi rigid connection braced fr...
Analysis of 1st order and 2nd order nonlinear semi rigid connection braced fr...Analysis of 1st order and 2nd order nonlinear semi rigid connection braced fr...
Analysis of 1st order and 2nd order nonlinear semi rigid connection braced fr...
Salar Delavar Qashqai
 
Analysis of 1st order and 2nd order nonlinear semi rigid connection frame sub...
Analysis of 1st order and 2nd order nonlinear semi rigid connection frame sub...Analysis of 1st order and 2nd order nonlinear semi rigid connection frame sub...
Analysis of 1st order and 2nd order nonlinear semi rigid connection frame sub...
Salar Delavar Qashqai
 
Moment curvature analysis confined concrete section in matlab
Moment curvature analysis confined concrete section in matlabMoment curvature analysis confined concrete section in matlab
Moment curvature analysis confined concrete section in matlab
Salar Delavar Qashqai
 
Moment curvature analysis of unconfined circular concrete pipe section with m...
Moment curvature analysis of unconfined circular concrete pipe section with m...Moment curvature analysis of unconfined circular concrete pipe section with m...
Moment curvature analysis of unconfined circular concrete pipe section with m...
Salar Delavar Qashqai
 
Nonlinear analysis of fixed support beam with hinge by hinge method in c prog...
Nonlinear analysis of fixed support beam with hinge by hinge method in c prog...Nonlinear analysis of fixed support beam with hinge by hinge method in c prog...
Nonlinear analysis of fixed support beam with hinge by hinge method in c prog...
Salar Delavar Qashqai
 

More from Salar Delavar Qashqai (20)

Pushover 2order (p delta effect) analysis force analogy method with force con...
Pushover 2order (p delta effect) analysis force analogy method with force con...Pushover 2order (p delta effect) analysis force analogy method with force con...
Pushover 2order (p delta effect) analysis force analogy method with force con...
 
Pushover analysis of frame by force analogy method with force control based o...
Pushover analysis of frame by force analogy method with force control based o...Pushover analysis of frame by force analogy method with force control based o...
Pushover analysis of frame by force analogy method with force control based o...
 
Truss optimization with excel solver
Truss optimization with excel solverTruss optimization with excel solver
Truss optimization with excel solver
 
Pushover analysis of triangular steel membrane element subjected to lateral d...
Pushover analysis of triangular steel membrane element subjected to lateral d...Pushover analysis of triangular steel membrane element subjected to lateral d...
Pushover analysis of triangular steel membrane element subjected to lateral d...
 
Pushover analysis of simply support steel section beam based on plastic hinge...
Pushover analysis of simply support steel section beam based on plastic hinge...Pushover analysis of simply support steel section beam based on plastic hinge...
Pushover analysis of simply support steel section beam based on plastic hinge...
 
Pushover analysis of steel section beam subjected to incremental vertical loa...
Pushover analysis of steel section beam subjected to incremental vertical loa...Pushover analysis of steel section beam subjected to incremental vertical loa...
Pushover analysis of steel section beam subjected to incremental vertical loa...
 
Moment curvature analysis of unconfined concrete section with matlab and sap2000
Moment curvature analysis of unconfined concrete section with matlab and sap2000Moment curvature analysis of unconfined concrete section with matlab and sap2000
Moment curvature analysis of unconfined concrete section with matlab and sap2000
 
Large deformation analysis of cantilever beam subjected to concentrated const...
Large deformation analysis of cantilever beam subjected to concentrated const...Large deformation analysis of cantilever beam subjected to concentrated const...
Large deformation analysis of cantilever beam subjected to concentrated const...
 
Moment curvature analysis unconfined concrete section with different tension...
Moment curvature analysis unconfined concrete section  with different tension...Moment curvature analysis unconfined concrete section  with different tension...
Moment curvature analysis unconfined concrete section with different tension...
 
Optimization of steel section based on moment and section ductility
Optimization of steel section based on moment and section ductilityOptimization of steel section based on moment and section ductility
Optimization of steel section based on moment and section ductility
 
Nonlinear analysis of 2 d cantilever nonprismatic beam with plastic hinge con...
Nonlinear analysis of 2 d cantilever nonprismatic beam with plastic hinge con...Nonlinear analysis of 2 d cantilever nonprismatic beam with plastic hinge con...
Nonlinear analysis of 2 d cantilever nonprismatic beam with plastic hinge con...
 
Import data from csv excel file and export to xml excel file in c programming
Import data from csv excel file and export to xml excel file in c programmingImport data from csv excel file and export to xml excel file in c programming
Import data from csv excel file and export to xml excel file in c programming
 
Elastic response pseudo spectrum in c programming
Elastic response pseudo spectrum in c programmingElastic response pseudo spectrum in c programming
Elastic response pseudo spectrum in c programming
 
Structural eigen value analysis in c programming
Structural eigen value analysis in c programmingStructural eigen value analysis in c programming
Structural eigen value analysis in c programming
 
Pushover analysis force analogy method with force control based on timoshenko...
Pushover analysis force analogy method with force control based on timoshenko...Pushover analysis force analogy method with force control based on timoshenko...
Pushover analysis force analogy method with force control based on timoshenko...
 
Analysis of 1st order and 2nd order nonlinear semi rigid connection braced fr...
Analysis of 1st order and 2nd order nonlinear semi rigid connection braced fr...Analysis of 1st order and 2nd order nonlinear semi rigid connection braced fr...
Analysis of 1st order and 2nd order nonlinear semi rigid connection braced fr...
 
Analysis of 1st order and 2nd order nonlinear semi rigid connection frame sub...
Analysis of 1st order and 2nd order nonlinear semi rigid connection frame sub...Analysis of 1st order and 2nd order nonlinear semi rigid connection frame sub...
Analysis of 1st order and 2nd order nonlinear semi rigid connection frame sub...
 
Moment curvature analysis confined concrete section in matlab
Moment curvature analysis confined concrete section in matlabMoment curvature analysis confined concrete section in matlab
Moment curvature analysis confined concrete section in matlab
 
Moment curvature analysis of unconfined circular concrete pipe section with m...
Moment curvature analysis of unconfined circular concrete pipe section with m...Moment curvature analysis of unconfined circular concrete pipe section with m...
Moment curvature analysis of unconfined circular concrete pipe section with m...
 
Nonlinear analysis of fixed support beam with hinge by hinge method in c prog...
Nonlinear analysis of fixed support beam with hinge by hinge method in c prog...Nonlinear analysis of fixed support beam with hinge by hinge method in c prog...
Nonlinear analysis of fixed support beam with hinge by hinge method in c prog...
 

Recently uploaded

This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...
DharmaBanothu
 
Digital Image Processing Unit -2 Notes complete
Digital Image Processing Unit -2 Notes completeDigital Image Processing Unit -2 Notes complete
Digital Image Processing Unit -2 Notes complete
shubhamsaraswat8740
 
Beckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview PresentationBeckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview Presentation
VanTuDuong1
 
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
sydezfe
 
Blood finder application project report (1).pdf
Blood finder application project report (1).pdfBlood finder application project report (1).pdf
Blood finder application project report (1).pdf
Kamal Acharya
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
Divyanshu
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
nedcocy
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
ydzowc
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
vmspraneeth
 
Height and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdfHeight and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdf
q30122000
 
Assistant Engineer (Chemical) Interview Questions.pdf
Assistant Engineer (Chemical) Interview Questions.pdfAssistant Engineer (Chemical) Interview Questions.pdf
Assistant Engineer (Chemical) Interview Questions.pdf
Seetal Daas
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
Indrajeet sahu
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
ijseajournal
 
AN INTRODUCTION OF AI & SEARCHING TECHIQUES
AN INTRODUCTION OF AI & SEARCHING TECHIQUESAN INTRODUCTION OF AI & SEARCHING TECHIQUES
AN INTRODUCTION OF AI & SEARCHING TECHIQUES
drshikhapandey2022
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
Kamal Acharya
 
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptxEV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
nikshimanasa
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
aryanpankaj78
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
ElakkiaU
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
uqyfuc
 
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls ChennaiCall Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
paraasingh12 #V08
 

Recently uploaded (20)

This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...
 
Digital Image Processing Unit -2 Notes complete
Digital Image Processing Unit -2 Notes completeDigital Image Processing Unit -2 Notes complete
Digital Image Processing Unit -2 Notes complete
 
Beckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview PresentationBeckhoff Programmable Logic Control Overview Presentation
Beckhoff Programmable Logic Control Overview Presentation
 
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
 
Blood finder application project report (1).pdf
Blood finder application project report (1).pdfBlood finder application project report (1).pdf
Blood finder application project report (1).pdf
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
 
Height and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdfHeight and depth gauge linear metrology.pdf
Height and depth gauge linear metrology.pdf
 
Assistant Engineer (Chemical) Interview Questions.pdf
Assistant Engineer (Chemical) Interview Questions.pdfAssistant Engineer (Chemical) Interview Questions.pdf
Assistant Engineer (Chemical) Interview Questions.pdf
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
 
AN INTRODUCTION OF AI & SEARCHING TECHIQUES
AN INTRODUCTION OF AI & SEARCHING TECHIQUESAN INTRODUCTION OF AI & SEARCHING TECHIQUES
AN INTRODUCTION OF AI & SEARCHING TECHIQUES
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
 
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptxEV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
EV BMS WITH CHARGE MONITOR AND FIRE DETECTION.pptx
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls ChennaiCall Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
 

Critical buckling load geometric nonlinearity analysis of springs with rigid element displacement control large deformation formulated in c programming

  • 1. >> IN THE NAME OF GOD < Critical Buckling Load Geometric Nonlinearity Analysis of Springs with Rigid Element Displacement Control Large Deformation Formulated in C programming C program is written by Salar Delavar Ghashghaei – Publication Date: 02/November/2018 E-mail: salar.d.ghashghaei@gmail.com
  • 2. C Code: #include <stdio.h> #include <windows.h> // text color #include <conio.h> #define N 10000 #define ShowText01 "RigidElementSpringDCStrainGNPcr-inputDATA.csv" #define ShowText02 "RigidElementSpringDCStrainGNPcr-outputEXCEL.csv" #define ShowText03 "RigidElementSpringDCStrainGNPcr-outputMATLAB.m" #define ShowText04 "Graph-outputHTML.html" void IMPORT_DATA01(double Import_Data[]); void MessageNegative_IMPORT_DATA01(double Import_Data[]); void MessageInputDataTEXT(); void MessageAnalysisReportTEXT(); void MessageErrorReportTEXT(); void MessageInitialData(double Import_Data[],int n); void MessageStarinStressTEXT(double STARIN01[],double STRESS01[],double STARIN02[],double STRESS02[],int n); void textcolor(int ForgC); void Distance(int i); void ANALYSIS(double Import_Data[],int n,int m); double ABS(double B); double Horizental_Disp(double L,double &x,double y); double SQRT2(double D); double MAX_ABS(double A[],int n); void OUTPUT_excel(double A[],double B[],double C[],int n); void OUTPUT_HTML_GRAPH(double X[],double Y[],int n,const char text1[],const char text2[],const char text3[]); int main(){ int k; double Import_Data[13]; IMPORT_DATA01(Import_Data); MessageNegative_IMPORT_DATA01(Import_Data); int m = 1 + ABS(Import_Data[12]/Import_Data[10]); textcolor(10); MessageInitialData(Import_Data,m); textcolor(14); ANALYSIS(Import_Data,k,m); getch(); return 0; } void IMPORT_DATA01(double Import_Data[]){ int i=0; FILE *InputFile; InputFile = fopen(ShowText01, "r"); if (!InputFile){ MessageErrorReportTEXT(); printf(" File is not available! -> [%s] n",ShowText01); Sleep(6000); exit(1); } char line[100],a[100]; while(i < N && fgets(line,sizeof(line),InputFile) != NULL){ sscanf(line,"%s",a); //printf("a[%d]: %sn",i,a); Import_Data[i]= atof(a); i++; } } void MessageNegative_IMPORT_DATA01(double Import_Data[]){ if ( Import_Data[0] < 0 || Import_Data[1] < 0 || Import_Data[2] < 0 || Import_Data[3] < 0 || Import_Data[4] < 0 || Import_Data[5] < 0 || Import_Data[10] < 0|| Import_Data[12] < 0){ MessageErrorReportTEXT(); printf(" Please check this file! -> [%s]n",ShowText01); printf(" *** Negative data input value is not acceptable ***n"); printf(" Rotational Spring Stiffness: %fn",Import_Data[0]); printf(" Length of rigid element: %fn",Import_Data[1]); printf(" Spring length 1: %fn",Import_Data[2]); printf(" Spring length 2: %fn",Import_Data[3]); printf(" Spring area 1: %fn",Import_Data[4]); printf(" Spring area 2: %fn",Import_Data[5]); printf(" Spring modulus of elasticity 1: %fn",Import_Data[6]); printf(" Spring modulus of elasticity 2: %fn",Import_Data[7]); printf(" External applied load in spring 1: %fn",Import_Data[8]); printf(" External applied load in spring 2: %fn",Import_Data[9]); printf(" Initial applied displacement: %fn",Import_Data[10]); printf(" Distance of spring 1 from rigid element: %fn",Import_Data[11]); printf(" Ultimate absolute displacement: %fn",Import_Data[12]); Sleep(40000); exit(1); } } void textcolor(int ForgC){ WORD wColor; //This handle is needed to get the current background attribute HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_SCREEN_BUFFER_INFO csbi; //csbi is used for wAttributes word if(GetConsoleScreenBufferInfo(hStdOut, &csbi)){ //To mask out all but the background attribute, and to add the color wColor = (csbi.wAttributes & 0xF0) + (ForgC & 0x0F); SetConsoleTextAttribute(hStdOut, wColor); } return; } void MessageErrorReportTEXT(){ int i;
  • 3. char Ql; Ql=176; textcolor(12); printf("an "); for (i=1;i<50;i++) printf("%c",Ql); printf(" Error Report "); for (i=1;i<50;i++) printf("%c",Ql); printf("n"); } void MessageInputDataTEXT(){ int i; char Ql=176; printf("n "); for (i=1;i<50;i++) printf("%c",Ql); printf(" Input Data "); for (i=1;i<50;i++) printf("%c",Ql); printf("n"); } void MessageAnalysisReportTEXT(){ int i; char Ql=176; printf("n "); for (i=1;i<47;i++) printf("%c",Ql); printf(" Analysis Report "); for (i=1;i<47;i++) printf("%c",Ql); printf("n"); printf("nt "); for (i=1;i<98;i++) printf("-"); printf("n"); printf("t Increment Base Shear Incremental Displacement[DOF(1)] Critical Pressure Load n"); printf("t "); for (i=1;i<98;i++) printf("-"); printf("n"); } void Distance(int i){ if (i < 10) printf("b"); if (i >= 10 && i <= 99) printf("btb"); if (i >= 100 && i <= 999) printf("btbb"); if (i >= 1000 && i <= 9999) printf("btbbb"); if (i >= 10000 && i <= 20000) printf("btbbbb"); } double ABS(double B){ if (B < 0) B = -B;//Absolute number else B = B; return B; } void ANALYSIS(double Import_Data[],int n,int m){ double L,Dx,a=0,Le[2],Area[2],Elas[2],Force[2],K[2],Dini,Dmax,Du,up,K_rotation; int z,well_done=0; double output_u[N],output_Pcr[N],output_base[N]; K_rotation = Import_Data[0]; L = Import_Data[1]; Le[0] = Import_Data[2]; Le[1] = Import_Data[3]; Area[0] = Import_Data[4]; Area[1] = Import_Data[5]; Elas[0] = Import_Data[6]; Elas[1] = Import_Data[7]; Force[0] = Import_Data[8]; Force[1] = Import_Data[9]; Dini = Import_Data[10]; Du = Import_Data[11]; Dmax = Import_Data[12]; double F[2],LE[2]; MessageAnalysisReportTEXT(); for (z=0;z<m;z++){ up = Dini*(z+1);// Define the applied Displacement Horizental_Disp(L,Dx,up); LE[0] = SQRT2((Le[0]+.5*up)*(Le[0]+.5*up)+Dx*Dx); K[0] = Elas[0]*Area[0]/LE[0]; F[0] = (((Le[0]+.5*up)/LE[0])*((Le[0]+.5*up)/LE[0]))*K[0]*0.5*up + Import_Data[8]; LE[1] = SQRT2((Le[1]-up)*(Le[1]-up) + Dx*Dx); K[1] = Elas[1]*Area[1]/LE[1]; F[1] = (((Le[1]-up)/LE[1])*((Le[1]-up)/LE[1]))*K[1]*up + Import_Data[9]; output_u[z] = up; output_Pcr[z] = (-Import_Data[8]*((.5*L*L)/(L-Dx))-Import_Data[9]*((L*L)/(L-Dx))+F[0]*((.5*L*L)/(L-Dx))+F[1]*((L*L)/(L-Dx))+K_rotation*(up/(L-Dx)))/up;//up/(L-Dx) output_base[z] = F[0] + F[1]; Distance(z); printf("tt%dtt%ett%ettt%en",z+1,output_base[z],output_u[z],output_Pcr[z]); if (ABS(up) >= Dmax){ well_done = 1; textcolor(13); printf("ntt Increment displacement reach to ultimate displacementnn"); break;
  • 4. } }// for if (well_done == 1){ OUTPUT_excel(output_u,output_Pcr,output_base,z); OUTPUT_HTML_GRAPH(output_u,output_Pcr,z+1,"Displacement - Critical Buckling Load Graph","Displacement","Critical Buckling Load"); textcolor(15); printf("na - Output data is written in Excel file -"); system("start /w Graph-outputHTML.html"); } } void OUTPUT_excel(double A[],double B[],double C[],int n){ // EXCEL OUTPUT int i; FILE *OutputFile; OutputFile = fopen(ShowText02, "w"); fprintf(OutputFile," ### Critical Pressure Load Geometric Nonlinearity Analysis of Springs with Displacement Control Large Deformation Formulated ###n"); fprintf(OutputFile,"Increment,Displacement [DOF(1)],Critical Pressure Load,Base Shearn"); for(i=0;i<n;i++) fprintf(OutputFile,"%d,%e,%e,%en",i+1,A[i],B[i],C[i]); fclose(OutputFile); } void MessageInitialData(double Import_Data[],int n){ char Qa,Qb,Qc,Qd,Qe,Qf,Qg,Qk; int i; Qa=201;Qb=205;Qc=187;Qd=200;Qe=188,Qf=186,Qg=204,Qk=185; printf("tttt%c",Qa); for (i=1;i<71;i++) printf("%c",Qb); printf("%cn",Qc); printf("tttt%c >> IN THE NAME OF GOD << %cn",Qf,Qf); printf("tttt%c Critical Pressure Load Geometric Nonlinearity Analysis of Springs %cn",Qf,Qf); printf("tttt%c with Displacement Control Large Deformation Formulated %cn",Qf,Qf); printf("tttt%c UNIT: Free Unit %cn",Qf,Qf); printf("tttt%c",Qg); for (i=1;i<71;i++) printf("%c",Qb); printf("%cn",Qk); printf("tttt%c This program is written by Salar Delavar Ghashghaei %cn",Qf,Qf); printf("tttt%c E-mail: salar.d.ghashghaei@gmail.com %cn",Qf,Qf); printf("tttt%c",Qd); for (i=1;i<71;i++) printf("%c",Qb); printf("%cn",Qe); MessageInputDataTEXT(); printf("t Rotational Spring Stiffness: %fn",Import_Data[0]); printf("t Length of rigid element: %fn",Import_Data[1]); printf("t Spring length 1: %fn",Import_Data[2]); printf("t Spring length 2: %fn",Import_Data[3]); printf("t Spring area 1: %fn",Import_Data[4]); printf("t Spring area 2: %fn",Import_Data[5]); printf("t Spring modulus of elasticity 1: %fn",Import_Data[6]); printf("t Spring modulus of elasticity 2: %fn",Import_Data[7]); printf("t External applied load in spring 1: %fn",Import_Data[8]); printf("t External applied load in spring 2: %fn",Import_Data[9]); printf("t Initial applied displacement: %fn",Import_Data[10]); printf("t Distance of spring 1 from rigid element: %fn",Import_Data[11]); printf("t Ultimate absolute displacement: %fn",Import_Data[12]); printf("t Number of increments: %dn",n); } double Horizental_Disp(double L,double &x,double y){ int it,itermax; double residual,tolerance,dx,dx_ABS,f,df; it = 0; // initialize iteration count itermax = 100000; residual = 100; // initialize residual tolerance = 1e-12; x = 1;// initialize answer while (residual > tolerance){ f = x*x + y*y - 2*L*x; df = 2*x - 2*L; dx = f/df; x -= dx; residual = ABS(dx); // abs residual it = it + 1; // increment iteration count //printf("f: %f -tdx: %f -tresidual: %fn",f,dx,residual); if (it == itermax){ printf("tSQRT2(number,power) : SQRT2(%f) - iteration: %d -> ## The solution is not converged ##n",y,it); break; } } if (it < itermax){ //printf("tSQRT(number,power) - SQRT(%f,%f) : %f n",D,n, x); return x; } } double SQRT2(double D){ int it,itermax; double residual,tolerance,x,dx,dx_ABS,f,df; it = 0; // initialize iteration count itermax = 100000; residual = 100; // initialize residual tolerance = 1e-8; x = 1;// initialize answer while (residual > tolerance){ f = x*x - D; df = 2 * x; dx = f/df; x= x - dx;
  • 5. residual = ABS(dx); // abs residual it = it + 1; // increment iteration count //printf("f: %f -tdx: %f -tresidual: %fn",f,dx,residual); if (it == itermax){ printf("tSQRT2(number,power) : SQRT2(%f) - iteration: %d -> ## The solution is not converged ##n",D,it); break; } } if (it < itermax){ //printf("tSQRT(number,power) - SQRT(%f,%f) : %f n",D,n, x); return x; } } void OUTPUT_HTML_GRAPH(double X[],double Y[],int n,const char text1[],const char text2[],const char text3[]){ // HTML GRAPH OUTPUT int i; double x,y,NorX[N],NorY[N],Xmax,Ymax; Xmax=MAX_ABS(X,n); Ymax=MAX_ABS(Y,n); for (i=0;i<n;i++){ NorX[i] = X[i]/Xmax; NorY[i] = Y[i]/Ymax; //printf("t %f %f n",NorX[i],NorY[i]); } FILE *OutputFile; OutputFile = fopen(ShowText04, "w"); fprintf(OutputFile,"<!DOCTYPE HTML><html><body style="background-color:black;"><font color="white"><head><script> n"); fprintf(OutputFile,"window.onload = function(){ n"); fprintf(OutputFile,"var canvas = document.getElementById("myCanvas");var s1 = canvas.getContext("2d");var s2 = canvas.getContext('2d'); n"); fprintf(OutputFile,"var s3 = canvas.getContext("2d");var s4 = canvas.getContext("2d");var s5 = canvas.getContext("2d"); n"); fprintf(OutputFile,"var x=120,y=100,X,Y,Lx=1100,Ly=500,i; n"); fprintf(OutputFile,"s3.beginPath();s3.lineWidth = 3;s3.strokeStyle = "cyan";s3.rect(x,y,Lx,Ly); n"); fprintf(OutputFile,"for(i=0;i<9;i++){s3.moveTo(x+Lx*(i+1)*.1,y+Ly);s3.lineTo(x+Lx*(i+1)*.1,y+Ly-10);}; n"); fprintf(OutputFile,"for(i=0;i<9;i++){s3.moveTo(x,y+Ly*(i+1)*.1);s3.lineTo(x+10,y+Ly*(i+1)*.1);};s3.stroke();n"); fprintf(OutputFile,"s1.beginPath();s1.lineWidth = 3;s1.strokeStyle = "yellow"; n"); for (i=0;i<n-1;i++){ fprintf(OutputFile,"s1.moveTo(%f,%f); n",120+NorX[i]*1100,100+500-NorY[i]*500); fprintf(OutputFile,"s1.lineTo(%f,%f); n",120+NorX[i+1]*1100,100+500-NorY[i+1]*500); } fprintf(OutputFile,"s1.stroke(); n"); fprintf(OutputFile,"s2.beginPath();s2.lineWidth = 1;s2.strokeStyle = "cyan";s2.setLineDash([5, 5]); n"); fprintf(OutputFile,"for(i=0;i<19;i++){s2.moveTo(x+Lx*(i+1)*.05,y);s2.lineTo(x+Lx*(i+1)*.05,y+Ly);} n"); fprintf(OutputFile,"s2.lineWidth = 1;s2.strokeStyle = "cyan";for(i=0;i<19;i++){s2.moveTo(x,y+Ly*(i+1)*.05);s2.lineTo(x+Lx,y+Ly*(i+1)*.05);} s2.stroke();n"); fprintf(OutputFile,"X=x+.25*Lx;Y=.7*y;s4.translate(X,Y);s4.font="30px serif";s4.fillStyle = "#7fff00";s4.fillText("%s",0,0); n",text1); fprintf(OutputFile,"s4.save();X=-X+.2*x;Y=-Y+y+.6*Ly;s4.translate(X,Y);s4.rotate(3*Math.PI/2);s4.font="15px serif"; n"); fprintf(OutputFile,"s4.fillStyle = "#7fff00";s4.textAlign = "left";s4.fillText("%s",0,0);s4.restore(); n",text3); fprintf(OutputFile,"s4.save();X=.2*Lx;Y=y+Ly-20;s4.translate(X,Y);s4.rotate(2*Math.PI);s4.font="15px serif";s4.fillStyle = "#7fff00"; n"); fprintf(OutputFile,"s4.textAlign = "left";s4.fillText("%s",0,0);s4.restore(); n",text2); for(i=0;i<10;i++){ x=.1*(i+1)*Xmax; fprintf(OutputFile,"s5.save();X=-.29*Lx+Lx*(%d+1)*.1;Y=.3*y+Ly+20;s5.rotate(2*Math.PI);s5.font="16px serif"; n",i); fprintf(OutputFile,"s5.fillStyle = "#7fff00";s5.textAlign = "left";s5.fillText("%.3e",X,Y);s5.restore(); n",x); } for(i=0;i<10;i++){ y=.1*(i+1)*Ymax; fprintf(OutputFile,"s5.save();X=-.28*Lx-50;Y=Ly+.3*y-Ly*(%d+1)*.1;s5.rotate(2*Math.PI);s5.font="16px serif"; n",i); fprintf(OutputFile,"s5.fillStyle = "#7fff00";s5.textAlign = "left";s5.fillText("%.3e",X,Y);s5.restore(); n",y); } fprintf(OutputFile,"s5.save();X=-.25*Lx;Y=.3*y+Ly+20;s5.rotate(2*Math.PI);s5.font="16px serif";s5.fillStyle = "#7fff00";s5.fillText(0,X,Y);s5.restore(); n"); fprintf(OutputFile,"s5.save();X=-.25*Lx-50;Y=Ly+.3*y;s5.rotate(2*Math.PI);s5.font="16px serif";s5.fillStyle = "#7fff00";s5.textAlign = "left";s5.fillText(0,X,Y);s5.restore();}; n"); fprintf(OutputFile,"</script></head><body><canvas id="myCanvas" width="1300" height="1300" style="border:1px solid black;"></canvas></body></html> n"); fclose(OutputFile); } double MAX_ABS(double A[],int n){ int i; double B[N]; double Amax; // abs value for (i=0;i<n;i++){ B[i] = A[i]; if(B[i] < 0) B[i] = -B[i]; } // Max of abs Amax = B[0]; for (i=1;i<n;i++){ if(Amax < B[i]) Amax = B[i]; } return Amax; }