## General Mechanical

#### Spring mass model – control force applied

• KUMARA
Subscriber
As can be seen from the code, system is excited with a external force applied just at the instant 0.1s and again NO force is applied till 1s. During this time, as expected the system is oscillating at the natural frequency. But, then at 1s, I applied force on mass. This force is proportional to the displacement of the mass (like a spring, 0.5*error). But, the response is indicating that external force applied after 1s is acting as a damper not as a spring. Kindly help me how to interpret it accurately. I am using ANSYS 2020 R2.
• Aniket
Ansys Employee
Ansys staff can not download any files on the forum, so if you want to reach a larger audience to get answers from, please insert inline images describing your problem.
-Aniket
How to access Ansys help links
Guidelines for Posting on Ansys Learning Forum
• peteroznewman
Subscriber
!KUMARA RAJA E
!Dynamic Analysis of SMMODEL
/title,Spring Mass Controller force

FINISH
/Clear

/PREP7
ET,1,MASS21
!*
ET,2,COMBIN14
!*
R,1,0.001, , , , R,2,1,0,0, , ,50

!Defining Material properties (Not needed for this problem though)
MPTEMP,1,0
MPDATA,EX,1,,210000
MPDATA,DENS,1,,7800E-12
MPDATA,PRXY,1,,0.3

!Defining two nodes
n,1,, n,2,50,

! MODEL Definition
!Defining element attributes before creating elements
TYPE, 1
MAT, 1
REAL, 1
ESYS, 0

!Creating mass element at node 2
E,2, !Element 1 definition

!Defining element attributes before creating elements
TYPE,2
MAT,1
REAL,2
ESYS,0

!Creating spring between node1 and node2
E,1,2

!Defining boundary condition (Fix node1)
D,1,all,all

! Setup analysis
/solu
antype,transient
trnopt,full

time,0.001
solve

*DO,t,0.01,3,0.01 !Begining of DO loop
TIME,t !Time at the end of load step
*IF,t,LT,0.1,THEN, !Begining of IF condition
F,2,FX,0
*ELSEIF,t,EQ,0.1,THEN
F,2,FX,2 ! A 2N force applied at 0.1s
*ELSEIF,t,GT,0.1,AND,t,LT,1
F,2,FX,0 ! Zero external force
*ELSE
*GET,error,NODE,2,U,X ! Obtain the deformation of node2
F,2,FX,error*0.5 ! Applying the force
*ENDIF !End of IF Condition
SOLVE
*ENDDO !END of DO loop

!Post processing
/post26
nsol,3,2,u,x plvar,3

• Ashish Khemka
Ansys Employee

Hi Kumara,

I tried modeling the problem you described at my end and I found the displacement of the mass to be correct.

-------------------------------

ANTYPE,TRANSIENT
/prep7
ET,1,COMBIN14,,,2
ET,2,MASS21,,,4
R,1,200            ! SPRING CONSTANT = 200
R,2,.5             ! MASS = .5
N,1
N,2,1
FILL
E,1,2              ! SPRING ELEMENT (TYPE,1) AND K = 200 (REAL,1)
TYPE,2
REAL,2
E,2                ! MASS ELEMENT (TYPE,2) AND MASS = .5 (REAL,3)
D,1,ALL,0
/solu
trnopt,full
! Time values
! Time values
autots,on                   ! User turned on automatic time stepping
nsub,1000,1000,100,OFF
time,0.1
timint,on                  ! Turn on time integration effects
outres,erase
outres,all,none
outres,nsol,all,
outres,rsol,all
outres,eangl,all
outres,etmp,all
outres,veng,all
outres,strs,all,
outres,epel,all,
outres,eppl,all,
outres,cont,all,
outres,v,all,
outres,a,all,
solve
fdel,2,fx
autots,on                   ! User turned on automatic time stepping
nsub,1000,1000,100,OFF
time,1.1
timint,on                  ! Turn on time integration effects
outres,erase
outres,all,none
outres,nsol,all,
outres,rsol,all
outres,eangl,all
outres,etmp,all
outres,veng,all
outres,strs,all,
outres,epel,all,
outres,eppl,all,
outres,cont,all,
outres,v,all,
outres,a,all,
solve
autots,on                   ! User turned on automatic time stepping
nsub,1000,1000,100,OFF
time,2.1
timint,on                  ! Turn on time integration effects
outres,erase
outres,all,none
outres,nsol,all,
outres,rsol,all
outres,eangl,all
outres,etmp,all
outres,veng,all
outres,strs,all,
outres,epel,all,
outres,eppl,all,
outres,cont,all,
outres,v,all,
outres,a,all,
solve

----------------

Regards,

Ashish Khemka

• 154010010
Subscriber

Dear Ashish,

Thanks for your response. I want to apply a force that is a  function of the instantaneous mass displacement, but, I couldn't find such a force defined in your code. I have copied my code below.

To put it in equations, I have m*x\ddot + k*x = f(x,t)  not  m*x\ddot + k*x = f(t).

I understand that applying a state dependent force requires to be able tap into output at every step and extract displacement/velocity at every instant and redefine the force on nodes depending on these vales. I thought my code should do the same, but, as mentioned in my previous posts results are not as expected. Please help me understand the issue.

/title,Spring Mass Controller force

FINISH
/Clear

/PREP7
ET,1,MASS21
!*
ET,2,COMBIN14
!*
R,1,0.001, , , , ,
R,2,1,0,0, , ,50,

!Defining Material properties (Not needed for this problem though)
MPTEMP,1,0
MPDATA,EX,1,,210000
MPDATA,DENS,1,,7800E-12
MPDATA,PRXY,1,,0.3

!Defining two nodes
n,1,,,
n,2,50,,

! MODEL Definition
!Defining element attributes before creating elements
TYPE, 1
MAT,  1
REAL, 1
ESYS, 0

!Creating mass element at node 2
E,2,    !Element 1 definition

!Defining element attributes before creating elements
TYPE,2
MAT,1
REAL,2
ESYS,0

!Creating spring between node1 and node2
E,1,2,

!Defining boundary condition (Fix node1)
D,1,all,all

! Setup analysis
/solu
antype,transient
trnopt,full

time,0.001
solve

*DO,t,0.01,3,0.01    !Begining of DO loop
TIME,t                    !Time at the end of load step
*IF,t,LT,0.1,THEN,    !Begining of IF condition
F,2,FX,0
*ELSEIF,t,EQ,0.1,THEN
F,2,FX,2    ! A 2N force applied at 0.1s
*ELSEIF,t,GT,0.1,AND,t,LT,1
F,2,FX,0    ! Zero external force
*ELSE
*GET,error,NODE,2,U,X    ! Obtain the deformation of node2
F,2,FX,error*0.5    ! Applying the force
*ENDIF    !End of IF Condition
SOLVE
*ENDDO    !END of DO loop

!Post processing
/post26
nsol,3,2,u,x,
plvar,3

Regards,

Kumara