Main Content

symReadSSCParameters

Load parameters fromSimscapecomponent

Description

example

[names,values,units] = symReadSSCParameters(componentName)returns cell arrays containing the names, values, and units of all parameters from the Simscape™ component calledcomponentName.

Examples

collapse all

Load the names, values, and units of the parameters of a Simscape component.

Suppose you have the Simscape componentfriction.sscin your current folder.

type('friction.ssc');
组件摩擦 brkwy_trq pm_error('simscape:lossthanource','coulomb摩擦扭矩')结束如果VISC_COEF <0 PM_ERROR('SIMSCAPE:MARERTHTHANOREQUALTOZERO','粘性摩擦系数')结束if trans_coef <= 0 pm_error('simscape:mextorthanzero','转换近似系数')结束如果vel_thr <= 0 pm_error('simscape:mexighthanzero','线性区域速度阈值')终值计算断裂扭矩brkwy_trq_th =VISC_COEF * VEL_THR + COL_TRQ +(BRKWY_TRQ  -  COL_TRQ)* ... exp(-trans_coef * vel_thr);结束方程(ABS(W)<= vel_thr)%线性区域t == brkwy_trq_th * w / vel_thr; elseif w > 0 t == visc_coef * w + Col_trq + ... (brkwy_trq - Col_trq) * exp(-trans_coef * w); else t == visc_coef * w - Col_trq - ... (brkwy_trq - Col_trq) * exp(-trans_coef * abs(w)); end end end

Load the names, values, and units of the parameters of the componentfriction.ssc.

[names,values,units] = symReadSSCParameters('friction.ssc');

In this example, all elements of the resulting cell arrays are scalars. You can convert the cell arrays to symbolic vectors.

names_sym = cell2sym(names)
names_sym = [col_trq,brkwy_trq,brkwy_trq_th,trans_coef,vel_thr,Visc_coef]
values_sym = cell2sym(values)
values_sym = [ 20, 25, 4999/200, 10, 1/10000, 1/1000]

Create individual symbolic variables from the elements of the cell arraynames在matlab.®workspace. This command creates the symbolic variablesCol_trq,brkwy_trq,brkwy_trq_th,Trans_Coef.,vel_thr, andvisc_coefassymobjects in the workspace.

信谊(名字)

Input Arguments

collapse all

Simscape component name, specified as a file name enclosed in single quotes. The file must have the extension.ssc. If you do not provide the file extension,symReadSSCParametersassumes it to be.ssc. The component must be on the MATLAB path or in the current folder.

Example:'MyComponent.ssc'

Output Arguments

collapse all

Names of all parameters of a Simscape component, returned as a cell array.

Data Types:cell

Values of all parameters of a Simscape component, returned as a cell array.

Data Types:cell

Units of all parameters of a Simscape component, returned as a cell array.

Data Types:cell

Introduced in R2016a