Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adams/Matlab: Setting Up and Modifying Design Variables in Matlab

Saleh abbasi

Mechanical
May 27, 2023
20
Hi everyone, I can create a control plant from my Adams model to run in Simulink. How can I change the design variables initially? I need to modify torsion springs, some lengths, etc., directly from Simulink. I want to optimize my model, so I need to adjust these variables.
 
Replies continue below

Recommended for you

Loosely speaking you need to define the various parameters as design variables in adams, and then pass values to them from your simulink.
 
thanks for your reply. Are you referring to creating Adams models with varying parameter values and link them to Simulink? For the optimization process, the parameters are determined dynamically by the relevant algorithm. As a result, it’s not feasible to pre-create Adams model and then send it to Simulink.
If it's not feasible anyway to do that, how about change this variables in Python instead?

Loosely speaking you need to define the various parameters as design variables in adams, and then pass values to them from your simulink.
 
Last edited:
It isn't sent to simulink it is a co sim with simulink. Is there not a tutorial on this?
 
i want to optimize 2 torsion spring of my model with my algorithm that wrote in matlab.
i create design variables, for set spring stiffness coefficient we cant create system elements.
k1 and k2 is stiffness coefficient that i want to optimize them.


2.PNG

i set control plant : freq is frequency of unbalance speed.
3.PNG

and this is result in simulink:
4.PNG
so, how can i change k1 and k2 from simulink???
i tried to create torque instead of spring and give angle of related joint to it with multiply k1 and k2, but i got error.
 
Last edited:
The signal from the MUX needs to include k1 and k2. Is there not a tutorial on this?
İ don't know what is MUX, i solved problem of use torque instead of torsion spring. Now it's ok, but if i want to change other design parameters, how can i do that?
 
I understand. I thought it was a tool in the adams. In creating a control plant, we can only use system elements variables type, while in defining spring, we cannot. Just design variables can set spring or other that related to model structure, like sphere radius, friction coefficients etc.
I asked chat GPT, first tried to change the model through Adams_init. Also the script definition in .acf format (adams command file) for initial command section when we create control plants at adams, but I didn't understand how it worked. The codes he wrote didn't make any changes to the model.
 
Last edited:

Part and Inventory Search

Sponsor