Sunteți pe pagina 1din 9

Trasarea diagramelor de for tietoare i de moment ncovoietor

pentru o grind simplu rezemat



1) Enunul problemei
S se traseze diagrama de for tietoare i de moment ncovoietor pentru urmtoarea
structur:


2) Analiza problemei
Date de intrare:

- distanele dintre ncrcrile ce apar pe grind: a, b, c, d, e, f;

- ncrcrile ce apar pe grind: q1, q2, M1, M2, P1.

Date de ieire:

- lungimea total a grinzii: L;

- reaciunile: VA, VB;

- diagramele de fore tietoare i momente ncovoietoare.

Reaciuni:

- din suma de momente n punctul B:


()(



- din suma de momente n punctul A:


(







Funcia for tietoare:
()
{

[ )
(() ) [ )
[ )
[ )

((())

(() ) [ )

[ )





Funcia moment ncovoietor:

()
{

() [ )
() (() )
(())

[ )
() (() ) (()

) [ )
() (() ) (()

) [ )
() (() ) (()

(
()

(() )

() [ )
() (() ) (()

( ) (

() ) [ )






3) Programarea problemei
Programul surs n limbaj Fortran 90 este urmtorul:
!Masteran Ciobanu Andrei-Florin
program temaiii
use iflogm
implicit none
include 'resource.fd'
type(dialog) numint
integer rez
character*20 sir
external cheama,grafice
integer dateer
real a,b,c,d,e,f,L,q1,q2,p1,m1,m2,Va,Vb,V
common a,b,c,d,e,f,L,q1,q2,p1,m1,m2,Va,Vb,V,dateer

dateer=1 !date eronate

rez=dlginit(fereastra,numint)
rez=dlgsetsub(numint,txta,cheama)
rez=dlgsetsub(numint,txtb,cheama)
rez=dlgsetsub(numint,txtc,cheama)
rez=dlgsetsub(numint,txtd,cheama)
rez=dlgsetsub(numint,txte,cheama)
rez=dlgsetsub(numint,txtf,cheama)
rez=dlgsetsub(numint,txtq1,cheama)
rez=dlgsetsub(numint,txtq2,cheama)
rez=dlgsetsub(numint,txtp1,cheama)
rez=dlgsetsub(numint,txtm1,cheama)
rez=dlgsetsub(numint,txtm2,cheama)
rez=dlgsetsub(numint,tras,grafice)
rez=dlgmodal(numint)


print *, 'stop'
read *
end program temaiii

subroutine cheama(numint,ctrl,ce)
use iflogm
implicit none
include 'resource.fd'
type(dialog) numint
integer rez,ctrl,ce,er1,er2,er3,er4,er5,er6,er7,er8,er9,er10,er11
integer dateer
character*20 sir
real a,b,c,d,e,f,L,q1,q2,p1,m1,m2,Va,Vb,V
common a,b,c,d,e,f,L,q1,q2,p1,m1,m2,Va,Vb,V,dateer

rez=dlgget(numint,txta,sir)
read(sir,1,iostat=er1) a
1 format(f15.0)
rez=dlgget(numint,txtb,sir)
read(sir,1,iostat=er2) b
rez=dlgget(numint,txtc,sir)
read(sir,1,iostat=er3) c
rez=dlgget(numint,txtd,sir)
read(sir,1,iostat=er4) d
rez=dlgget(numint,txte,sir)
read(sir,1,iostat=er5) e
rez=dlgget(numint,txtf,sir)
read(sir,1,iostat=er6) f


rez=dlgget(numint,txtq1,sir)
read(sir,1,iostat=er7) q1
rez=dlgget(numint,txtq2,sir)
read(sir,1,iostat=er8) q2
rez=dlgget(numint,txtp1,sir)
read(sir,1,iostat=er9) p1
rez=dlgget(numint,txtm1,sir)
read(sir,1,iostat=er10) m1
rez=dlgget(numint,txtm2,sir)
read(sir,1,iostat=er11) m2

if ((er1==0).and.(er2==0).and.(er3==0).and.&
(er4==0).and.(er5==0).and.(er6==0).and.(er7==0).and.&
(er8==0).and.(er9==0).and.(er10==0).and.(er11==0).and.&
(a>0.).and.(b>0.).and.(c>0.).and.(d>0.).and.&
(e>0.).and.(f>0.)) then

rez=dlgset(numint,txtmesaj,'date corecte')
dateer=0 ! date corecte

L=a+b+c+d+e+f
write (sir,2) L
2 format(f6.2)
rez=dlgset(numint,txtl,sir)

Va=(m1-p1*(b+c+d+e+f)+q1*b*(b/2.+c+d+e+f)+m2-(q2*e)/2.*(1./3.*e+f))/L
write (sir,3)Va
3 format(f8.3)
rez=dlgset(numint,txtva,sir)

Vb=(-(q2*e)/2.*(2./3.*e+d+c+b+a)-m2+q1*b*(b/2.+a)-p1*a-m1)/L
write (sir,3)Vb
rez=dlgset(numint,txtVb,sir)

V=Va+Vb-q1*b+p1+(q2*e)/2.
write (sir,3)V
rez=dlgset(numint,txtv,sir)

else
rez=dlgset(numint,txtmesaj,'eroare')
rez=dlgset(numint,txtl,'')
rez=dlgset(numint,txtva,'')
rez=dlgset(numint,txtvb,'')
rez=dlgset(numint,txtv,'')
endif
end subroutine cheama

subroutine grafice()
use iflogm
use avfrt
use avobjmod
implicit none
include 'resource.fd'
type(dialog) numint
integer dateer, rez
real a,b,c,d,e,f,L,q1,q2,p1,m1,m2,Va,Vb,V
common a,b,c,d,e,f,L,q1,q2,p1,m1,m2,Va,Vb,V,dateer
integer i,st,vid,hroot,hg
integer , parameter:: mx=1001
real px(mx), py(mx),pz(mx)

if (dateer==0) then
write(*,*)'se traseaza diagramele'
!rez=dlgset(numint,txtmesaj,'se traseaza diagramele')



do i=1,mx
px(i)=(i-1)*L/(mx-1)
if (px(i)<a) then
py(i)=Va
pz(i)= -m1+Va*px(i)
elseif (px(i)<(a+b))then
py(i)=Va+p1-q1*(px(i)-a)
pz(i)=-m1+Va*px(i)+p1*(px(i)-a)-q1*(px(i)-a)**2/2.

elseif (px(i)<(a+b+c)) then
py(i)=Va+p1-q1*b
pz(i)=-m1+Va*px(i)+p1*(px(i)-a)-q1*b*(b/2.0+px(i)-a-b)
elseif (px(i)<(a+b+c+d)) then
py(i)=Va+p1-q1*b
pz(i)=-m1+Va*px(i)+p1*(px(i)-a)-q1*b*(b/2.0+c+px(i)-a-b-c)-m2
elseif (px(i)<(a+b+c+d+e)) then
py(i)=Va+p1-q1*b+1./2.*(q2*(px(i)-a-b-c-d)/e)*(px(i)-a-b-c-d)
pz(i)=-m1+Va*px(i)+p1*(px(i)-a)-q1*b*(b/2.0+c+d+px(i)-a-b-c-d)&
-m2+1./2.*(q2*(px(i)-a-b-c-d)/e)*(px(i)-a-b-c-d)*1./3.*(px(i)-a-b-c-d)
else
py(i)=Va+p1-q1*b+1./2.*(q2*e)
pz(i)=-m1+Va*px(i)+p1*(px(i)-a)-q1*b*(b/2.0+c+d+e+px(i)-a-b-c-d-e)&
-m2+1.0/2.0*(q2*e)*(1./3.*e+px(i)-a-b-c-d-e)
endif
enddo

call AvStartWatch(loc(px),1,shape(px),AV_REAL4,'px',st)
call AvStartWatch(loc(py),1,shape(py),AV_REAL4,'py',st)
call AvStartWatch(loc(pz),1,shape(pz),AV_REAL4,'pz',st)

call AvNewViewer(vid)
hroot=AvGetObject('/')
call AvNewViewer(vid)
hroot=AvGetObject('/')
call AvCreateGraph2Dobj(AvGraphs(hroot),'forta
taitoare|plot:xyplot,xsource:/px,ysource:/py',hg)
call AvCreateGraph2Dobj(AvGraphs(hroot),'moment
inc|plot:xyplot,xsource:/px,ysource:/pz',hg)
call avvisible(vid,1,st)
call avsaveimage('gsin.jpg','graph:/forta taietoare',1200,1600,72,st)
call avsaveimage('gsin.jpg','graph:/mom inc',1200,1600,72,st)




else
write(*,*)'diagramele nu se pot trasa'
!rez=dlgset(numint,txtmesaj,'nu se pot trasa diagramele')
endif
end subroutine grafice














4) Rezultate
Programul a fost rulat pentru un set de date corect iar alt set de date eronate pentru a se observa
corectitudinea acestuia.

Fereastra de dialog:


Setul corect de date:




Faptul c acest set de date este corect ne este confirmat i de mesajul aprut n csua de
verificare a datelor introduse, date corecte.












Graficele sunt afiate cu ajutorul programului Array visualizer, n modul urmtor:


Diagrama de for tietoare:




Diagrama de moment ncovoietor:

Setul de date eronate:



Se poate observa c n csua Verificarea introducerii datelor apare un mesaj de eroare.

5) Concluzii
S-a programat calculul i trasarea diagramelor de for tietoare i moment ncovoietor pentru o
grind simplu rezemat cu ajutorul cunotinelor de static, utiliznd limbajul de programare
Fortran 90 sub implementarea Intel Fortran i mediul de programare Microsoft Visual Studio 2008
i Intel Array Visualizer pentru reprezentarea diagramelor.

S-ar putea să vă placă și