-
-
January 23, 2024 at 6:29 pm
Nouran Muhammad
SubscriberHi,
I am using Electric module in Ansys Workbench to simulate high density voltage spinal cord stimulation. The voltage signal parameters are: 5 V peak, 500 Hz frequency and 500 microseconds pulse width. I can't find a way to incorporate the pulse width information. I inserted a voltage object and choose function, but i only can write: 5000*cos(2*3.14*500*(10^6)*time). How to add the pulse width information to generate pulsed signal?
-
January 24, 2024 at 5:24 pm
wrbulat
Ansys EmployeeIs your objective to define a square or trapezoidal wave form rather than a sinusoid? If so, you could add a command object containing the following. Append to the end of it the command to assign the voltage to a face, i.e.,
d,V_face,volt,%V1%
where V_face is a component name assigned to the face to which the time varying trapezoidal voltage waveform is to be applied.
Also, put an empty command object under the Solution branch in the tree. A plot of the voltage waveform should appear under it after you solve.
C***************************************************C*** PARAMETERS DEFINING VOLTAGE TRAPEZIODAL WAVEC***************************************************V_ampltd=100 ! AMPLITUDE OF APPLIED VOLTAGEfrqncy=0.1 ! FREQUENCYP=1/frqncy ! CORRESPONDING PERIOD (DO NOT EDIT)t_rise=P/20 ! RISE TIMEt_dwell=P/4 ! DWELL TIMEt_fall=P/15 ! FALL TIMEnprds=5 ! # OF PERIODSt_final=nprds*P ! END OF TRANSIENT (DO NOT EDIT)C***************************************************C*** DEFINE TRAPEZIODAL WAVEC****************************************************dim,V1,table,4*nprds+1,,,time ! DIMENSION ARRAY TO HOLD TRAPEZOIDAL WAVE DATA*dim,keytimes,,4*nprds ! KEYTIME ARRAY FOR TSRES IF THIS IS A THERMAL TRANSIENT*do,i,1,nprds ! PLACE DATA IN ARRAYV1(4*(i-1)+1,1)=0V1(4*(i-1)+2,1)=V_ampltdV1(4*(i-1)+3,1)=V_ampltdV1(4*(i-1)+4,1)=0V1(4*(i-1)+5,1)=0*enddo*do,i,1,nprds ! PLACE CORRESPONDING TIME VALUES IN ARRAYV1(4*(i-1)+1,0)=(i-1)*PV1(4*(i-1)+2,0)=(i-1)*P+t_riseV1(4*(i-1)+3,0)=(i-1)*P+t_rise+t_dwellV1(4*(i-1)+4,0)=(i-1)*P+t_rise+t_dwell+t_fallV1(4*(i-1)+5,0)=(i)*P*enddo*vfun,keytimes(1),copy,V1(2,0) ! COPY V1 TIME VALUES TO keytimes ARRAY/axlab,x,Time (s) ! CREATE png IMAGE FILE OF TRAPEZOIDAL WAVE/axlab,y,ELECTRODE VOLTAGE/sho,png*vplot,V1(1,0),V1(1,1)/sho,close/solutsres,%keytimes% ! USE KEYTIMES ARRAY (APPLICABLE IF THERMAL TRANSIENT ANALYSIS)dt_min=min(t_rise,min(t_dwell,min(t_fall,P-t_rise-t_dwell-t_fall))) ! MINIMUM TIME BETWEEN POINTS IN V1 TABLE ARRAYdt_max=max(t_rise,max(t_dwell,max(t_fall,P-t_rise-t_dwell-t_fall))) ! MAXIMUM TIME BETWEEN POINTS IN V1 TABLE ARRAYautots,ondeltime,0.5*dt_min,0.5*dt_min,dt_max ! DELTIME (COMPATIBLE WITH TSRES KEYTIMES)outres,all,all/eof -
January 24, 2024 at 5:31 pm
wrbulat
Ansys EmployeeAlso, if your objective is to calculate transient thermal response to Joule heating, you might consider setting the model up in a transient coupled fields analysis system.
-
January 25, 2024 at 3:06 pm
-
- The topic ‘Simulate pulsed voltage signal in Electric module in Ansys Workbench’ is closed to new replies.
-
6450
-
1906
-
1457
-
1308
-
1022
© 2026 Copyright ANSYS, Inc. All rights reserved.

