Question about using PyMPC
-
youngkyu
- Posts: 52
- Joined: Tue May 04, 2021 3:36 pm
- Location: 2559, Gyeongsang-daero, Sangju-si, Gyeongsangbuk-do, Korea
Question about using PyMPC
Dear support team members,
I found an issue with changing the value by using PyMPC.
If you run the python script within the attached .scd file, the value is not changed as described below.
If you look at the command in the line # 103 of the python script,
"doc.getAnalysisStep(13).XObject.getAttribute('duration').real = float(N[k]*0.01)", this does not change the value that I assigned as (N[k]*0.01)
It's weird because the same command for 'numIncr' worked changing the value in the line # 102 as you can see.
I guess that this might be a bug or error in this version of SKTO?
I hope that this issue will be resolved soon.
Best,
Youngkyu
I found an issue with changing the value by using PyMPC.
If you run the python script within the attached .scd file, the value is not changed as described below.
If you look at the command in the line # 103 of the python script,
"doc.getAnalysisStep(13).XObject.getAttribute('duration').real = float(N[k]*0.01)", this does not change the value that I assigned as (N[k]*0.01)
It's weird because the same command for 'numIncr' worked changing the value in the line # 102 as you can see.
I guess that this might be a bug or error in this version of SKTO?
I hope that this issue will be resolved soon.
Best,
Youngkyu
- Attachments
-
- PyMPC_Youngkyu.zip
- (162.51 KiB) Downloaded 311 times
-
marafini.f
- Posts: 363
- Joined: Fri Nov 13, 2020 1:52 pm
Re: Question about using PyMPC
Dear youngkyu,
no bug there, just some notation that it's hard to find.
For a transient analysis the attribute duration is called "duration/transient":
So you need to substitute this in line 103 in your code:
If you encounter some other problem you can go in this folder on your computer
C:\Program Files\STKO\external_solvers\opensees
and explore how each X-Object is created.
Here is an example of the information you were looking for, which was found in the AnalysesCommand.py file:
Let us know if you need anything else.
Francesca
no bug there, just some notation that it's hard to find.
For a transient analysis the attribute duration is called "duration/transient":
So you need to substitute this in line 103 in your code:
Code: Select all
doc.getAnalysisStep(13).XObject.getAttribute('duration/transient').real = float(N[k]*0.01)C:\Program Files\STKO\external_solvers\opensees
and explore how each X-Object is created.
Here is an example of the information you were looking for, which was found in the AnalysesCommand.py file:
Let us know if you need anything else.
Francesca
-
youngkyu
- Posts: 52
- Joined: Tue May 04, 2021 3:36 pm
- Location: 2559, Gyeongsang-daero, Sangju-si, Gyeongsangbuk-do, Korea
Re: Question about using PyMPC
Thanks for the quick response. That worked well and I will keep in mind your example for my future application.
Best,
Youngkyu
Best,
Youngkyu
-
marafini.f
- Posts: 363
- Joined: Fri Nov 13, 2020 1:52 pm
Re: Question about using PyMPC
You are welcome!
-
youngkyu
- Posts: 52
- Joined: Tue May 04, 2021 3:36 pm
- Location: 2559, Gyeongsang-daero, Sangju-si, Gyeongsangbuk-do, Korea
Re: Question about using PyMPC
Dear support team member,
Although I viewed PressureDependMultiYield.py script,
it is not straightforward to find the correct expression.
I tried to change the parameters of the models that are
rho, refShearModul, refBulkModul, frictionAng, refPress, PTAng, contrac, dilat1, dilat2, and e through PyPMC as above.
However, I could not change rho, refShearModul, refBulkModul, and refPress.
Could you help find what I missed from the script to access to the object ?
Best,
Youngkyu
Although I viewed PressureDependMultiYield.py script,
it is not straightforward to find the correct expression.
I tried to change the parameters of the models that are
rho, refShearModul, refBulkModul, frictionAng, refPress, PTAng, contrac, dilat1, dilat2, and e through PyPMC as above.
However, I could not change rho, refShearModul, refBulkModul, and refPress.
Could you help find what I missed from the script to access to the object ?
Best,
Youngkyu
- Attachments
-
- Change_PDMY_Params.zip
- (148.79 KiB) Downloaded 308 times
-
marafini.f
- Posts: 363
- Joined: Fri Nov 13, 2020 1:52 pm
Re: Question about using PyMPC
Those parameters are all QuantityScalar, not reals.
when trying to change them you should call them as for the following example:
SoilP.XObject.getAttribute('refBulkModul').QuantityScalar.value = 10.0
Let me know if you need any more help.
Francesca
when trying to change them you should call them as for the following example:
SoilP.XObject.getAttribute('refBulkModul').QuantityScalar.value = 10.0
Let me know if you need any more help.
Francesca
-
youngkyu
- Posts: 52
- Joined: Tue May 04, 2021 3:36 pm
- Location: 2559, Gyeongsang-daero, Sangju-si, Gyeongsangbuk-do, Korea
Re: Question about using PyMPC
Thanks for your quick response.
Actually, the lower case "quantityScalar.value" worked for the job.
Best,
Youngkyu
Actually, the lower case "quantityScalar.value" worked for the job.
Best,
Youngkyu
-
marafini.f
- Posts: 363
- Joined: Fri Nov 13, 2020 1:52 pm
Re: Question about using PyMPC
Great! Sorry for the typo, but I am happy you managed!
Enjoy your modelling.
Francesca
Enjoy your modelling.
Francesca