Optimization Study using Template
Hi!
I'm trying to use the Optimization Wizard to tune my model with some real test data.
I'm using sensors and a template, its a sequential simulation.
For some reason it doesn't run when the template is active:
Is there any way some make this work?
Thank you!
Answers
-
Hello Guilherme
The optimization through the Optimization Wizard works through a Python format of MotionSolve. If the set of simulation commands are python, that should work.
In order to maintain both xml and python commands you may use a {if} block in the template
E.g.
{ if (Solver_Filename.ext == ".xml") }
<Deactivate
element_type = "MOTION"
element_id = "{mot_spin.l.idstring}"
/>
<Deactivate
element_type = "MOTION"
element_id = "{mot_spin.r.idstring}"
/>
<Simulate
analysis_type = "Static"
end_time = "10"
print_interval = "0.1"
/>
{elseif (Solver_Filename.ext == ".py")}
model.an_kc_frnt_mtn_w_spin_l.active = False
model.an_kc_frnt_mtn_w_spin_r.active = False
model.simulate(type="STATICS", end=10, dtout=0.1, returnResults=True)
{endif}Hope this helps
regards
Praful
0 -
Praful Prabhu_20784 said:
Hello Guilherme
The optimization through the Optimization Wizard works through a Python format of MotionSolve. If the set of simulation commands are python, that should work.
In order to maintain both xml and python commands you may use a {if} block in the template
E.g.
{ if (Solver_Filename.ext == ".xml") }
<Deactivate
element_type = "MOTION"
element_id = "{mot_spin.l.idstring}"
/>
<Deactivate
element_type = "MOTION"
element_id = "{mot_spin.r.idstring}"
/>
<Simulate
analysis_type = "Static"
end_time = "10"
print_interval = "0.1"
/>
{elseif (Solver_Filename.ext == ".py")}
model.an_kc_frnt_mtn_w_spin_l.active = False
model.an_kc_frnt_mtn_w_spin_r.active = False
model.simulate(type="STATICS", end=10, dtout=0.1, returnResults=True)
{endif}Hope this helps
regards
Praful
Hello Praful, thank you for the tip!
0