Change the material of th disque and the shaft

33 ビュー (過去 30 日間)
Amira
Amira 2025 年 1 月 24 日 23:14
回答済み: Divyajyoti Nayak 2025 年 1 月 28 日 9:37
Hi every one ;
I'm just wanna ask you please, about including in a matlab code the change of matérials of the shaft and the disc, the bearing characteristics!!
even the unbalance.
nd thanks in advance !!

回答 (1 件)

Divyajyoti Nayak
Divyajyoti Nayak 2025 年 1 月 28 日 9:37
Hi @Amira,
I assume you want to know how to programmatically change material properties of certain Simscape blocks. The ‘get_param’ and ‘set_param’ functions can be used to access and modify the parameters of Simulink and Simscape blocks. Here’s some documentation for these functions:
  1. ‘get_param’: https://www.mathworks.com/help/simulink/slref/get_param.html
  2. ‘set_param’: https://www.mathworks.com/help/simulink/slref/set_param.html
For example, to change the material parameters of the ‘Flexible Shaft’ block, we’ll first need to choose the parameter to change from the list obtained using the following ‘get_param’ command:
get_param('Model/Flexible Shaft', 'DialogParameters');
‘Flexible Shaft parameters documentation:
Then the ‘set_param’ command can be used to change the value of the parameter (for example ‘density’). Note that, in the documentation it is mentioned that a prerequisite to change the ‘Material Density’ parameter is to change the ’Parameterization’ parameter to ‘By material and geometry’ or ‘By material and segment geometry’.
set_param('Model/Flexible Shaft', 'density','5');
Similarly, other material parameters can be changed for different Simscape blocks.

カテゴリ

Help Center および File ExchangeGears についてさらに検索

製品


リリース

R2011a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by