Skip to content

Commit 1fbc2a7

Browse files
committed
Initial commit v1p*8
1 parent 1ba95e2 commit 1fbc2a7

File tree

346 files changed

+113592
-72
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

346 files changed

+113592
-72
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
%% Script to plot results for all blocks of a certain type
2+
3+
% Model to be searched
4+
modelName = 'Excavator_Complete';
5+
6+
% Search parameters
7+
f = Simulink.FindOptions('FollowLinks',true,'LookUnderMasks','All',...
8+
'MatchFilter', @Simulink.match.activeVariants);
9+
10+
% List of reference blocks and variable names
11+
refBlks = {...
12+
'SimscapeFluids_lib/Isothermal Liquid/Valves & Orifices/Directional Control Valves/Check Valve (IL)','mdot_A';
13+
'SimscapeFluids_lib/Isothermal Liquid/Valves & Orifices/Pressure Control Valves/Pressure Relief Valve (IL)','mdot_A'};
14+
15+
% Load libraries where reference blocks live
16+
load_system('SimscapeFluids_lib')
17+
18+
% Loop over list of reference blocks
19+
for rb_i = 1:size(refBlks,1)
20+
21+
% Create one figure per entry in refBlks
22+
figure(rb_i)
23+
ax_h = gca;
24+
refBlkName = get_param(refBlks{rb_i,1},'Name');
25+
crInds = findstr(refBlkName,char(10));
26+
refBlkName(crInds) = ' ';
27+
28+
% Find all blocks in model that have Reference Block type
29+
bh = Simulink.findBlocks(modelName,'ReferenceBlock',refBlks{rb_i,1},f);
30+
31+
% Loop over blocks that were found
32+
for i=1:length(bh)
33+
34+
% Get path through simlog to plot variable
35+
blkName = get_param(bh(i),'Name');
36+
37+
% Eliminate carriage returns
38+
crInds = findstr(blkName,char(10));
39+
blkName(crInds) = ' ';
40+
pth = getfullname(bh(i));
41+
repStr = modelName;
42+
pth = pth(length(repStr)+2:end);
43+
nodeData = get(simOut.simlog_Excavator_Complete,pth);
44+
varData = get(nodeData,refBlks{rb_i,2});
45+
46+
% Plot results
47+
plot(ax_h,varData.series.time,varData.series.values,'DisplayName',blkName)
48+
hold(ax_h,'on');
49+
end
50+
hold(ax_h,'off');
51+
legend(ax_h,'Location','Best')
52+
title(ax_h,[refBlkName ', ' strrep(refBlks{rb_i,2},'_','\_')])
53+
end

Models/Cosim/Mevea/Models_Mevea/Excv_Mevea_FMU_Bucket/Assemblies/LargeBucket.xml

Lines changed: 235 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<MeVEASimulation>
3+
<Environment simulationName="Excavator bucket with external control" particlesInThread="Yes" particleCellsInThread="Yes" nCollisionThreads="1" />
4+
<Models ModelFile="LargeExcavatorFMU_CS_Control 20250924.xml" solverID="1" useArchive="No" MPKFile="" />
5+
<ModelCreationInfo modelVersion="" softwareVersion="6.1.0" modellerVersion="2533" solverVersion="6.1.0.5668" />
6+
</MeVEASimulation>

Models/Cosim/Mevea/Models_Mevea/Excv_Mevea_FMU_Bucket/LargeExcavatorFMU_CS_Control 20250924.xml

Lines changed: 234 additions & 0 deletions
Large diffs are not rendered by default.
Binary file not shown.

0 commit comments

Comments
 (0)