Amit: You can do it through a user-defined subroutine such as UITFIN using utility routines like GETSTACKDISP and FORPUT. Below is the ANSYS input listing for a simple spring-mass system, as well as a UITFIN subroutine that demonstrates a PID control system. Regards, Dave ======================= ANSYS Input file listing =========================== /BATCH !Batch input /CONFIG,NRES,10000 !Maximum number of results sets /FILE,control !Define jobname /NOPR !Suppress prinout /COM, ========================================================== /COM, /COM, EXAMPLE OF A PID CONTROL SYSTEM IMPLEMENTED USING UITFIN /COM, /COM, May 2002 /COM, ANSYS 6.0 /COM, /COM, ========================================================== /COM, /COM, Dave Lindeman ddlindeman@mmm.com /COM, 3M SEMS Technology Center Tel: 651-733-6383 /COM, 3M Center 235-1F-36 FAX: 651-736-7615 /COM, St. Paul, MN 55144 /COM, /COM, ========================================================== /COM, ========================================================== /COM, Define constants /COM, ========================================================== PI = ACOS(-1) !Pi TRUE = 1 !Logical true FALS = 0 !Logical false /COM, ========================================================== /COM, Define independent parameters /COM, ========================================================== DISP = 4.0000 !Displacement (m) MASS = 900.0000 !Mass (kg) KSPR = 1.0000 !Spring stiffness (N/m) KPRP = 72.0000 !Proportional gain KDIF = 8.0000 !Differential gain KINT = 60.0000 !Integral gain TSTP = 0.2000 !Time step size (seconds) TTOT = 180.0000 !Total solution time (seconds) /COM, ========================================================== /COM, Define graphics settings /COM, ========================================================== /TITLE,EXAMPLE OF A PID CONTROL SYSTEM IMPLEMENTED USING UITFIN /WIND,1,-1.00, 1.00,-0.88, 1.00 /PNUM,MAT,1 /NUM,1 /COM, ========================================================== /COM, Define element types /COM, ========================================================== /PREP7 !Enter preprocessor ET,1,COMBIN14 !2D longitudinal spring KEYOPT,1,3,2 ET,2,MASS21 !2D mass without rotary inertia KEYOPT,2,3,4 /COM, ========================================================== /COM, Define real constant sets /COM, ========================================================== R,1,KSPR !Spring stiffness R,2,MASS !Mass of point element /COM, ========================================================== /COM, Define finite element model /COM, ========================================================== N,1, 0, 0 !Define nodes N,2, 0,10 TYPE,1 !Define spring REAL,1 E,1,2 TYPE,2 !Define point mass REAL,2 E,2 /COM, ========================================================== /COM, Define boundary conditions /COM, ========================================================== D,1,UX,0 !Constrain base of spring D,1,UY,0 D,2,UX,0 !Constrain lateral motion of mass NPID = 2 FINI !Exit preprocessor /COM, ========================================================== /COM, Define and execute analysis /COM, ========================================================== /SOLU !Enter solution routine ANTYPE,TRANS !Transient analysis TINTP,0 !Define time integration parameters TIME,TTOT !Define time DELTIM,TSTP !Define time step size KBC,1 !Step-change boundary conditions USRCAL,UITFIN !Activate user subroutine OUTRES,ALL,NONE !Define output frequencies OUTRES,NSOL,ALL SOLVE !Perform solution FINI !Exit solution routine /COM, ========================================================== /COM, Perform postprocessing /COM, ========================================================== /POST26 !Enter time history postprocessor NSOL,2,2,U,Y !Store nodal displacement /SHOW,control,grph !Open neutral graphics file /AXLAB,X,TIME !Define plot options /AXLAB,Y,DISPLACEMENT /GRID,1 PLVAR,2 !Plot time history /PAGE,9999,,9999 /OUTPUT,control,hist !Output time history PRVAR,2 /OUTPUT FINI !Exit time history postprocessor /COM, ========================================================== /COM, Exit ANSYS /COM, ========================================================== /DELE,control,emat !Delete scratch files /DELE,control,esav /DELE,control,full PARSAV,ALL !Save parameters /EXIT !Save database ======================= End of ANSYS Input file listing =========================== ======================= UITFIN listing =========================== C C =========================================================================== C C EXAMPLE OF A PID CONTROL SYSTEM IMPLEMENTED USING UITFIN C C May 2002 C ANSYS 6.0 C C =========================================================================== C C Dave Lindeman ddlindeman@mmm.com C 3M SEMS Technology Center Tel: 651-733-6383 C 3M Center 235-1F-36 FAX: 651-736-7615 C St. Paul, MN 55144 C C =========================================================================== SUBROUTINE UITFIN INCLUDE '/ansys60/customize/include/dofcom.inc' INCLUDE '/ansys60/customize/include/impcom.inc' INCLUDE '/ansys60/customize/include/stack.inc' INCLUDE '/ansys60/customize/include/stepcm.inc' EXTERNAL FORPUT,GETSTACKDISP,PAREVL INTEGER GETSTACKDISP DOUBLE PRECISION PAREVL INTEGER KERR,NPID DOUBLE PRECISION DISP,E0,E1,E2,F0,FORCE(2) DOUBLE PRECISION KDIF,KINT,KPRP DOUBLE PRECISION SUBC(3),TSTP,UY CHARACTER*8 LABEL8 DATA E0,E1,E2,F0 /4*0.0D+00/ C =========================================================================== C Evaluate ANSYS parameter values C =========================================================================== LABEL8 = 'DISP' DISP = PAREVL(LABEL8,0,SUBC(1),2,KERR) LABEL8 = 'KDIF' KDIF = PAREVL(LABEL8,0,SUBC(1),2,KERR) LABEL8 = 'KINT' KINT = PAREVL(LABEL8,0,SUBC(1),2,KERR) LABEL8 = 'KPRP' KPRP = PAREVL(LABEL8,0,SUBC(1),2,KERR) LABEL8 = 'NPID' NPID = PAREVL(LABEL8,0,SUBC(1),2,KERR) LABEL8 = 'TSTP' TSTP = PAREVL(LABEL8,0,SUBC(1),2,KERR) C =========================================================================== C Obtain displacement of mass C =========================================================================== UY = GETSTACKDISP(NPID,'UY ',UY) C =========================================================================== C Calculate current and previous errors C =========================================================================== E2 = E1 E1 = E0 E0 = DISP-UY C =========================================================================== C Update nodal force C =========================================================================== FORCE(1) = F0 + KPRP*(((1.0D+00+(KDIF/TSTP)+(TSTP/KINT))*E0) + -((1.0D+00+2.0D+00*(KDIF/TSTP))*E1)+((KDIF/TSTP)*E2)) FORCE(2) = 0.0D+00 CALL FORPUT(NPID,2,FORCE(1)) F0 = FORCE(1) RETURN END C =========================================================================== C End of UITFIN C =========================================================================== ======================= End of UITFIN listing =========================== ===================================================================== Dave Lindeman 3M Center 235-1F-36 Tel: 651-733-6383 Senior CAE Specialist St. Paul, MN 55144 Fax: 651-736-7615 ===================================================================== > I am working on a transient analysis and here is my problem. I > have to apply forces on a component which is a function of displacement of > the part. Here is the way I do analysis.. > 1) I start analysis with some initial known force... > 2)Go to /Post1, calculate displacement.. > 3)Use the displacement to calculate new force, apply and solve. > 4)Repeat 2 and 3 till displacement reaches certain value.. > My interest is in time to reach that specific displacemnt. > Can anybody help, how I can apply forces, without going to /Post1 > everytime, to get displacement. Is there a better way to deal with this > problem?? > Anyhelp regarding this is greatly appreciated. Thanks in advance. > > Amit Kumar