/
spectrum_options.py
1677 lines (1288 loc) · 61.3 KB
/
spectrum_options.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright (C) 2024 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
class SpectrumOptions:
def addam(self, af="", aa="", ab="", ac="", ad="", amin="", **kwargs):
"""Specifies the acceleration spectrum computation constants for the
APDL Command: ADDAM
analysis of shock resistance of shipboard structures.
Parameters
----------
af
Direction-dependent acceleration coefficient for elastic or
elastic-plastic analysis option (default = 0).
aa, ab, ac, ad
Coefficients for the DDAM acceleration spectrum equations. Default
for these coefficients is zero.
amin
The minimum acceleration value in inch/sec2. It defaults to 2316
inch/sec2 which equals 6g, where g is acceleration due to gravity
(g = 386 inch/sec2).
Notes
-----
This command specifies acceleration coefficients to analyze shock
resistance of shipboard equipment. These coefficients are used to
compute mode coefficients according to the equations given in Dynamic
Design Analysis Method in the Mechanical APDL Theory Reference. The
form of these equations is based on the Naval NRL Dynamic Design
Analysis Method. This command, along with the VDDAM and SED commands,
is used with the spectrum (ANTYPE,SPECTR) analysis as a special purpose
alternative to the SV, FREQ, and SVTYP commands. The mass and length
units of the model must be in pounds and inches, respectively.
DDASPEC may alternatively be used to calculate spectrum coefficients.
This command is also valid in PREP7.
"""
command = f"ADDAM,{af},{aa},{ab},{ac},{ad},{amin}"
return self.run(command, **kwargs)
def coval(
self,
tblno1="",
tblno2="",
sv1="",
sv2="",
sv3="",
sv4="",
sv5="",
sv6="",
sv7="",
**kwargs,
):
"""Defines PSD cospectral values.
APDL Command: COVAL
Parameters
----------
tblno1
First input PSD table number associated with this spectrum.
tblno2
Second input PSD table number associated with this spectrum.
sv1, sv2, sv3, . . . , sv7
PSD cospectral values corresponding to the frequency points
[PSDFRQ].
Notes
-----
Defines PSD cospectral values to be associated with the previously
defined frequency points. Two table references are required since
values are off-diagonal terms. Unlike autospectra [PSDVAL], the
cospectra can be positive or negative. The cospectral curve segment
where there is a sign change is interpolated linearly (the rest of the
curve segments use log-log interpolation). For better accuracy, choose
as small a curve segment as possible wherever a sign change occurs.
Repeat COVAL command using the same table numbers for additional
points. This command is valid for SPOPT,PSD only.
This command is also valid in PREP7.
"""
command = f"COVAL,{tblno1},{tblno2},{sv1},{sv2},{sv3},{sv4},{sv5},{sv6},{sv7}"
return self.run(command, **kwargs)
def cqc(self, signif="", label="", forcetype="", **kwargs):
"""Specifies the complete quadratic mode combination method.
APDL Command: CQC
Parameters
----------
signif
Combine only those modes whose significance level exceeds the
SIGNIF threshold. For single point, multipoint, or DDAM response
(SPOPT,SPRS, MPRS or DDAM), the significance level of a mode is
defined as the mode coefficient of the mode, divided by the maximum
mode coefficient of all modes. Any mode whose significance level
is less than SIGNIF is considered insignificant and is not
contributed to the mode combinations. The higher the SIGNIF
threshold, the fewer the number of modes combined. SIGNIF defaults
to 0.001. If SIGNIF is specified as 0.0, it is taken as 0.0.
(This mode combination method is not valid for SPOPT,PSD.)
label
Label identifying the combined mode solution output.
DISP - Displacement solution (default). Displacements, stresses, forces, etc., are
available.
VELO - Velocity solution. Velocities, "stress velocities," "force velocities," etc.,
are available.
ACEL - Acceleration solution. Accelerations, "stress accelerations," "force
accelerations," etc., are available.
forcetype
Label identifying the forces to be combined:
STATIC - Combine the modal static forces (default).
TOTAL - Combine the modal static plus inertial forces.
Notes
-----
Damping is required for this mode combination method. The CQC command
is also valid for PREP7.
"""
command = f"CQC,{signif},{label},{forcetype}"
return self.run(command, **kwargs)
def ddaspec(self, keyref="", shptyp="", mountloc="", deftyp="", amin="", **kwargs):
"""APDL Command: DDASPEC
Specifies the shock spectrum computation constants for DDAM analysis.
Parameters
----------
keyref
Key for reference catalog:
1 - The spectrum computation constants are based on NRL-1396 (default). For more
information, see Dynamic Design Analysis Method in the
Mechanical APDL Theory Reference
shptyp
Select the ship type:
SUBM - Submarine
SURF - Surface ship
mountloc
Select the mounting location:
HULL - Hull mounting location. These structures are mounted directly to basic hull
structures like frames, structural bulkheads below the water
line, and shell plating above the water line.
DECK - Deck mounting location. These structures are mounted directly to decks, non-
structural bulkheads, or to structural bulkheads above the
water line.
SHEL - Shell plating mounting location. These structures are mounted directly to shell
plating below the water line without intervening
foundations.
deftyp
Select the deformation type:
ELAS - Elastic deformation (default)
PLAS - Elastic-plastic deformation
amin
Minimum acceleration value in inch/sec2. It defaults to 2316
inch/sec2 which equals 6g, where g is the acceleration due to
gravity (g = 386 in/sec2).
Notes
-----
The excitation direction is required to calculate the spectrum
coefficients. Issue the SED command before issuing DDASPEC.
ADDAM and VDDAM may alternatively be used to calculate spectrum
coefficients.
This command is also valid in PREP7.
"""
command = f"DDASPEC,{keyref},{shptyp},{mountloc},{deftyp},{amin}"
return self.run(command, **kwargs)
def dsum(self, signif="", label="", td="", forcetype="", **kwargs):
"""Specifies the double sum mode combination method.
APDL Command: DSUM
Parameters
----------
signif
Combine only those modes whose significance level exceeds the
SIGNIF threshold. For single point, multipoint, or DDAM response
(SPOPT, SPRS, MPRS, or DDAM), the significance level of a mode is
defined as the mode coefficient of the mode, divided by the maximum
mode coefficient of all modes. Any mode whose significance level
is less than SIGNIF is considered insignificant and is not
contributed to the mode combinations. The higher the SIGNIF
threshold, the fewer the number of modes combined. SIGNIF defaults
to 0.001. If SIGNIF is specified as 0.0, it is taken as 0.0.
(This mode combination method is not valid for SPOPT, PSD.)
label
Label identifying the combined mode solution output.
DISP - Displacement solution (default). Displacements, stresses, forces, etc., are
available.
VELO - Velocity solution. Velocities, "stress velocities," "force velocities," etc.,
are available.
ACEL - Acceleration solution. Accelerations, "stress accelerations," "force
accelerations," etc., are available.
td
Time duration for earthquake or shock spectrum. TD defaults to 10.
forcetype
Label identifying the forces to be combined:
STATIC - Combine the modal static forces (default).
TOTAL - Combine the modal static plus inertial forces.
Notes
-----
This command is also valid for PREP7.
"""
command = f"DSUM,{signif},{label},{td},{forcetype}"
return self.run(command, **kwargs)
def freq(
self,
freq1="",
freq2="",
freq3="",
freq4="",
freq5="",
freq6="",
freq7="",
freq8="",
freq9="",
**kwargs,
):
"""Defines the frequency points for the SV vs. FREQ tables.
APDL Command: FREQ
Parameters
----------
freq1, freq2, freq3, . . . , freq9
Frequency points for SV vs. FREQ tables. Values must be in
ascending order. FREQ1 should be greater than zero. Units are
cycles/time.
Notes
-----
Repeat the FREQ command for additional frequency points (100 maximum).
Values are added after the last nonzero frequency. If all fields
(FREQ1 -- FREQ9) are blank, erase SV vs. FREQ tables.
Frequencies must be in ascending order.
Spectral values are input with the SV command and interpreted according
to the SVTYP command. Applies only to the SPRS (single-point) option
of the SPOPT command. See the SPFREQ command for frequency input in
MPRS (multi-point) analysis.
Use the STAT command to list current frequency points.
This command is also valid in PREP7.
"""
command = f"FREQ,{freq1},{freq2},{freq3},{freq4},{freq5},{freq6},{freq7},{freq8},{freq9}"
return self.run(command, **kwargs)
def grp(self, signif="", label="", forcetype="", **kwargs):
"""Specifies the grouping mode combination method.
APDL Command: GRP
Parameters
----------
signif
Combine only those modes whose significance level exceeds the
SIGNIF threshold. For single point, multipoint, or DDAM response
(SPOPT,SPRS, MPRS or DDAM), the significance level of a mode is
defined as the mode coefficient of the mode, divided by the maximum
mode coefficient of all modes. Any mode whose significance level
is less than SIGNIF is considered insignificant and is not
contributed to the mode combinations. The higher the SIGNIF
threshold, the fewer the number of modes combined. SIGNIF defaults
to 0.001. If SIGNIF is specified as 0.0, it is taken as 0.0.
(This mode combination method is not valid for SPOPT,PSD.)
label
Label identifying the combined mode solution output.
DISP - Displacement solution (default). Displacements, stresses, forces, etc., are
available.
VELO - Velocity solution. Velocities, "stress velocities," "force velocities," etc.,
are available.
ACEL - Acceleration solution. Accelerations, "stress accelerations," "force
accelerations," etc., are available.
forcetype
Label identifying the forces to be combined:
STATIC - Combine the modal static forces (default).
TOTAL - Combine the modal static plus inertial forces.
Notes
-----
The SIGNIF value set with this command (including the default value of
0.001) overrides the SIGNIF value set with the MXPAND command.
This command is also valid for PREP7.
"""
command = f"GRP,{signif},{label},{forcetype}"
return self.run(command, **kwargs)
def mmass(self, option="", zpa="", **kwargs):
"""Specifies the missing mass response calculation.
APDL Command: MMASS
Parameters
----------
option
Flag to activate or deactivate missing mass response calculation.
0 (OFF or NO) - Deactivate (default).
1 (ON or YES) - Activate.
zpa
Zero Period Acceleration Value. If a scale factor FACT is defined
on the SVTYP command, it is applied to this value.
Notes
-----
The missing mass calculation is valid only for single point excitation
response spectrum analysis (SPOPT, SPRS) and for multiple point
response spectrum analysis (SPOPT, MPRS) performed with base excitation
using acceleration response spectrum loading. Missing mass is supported
in a spectrum analysis only when the preceding modal analysis is
performed with the Block Lanczos, PCG Lanczos, Supernode, or Subspace
eigensolver (Method =LANB, LANPCG, SNODE, or SUBSP on the MODOPT
command).
The velocity solution is not available (Label = VELO on the combination
command: SRSS, CQC...) when the missing mass calculation is activated.
The missing mass calculation is not supported when the spectrum
analysis is based on a linear perturbation modal analysis performed
after a nonlinear base analysis.
The missing mass is not supported when superelements are present.
To take into account the contribution of the truncated modes, the
residual vector (RESVEC) can be used in place of the missing mass
response. This is of particular interest if the velocity solution is
requested or if a nonlinear prestress is included in the analysis
(linear perturbation), or if a superelement is present, since the
missing mass cannot be used in these cases.
In a multiple point response spectrum analysis (SPOPT,MPRS), the MMASS
command must precede the participation factor calculation command
(PFACT).
This command is also valid in PREP7.
"""
command = f"MMASS,{option},{zpa}"
return self.run(command, **kwargs)
def nrlsum(self, signif="", label="", labelcsm="", forcetype="", **kwargs):
"""Specifies the Naval Research Laboratory (NRL) sum mode combination
APDL Command: NRLSUM
method.
Parameters
----------
signif
Combine only those modes whose significance level exceeds the
SIGNIF threshold. For single point, multipoint, or DDAM response
(SPOPT,SPRS, MPRS or DDAM), the significance level of a mode is
defined as the mode coefficient of the mode, divided by the maximum
mode coefficient of all modes. Any mode whose significance level is
less than SIGNIF is considered insignificant and is not contributed
to the mode combinations. The higher the SIGNIF threshold, the
fewer the number of modes combined. SIGNIF defaults to 0.001. If
SIGNIF is specified as 0.0, it is taken as 0.0. (This mode
combination method is not valid for SPOPT,PSD.)
label
Label identifying the combined mode solution output.
DISP - Displacement solution (default). Displacements, stresses, forces, etc., are
available.
VELO - Velocity solution. Velocities, "stress velocities," "force velocities," etc.,
are available.
ACEL - Acceleration solution. Accelerations, "stress accelerations," "force
accelerations," etc., are available.
labelcsm
Label identifying the CSM (Closely Spaced Modes) method.
CSM - Use the CSM method.
Blank - Do not use the CSM method (default).
forcetype
Label identifying the forces to be combined:
STATIC - Combine the modal static forces (default).
TOTAL - Combine the modal static plus inertial forces.
Notes
-----
This command is also valid in PREP7. This mode combination method is
usually used for SPOPT,DDAM.
This CSM method is only applicable in a DDAM analysis (SPOPT,DDAM). The
CSM method combines two closely spaced modes into one mode when their
frequencies are within 10 percent of the common mean frequency and
their responses are opposite in sign. The contribution of these closely
spaced modes is then included in the NRL sum as a single effective
mode. Refer to Closely Spaced Modes (CSM) Method in the Mechanical APDL
Theory Reference for more information.
NRLSUM is not allowed in ANSYS Professional.
"""
command = f"NRLSUM,{signif},{label},{labelcsm},{forcetype}"
return self.run(command, **kwargs)
def pfact(self, tblno="", excit="", parcor="", **kwargs):
"""Calculates participation factors for the PSD or multi-point response
APDL Command: PFACT
spectrum table.
Parameters
----------
tblno
Input PSD (Power Spectral Density) table number for which
participation factors are to be calculated.
excit
Label defining the location of excitation:
BASE - Base excitation (default).
NODE - Nodal excitation.
parcor
Label defining excitation type (applies only to SPOPT,PSD
analysis). Used only when partially correlated excitation is due
to wave propagation or spatial correlation. Defaults to partially
correlated excitation as defined by COVAL and QDVAL commands.
WAVE - Excitation defined by PSDWAV command.
SPAT - Excitation defined by PSDSPL command.
Notes
-----
Calculates the participation factors for a particular PSD or multi-
point response spectrum table defined with the PSDVAL or SPVAL command.
The Jobname.DB file must contain modal solution data in order for this
command to calculate the participation factor. There must be a PFACT
command for each excitation spectrum. You are limited to 300
excitations.
This command is also valid in PREP7.
"""
command = f"PFACT,{tblno},{excit},{parcor}"
return self.run(command, **kwargs)
def pivcheck(self, key="", prntcntrl="", **kwargs):
"""Controls the behavior of an analysis when a negative or zero equation solver pivot value is encountered.
APDL Command: PIVCHECK
Parameters
----------
key
Determines whether to stop or continue an analysis when a negative
or zero equation solver pivot value is encountered:
AUTO - Check for negative or zero pivot values for analyses
performed with the sparse and PCG solvers. When one is
encountered, an error or warning is issued, per various
criteria relating to the type of analysis being
solved. An error causes the analysis to stop; a warning
allows the analysis to continue. A negative pivot value
may be valid for some nonlinear and multiphysics
analyses (for example, electromagnetic and thermal
analyses); this key has no effect in these cases.
ERROR - Check for negative or zero pivot values for analyses
performed with the sparse and PCG solvers. When one is
encountered, an error is issued, stopping the
analysis. A negative pivot value may be valid for some
nonlinear and multiphysics analyses (for example,
electromagnetic and thermal analyses); this key has no
effect in these cases.
WARN - Check for negative or zero pivot values for analyses
performed with the sparse and PCG solvers. When one is
encountered, a warning is issued and the analysis
continues. A negative pivot value may be valid for some
nonlinear and multiphysics analyses (for example,
electromagnetic and thermal analyses); this key has no
effect in these cases.
OFF - Pivot values are not checked. This key causes the
analysis to continue in spite of a negative or zero
pivot value.
prntcntrl
Provides print options. Print output with these options will be
sent to the default output file, not to the files created by the
nonlinear diagnostic tools (NLDIAG).
ONCE - Print only the maximum and minimum pivot information on
the first call to the sparse solver (which is the
default solver). This is the default behavior.
EVERY - Print the maximum and minimum pivot information at
every call to the sparse solver. This option is
provided for nonlinear analysis diagnostics.
Notes
-----
This command is valid for all analyses. In a nonlinear analysis, a
negative pivot may be valid. In some cases, rigid body motions in
a nonlinear analysis will be trapped by error routines checking
infinitely large displacements (DOF limit exceeded) or
nonconvergence status. An under-constrained model may avoid the
pivot check, but fail with a DOF limit exceeded error.
Machine precision may affect whether a small pivot triggers an
error or bypasses this checking logic. You may wish to review the
ratio of the maximum to absolute minimum pivot values. For ratios
exceeding 12 to 14 orders of magnitude, the accuracy of the
computed solution may be degraded by the severe ill-conditioning
of the assembled matrix.
Note that negative pivots corresponding to Lagrange multiplier
based mixed u-P elements are not checked or reported by this
command. Negative pivots arising from the u-P element formulation
and related analyses can occur and lead to correct solutions.
This command is also valid in PREP7.
"""
command = f"PIVCHECK,{key},{prntcntrl}"
return self.run(command, **kwargs)
def psdcom(self, signif="", comode="", forcetype="", **kwargs):
"""Specifies the power spectral density mode combination method.
APDL Command: PSDCOM
Parameters
----------
signif
Combine only those modes whose significance level exceeds theSIGNIF
threshold. For PSD response (SPOPT,PSD), the significance level is
defined as the modal covariance matrix term, divided by the maximum
modal covariance matrix term. Any term whose significance level is
less than SIGNIF is considered insignificant and is not contributed
to the mode combinations. The higher the SIGNIF threshold, the
fewer the number of terms used. SIGNIF defaults to 0.0001. If
SIGNIF is specified as 0.0, it is taken as 0.0.
comode
First COMODE number of modes to be actually combined. COMODE must
always be less than or equal to NMODE (input quantity NMODE on the
SPOPT command). COMODE defaults to NMODE. COMODE performs a
second level of control for the first sequential COMODE number of
modes to be combined. It uses the significance level threshold
indicated by SIGNIF and operates only on the significant modes.
forcetype
Label identifying the forces to be combined:
STATIC - Combine the modal static forces (default).
TOTAL - Combine the modal static plus inertial forces.
Notes
-----
This command is also valid for PREP7. This command is valid only for
SPOPT,PSD.
PSDCOM is not allowed in ANSYS Professional.
"""
command = f"PSDCOM,{signif},{comode},{forcetype}"
return self.run(command, **kwargs)
def psdfrq(
self,
tblno1="",
tblno2="",
freq1="",
freq2="",
freq3="",
freq4="",
freq5="",
freq6="",
freq7="",
**kwargs,
):
"""Defines the frequency points for the input spectrum tables PSDVAL vs.
APDL Command: PSDFRQ
PSDFRQ for PSD analysis.
Parameters
----------
tblno1
Input table number. When used with the COVAL or the QDVAL command,
TBLNO1 represents the row number of this table. Up to 200 tables
may be defined.
tblno2
Input table number. TBLNO2 is used only for the COVAL or the QDVAL
commands and represents the column number of this table.
freq1, freq2, freq3, . . . , freq7
Frequency points (cycles/time) for spectrum vs. frequency tables.
FREQ1 should be greater than zero, and values must be in ascending
order. Log-log interpolation will be used between frequency
points.
Notes
-----
The spectrum values may be input with the PSDVAL, COVAL , or QDVAL
commands. A separate PSDFRQ command must be used for each table and
cross table defined. Frequencies must be in ascending order.
Repeat PSDFRQ command for additional frequency points. Values are
added after the last nonzero frequency. If all fields after PSDFRQ are
blank, all input vs. frequency tables are erased. If TBLNO1 is
nonblank, all corresponding PSDVAL tables are erased. If both TBLNO1
and TBLNO2 are nonblank, all corresponding COVAL and QDVAL tables are
erased.
This command is also valid in PREP7.
"""
command = f"PSDFRQ,{tblno1},{tblno2},{freq1},{freq2},{freq3},{freq4},{freq5},{freq6},{freq7}"
return self.run(command, **kwargs)
def psdgraph(self, tblno1="", tblno2="", displaykey="", **kwargs):
"""Displays input PSD curves
APDL Command: PSDGRAPH
Parameters
----------
tblno1
PSD table number to display.
tblno2
Second PSD table number to display. TBLNO2 is used only in
conjunction with the COVAL or the QDVAL commands.
displaykey
Key to display the points markers and numbering:
0 - Display points markers and numbering (default).
1 - Display points numbering only.
2 - Display points markers only.
3 - No points markers or numbering.
Notes
-----
The input PSD tables are displayed in log-log format as dotted lines.
The best-fit curves, used to perform the closed-form integration, are
displayed as solid lines. If there is a significant discrepancy between
the two, then you should add one or more intermediate points to the
table to obtain a better fit.
If TBLNO2 is zero, blank, or equal to TBLNO1, then the autospectra
(PSDVAL) are displayed for TBLNO1. If TBLNO2 is also specified, then
the autospectra for TBLNO1 and TBLNO2 are displayed, along with the
corresponding cospectra (COVAL) and quadspectra (QDVAL), if they are
defined.
This command is valid in any processor.
"""
command = f"PSDGRAPH,{tblno1},{tblno2},{displaykey}"
return self.run(command, **kwargs)
def psdres(self, lab="", relkey="", **kwargs):
"""Controls solution output written to the results file from a PSD
APDL Command: PSDRES
analysis.
Parameters
----------
lab
Label identifying the solution output:
DISP - Displacement solution (default). One-sigma displacements, stresses, forces,
etc. Written as load step 3 on File.RST.
VELO - Velocity solution. One-sigma velocities, "stress velocities," "force
velocities," etc. Written as load step 4 of File.RST.
ACEL - Acceleration solution. One-sigma accelerations, "stress accelerations," "force
accelerations," etc. Written as load step 5 on File.RST.
relkey
Key defining relative or absolute calculations:
REL - Calculations are relative to the base excitation (default).
ABS - Calculations are absolute.
OFF - No calculation of solution output identified by Lab.
Notes
-----
Controls the amount and form of solution output written to the results
file from a PSD analysis. One-sigma values of the relative or absolute
displacement solution, relative or absolute velocity solution, relative
or absolute acceleration solution, or any combination may be included
on the results file.
This command is also valid in PREP7.
Distributed ANSYS Restriction: This command is not supported in
Distributed ANSYS.
"""
command = f"PSDRES,{lab},{relkey}"
return self.run(command, **kwargs)
def psdspl(self, tblno="", rmin="", rmax="", **kwargs):
"""Defines a partially correlated excitation in a PSD analysis.
APDL Command: PSDSPL
Parameters
----------
tblno
Input PSD table number defined with PSDVAL command.
rmin
Minimum distance between excitation points which are partially
correlated. Excited nodes closer than RMIN will be fully
correlated.
rmax
Maximum distance between excitation points which are partially
correlated. Excited nodes farther apart than RMAX will be
uncorrelated.
Notes
-----
Defines a partially correlated excitation in terms of a sphere of
influence relating excitation point geometry (in a PSD analysis). If
the distance between any two excitation points is less than RMIN, then
the excitation is fully correlated. If the distance is greater than
RMAX, then the excitation is uncorrelated. If the distance lies
between RMIN and RMAX, then the excitation is partially correlated with
the degree of correlation dependent on the separation distance between
the points. This command is not available for a pressure PSD analysis.
This command is also valid in PREP7.
"""
command = f"PSDSPL,{tblno},{rmin},{rmax}"
return self.run(command, **kwargs)
def psdunit(self, tblno="", type_="", gvalue="", **kwargs):
"""Defines the type of input PSD.
APDL Command: PSDUNIT
Parameters
----------
tblno
Input table number.
type\\_
Label identifying the type of spectrum:
DISP - Displacement spectrum (in terms of displacement2/Hz ).
VELO - Velocity spectrum (in terms of velocity2/Hz ).
ACEL - Acceleration spectrum (in terms of acceleration2/Hz ).
ACCG - Acceleration spectrum (in terms of g2/Hz ).
FORC - Force spectrum (in terms of force2/Hz ).
PRES - Pressure spectrum (in terms of pressure2/Hz ).
gvalue
Value of acceleration due to gravity in any arbitrary units for
Type=ACCG. Default is 386.4 in/sec2.
Notes
-----
Defines the type of PSD defined by the PSDVAL, COVAL, and QDVAL
commands.
Force (FORC) and pressure (PRES) type spectra can be used only as a
nodal excitation.
GVALUE is valid only when type ACCG is specified. A zero or negative
value cannot be used. A parameter substitution can also be performed.
This command is also valid in PREP7.
"""
command = f"PSDUNIT,{tblno},{type_},{gvalue}"
return self.run(command, **kwargs)
def psdval(
self,
tblno="",
sv1="",
sv2="",
sv3="",
sv4="",
sv5="",
sv6="",
sv7="",
**kwargs,
):
"""Defines PSD values.
APDL Command: PSDVAL
Parameters
----------
tblno
Input table number being defined.
sv1, sv2, sv3, . . . , sv7
Spectral values corresponding to the frequency points [PSDFRQ].
Values are interpreted as defined with the PSDUNIT command.
Notes
-----
Defines PSD values to be associated with the previously defined
frequency points.
Repeat PSDVAL command for additional values, up to the number of
frequency points [PSDFRQ]. Values are added after the last nonzero
value.
This command is also valid in PREP7.
"""
command = f"PSDVAL,{tblno},{sv1},{sv2},{sv3},{sv4},{sv5},{sv6},{sv7}"
return self.run(command, **kwargs)
def psdwav(self, tblno="", vx="", vy="", vz="", **kwargs):
"""Defines a wave propagation excitation in a PSD analysis.
APDL Command: PSDWAV
Parameters
----------
tblno
Input PSD table number defined with PSDVAL command.
vx
Global Cartesian X-velocity of traveling wave.
vy
Global Cartesian Y-velocity of traveling wave.
vz
Global Cartesian Z-velocity of traveling wave.
Notes
-----
Defines a traveling wave in a PSD analysis. This command is not
available for a pressure PSD analysis.
This command is also valid in PREP7.
"""
command = f"PSDWAV,{tblno},{vx},{vy},{vz}"
return self.run(command, **kwargs)
def qdval(
self,
tblno1="",
tblno2="",
sv1="",
sv2="",
sv3="",
sv4="",
sv5="",
sv6="",
sv7="",
**kwargs,
):
"""Defines PSD quadspectral values.
APDL Command: QDVAL
Parameters
----------
tblno1
First input PSD table number associated with this spectrum.
tblno2
Second input PSD table number associated with this spectrum.
sv1, sv2, sv3, . . . , sv7
PSD quadspectral values corresponding to the frequency points
[PSDFRQ].
Notes
-----
Defines PSD quadspectral values to be associated with the previously
defined frequency points. Repeat QDVAL command with the same table
number for additional points. Unlike autospectra [PSDVAL], the
quadspectra can be positive or negative. The quadspectral curve
segment where there is a sign change is interpolated linearly (the rest
of the curve segments use log-log interpolation). For better accuracy,
choose as small a curve segment as possible wherever a sign change
occurs.
Two table numbers are required since values are off-diagonal terms.
This command is valid for SPOPT,PSD only.
This command is also valid in PREP7.
Distributed ANSYS Restriction: This command is not supported in
Distributed ANSYS.
"""
command = f"QDVAL,{tblno1},{tblno2},{sv1},{sv2},{sv3},{sv4},{sv5},{sv6},{sv7}"
return self.run(command, **kwargs)
def rock(self, cgx="", cgy="", cgz="", omx="", omy="", omz="", **kwargs):
"""Specifies a rocking response spectrum.
APDL Command: ROCK
Parameters
----------
cgx, cgy, cgz
Global Cartesian X, Y, and Z location of center of rotation about
which rocking occurs.
omx, omy, omz
Global Cartesian angular velocity components associated with the
rocking.
Notes
-----
Specifies a rocking response spectrum effect in the spectrum
(ANTYPE,SPECTR) analysis.