Tagged: Controller, spring-mass
-
-
May 29, 2022 at 11:08 am
KUMARA
SubscriberAs 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.
-
May 31, 2022 at 11:04 am
Aniket
Ansys EmployeeAnsys 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
-
May 31, 2022 at 11:20 am
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
-
August 16, 2022 at 9:57 am
Ashish Khemka
Ansys EmployeeHi 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
*DIM,_loadvari32x,TABLE,4,1,1,TIME
! Time values
*TAXIS,_loadvari32x(1),1,0.,8.e-002,0.1,2.1
! Load values
_loadvari32x(1,1,1) = 0.
_loadvari32x(2,1,1) = 0.
_loadvari32x(3,1,1) = 0.
_loadvari32x(4,1,1) = 0.
*DIM,_loadvari32y,TABLE,5,1,1,TIME
! Time values
*TAXIS,_loadvari32y(1),1,0.,8.e-002,0.1,1.1,2.1
! Load values
_loadvari32y(1,1,1) = 0.
_loadvari32y(2,1,1) = 0.
_loadvari32y(3,1,1) = 100.
_loadvari32y(4,1,1) = 150.
_loadvari32y(5,1,1) = 200.
f,2,fx,%_loadvari32y%
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
f,2,fx,%_loadvari32y%
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
-
August 18, 2022 at 7:29 am
154010010
SubscriberDear 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,fulltime,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,3Regards,
Kumara
-
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Saving & sharing of Working project files in .wbpz format
- Solver Pivot Warning in Beam Element Model
- Understanding Force Convergence Solution Output
- An Unknown error occurred during solution. Check the Solver Output…..
- What is the difference between bonded contact region and fixed joint
- whether have the difference between using contact and target bodies
- The solver engine was unable to converge on a solution for the nonlinear problem as constrained.
- Colors and Mesh Display
- User manual
- material damping and modal analysis
-
3670
-
2552
-
1751
-
1232
-
584
© 2023 Copyright ANSYS, Inc. All rights reserved.