- Create 'primary_ind', 'secondary_ind', and 'coupling' variables which are being referenced by the Simscape blocks in either the base or model workspace. The default values can be specified for these variables in one of these workspaces, which would be overridden by the linearization workflow.
- Due to the known issue (https://www.mathworks.com/support/bugreports/details/2001393), please use:
slLinearizer & parameter variation in Simscape
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello,
I want to do a batch linearisation using slLinearizer on a Simulink model that contain Simscape components.
The linearisation is actualy working, but with for loops and iterations over vectors. That's slow.
The changing parameters coupling & primary_ind are inside of a simscape block :
I can create the batch linearisation interface :
io = getlinio(projectName);
sllin = slLinearizer(projectName,io);
I can create and specify the parameters :
coupling_mat = linspace(a,b,c);
primary_ind_mat = logspace(a,b,c);
[I,C] = ndgrid(primary_ind_mat,coupling_mat);
params(1).Name = 'primary_ind'; % i want here to link the simscape block upside
params(1).Value = I;
params(2).Name = 'coupling'; % same here
params(2).Value = C;
But when i try to update the parameters :
sllin.Parameters = params;
I get this error :
Error using slLinearizer/set.Parameters (line 324)
The expression "input(1).Name", "primary_ind" does
not successfully evaluate in model or base
workspace.
Caused by:
Error using sdo.getValueFromModel (line 94)
The variable 'primary_ind' cannot be resolved by
the model 'teslar2019a'. Make sure that the
variable is defined in the model, base
workspace, or data dictionary.
But as you can see on the first pic, there is a parameter called "primary_ind" in the model, inside a simscape block.
I've read :
- https://fr.mathworks.com/help/slcontrol/ug/sllinearizer.html
- https://fr.mathworks.com/help/slcontrol/batch-linearization.html
- https://fr.mathworks.com/help/slcontrol/ug/ways-to-generate-parameter-samples.html
I don't get how to link the parameters to the simulink model.
Thank you !
댓글 수: 0
답변 (1개)
Danvir Sethi
2019년 8월 5일
Where are the variables 'primary_ind', 'secondary_ind', and 'coupling' which are being referenced by the Simscape blocks defined? Are they defined in a mask workspace, model workspace, base workspace or none of these? Are you able to simulate the model as is?
I think you need a couple of things:
opt = linearizeOptions;
opt.AreParamsTunable = false;
sllin = slLinearizer(projectName,io, options);
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Batch Linearization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!