Skip to content

Commit b114314

Browse files
committed
Initial commit v1p*8
1 parent 6ec1d7e commit b114314

23 files changed

+242
-108
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/B3D_Bucket/Overview/html/Excavator_Motion_B3D.html

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
To make changes, update the MATLAB code and republish this document.
88
-->
99
<title>Excavator Design with Simscape&trade;: Model Soil Loads</title>
10-
<meta name="generator" content="MATLAB 23.2">
10+
<meta name="generator" content="MATLAB 24.2">
1111
<link rel="schema.DC" href="http://purl.org/dc/elements/1.1/">
12-
<meta name="DC.date" content="2023-12-08">
12+
<meta name="DC.date" content="2025-07-24">
1313
<meta name="DC.source" content="Excavator_Motion_B3D.m">
1414
<style type="text/css">
1515
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outine:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}
@@ -81,12 +81,10 @@ <h1>Excavator Design with Simscape&trade;: Model Soil Loads</h1>
8181
<p>
8282
<img vspace="5" hspace="5" src="Excavator_Motion_B3D_Overview.png" alt=""> </p>
8383
<p>(<a href="matlab:web('Excavator_Design_Overview.html')">return to Excavator Design Overview</a>)</p>
84-
<p>This example models an excavator acting against soil loads modeled using discrete element modeling in ThreeParticle/CAE&trade; software. The motion of the actuators is prescribed, and the simulation calculates the amount of force or torque required to execute the motion. Cosimulation is used to connect the Simscape Multibody model to ThreeParticle/CAE&trade;.</p>
84+
<p>This example models an excavator acting against soil loads modeled using discrete element modeling in ThreeParticle/CAE software. The motion of the actuators is prescribed and the simulation calculates the amount of force or torque required to execute the motion. Cosimulation is used to connect the Simscape Multibody model to ThreeParticle/CAE.</p>
85+
<p>Follow the steps below to set up cosimulation on your machine. All of the files you need to set up the cosimulation are provided here. You will also need ThreeParticle software. Note that the compiled files provided will only work with MATLAB R2024b on a Windows 64 bit operating system. To set up this example for other versions or operating systems, please contact the authors of this submission on the MATLAB Central File Exchange.</p>
8586
<p>
86-
<b>If you have downloaded the correct release from GitHub</b>, you can follow the steps below to set up cosimulation on your machine. All of the files you need to set up the cosimulation are provided in a specific release you must obtain from the <a href="https://github.com/simscape/Excavator-Simscape">GitHub repository</a>. You will also need <a href="https://www.becker3d.com/">ThreeParticle/CAE&trade; software</a> R6.1 and API version 3.1.1 which you can obtain in a trial license from BECKER 3D.</p>
87-
<p>Note that the compiled files provided will only work with MATLAB R2023a on a Windows 64-bit operating system. To set up this example for other versions or operating systems, please contact the authors of this submission on the MATLAB Central File Exchange. We worked with <a href="https://simutopia.com/">Simutopia&reg;</a> to create this example.</p>
88-
<p>
89-
<a href="matlab:try,open_system('Excavator_Motion_B3D'),catch,warning('Model%20Excavator_Motion_B3D.slx%20not%20found.%20Please%20obtain%20the%20correct%20release%20from%20GitHub.'),end">Open Excavator with ThreeParticle DEM Soil Loads Model</a>
87+
<a href="matlab:open_system('Excavator_Motion_B3D')">Open Excavator with ThreeParticle DEM Soil Loads Model</a>
9088
</p>
9189
<!--/introduction-->
9290
<h2>Contents</h2>
@@ -110,9 +108,9 @@ <h2>Contents</h2>
110108
</ul>
111109
</div>
112110
<h2 id="1">Cosimulation Setup</h2>
113-
<p>(Note: the compiled files will only work with MATLAB R2023a on a Windows 64 bit operating system.)</p>
111+
<p>(Note: the compiled files will only work with MATLAB R2024b on a Windows 64 bit operating system.)</p>
114112
<p>
115-
<b>1. Copy <tt>\Models\Cosim\util_zmq\zmqdll\libzmq-v143-mt-4_3_5.dll</tt> to the "Bin" subfolder within your ThreeParticle installation directory.</b>
113+
<b>1. Copy <tt>\Models\Cosim\util_zmq\zmqdll\libzmq-v143-mt-4_3_6.dll</tt> to the "Bin" subfolder within your ThreeParticle installation directory.</b>
116114
</p>
117115
<p>
118116
<img vspace="5" hspace="5" src="Excavator_Motion_B3D_CopyZMQDLL.png" alt=""> </p>
@@ -122,7 +120,7 @@ <h2 id="1">Cosimulation Setup</h2>
122120
<p>
123121
<img vspace="5" hspace="5" src="Excavator_Motion_B3D_CopyAPICosimDLL.png" alt=""> </p>
124122
<p>
125-
<b>3. Open ThreeParticle/CAE&trade; Software</b>
123+
<b>3. Open ThreeParticle Software</b>
126124
</p>
127125
<p>
128126
<b>4. Import keyword file <tt>\Models\Cosim\B3D_Bucket\Models_B3D\Bucket_Dig_Cycle.inp</tt></b>
@@ -133,7 +131,7 @@ <h2 id="1">Cosimulation Setup</h2>
133131
<b>5. In MATLAB, open Simulink model Excavator_Motion_B3D.slx</b>
134132
</p>
135133
<p>
136-
<b>6. Start the simulation in ThreeParticle/CAE&trade; software</b>
134+
<b>6. Start the simulation in ThreeParticle software</b>
137135
</p>
138136
<p>
139137
<img vspace="5" hspace="5" src="Excavator_Motion_B3D_StartThreeParticleSim.png" alt=""> </p>
@@ -160,8 +158,8 @@ <h2 id="2">Model</h2>
160158
<p>The simulation actuates the excavator arm to dig the bucket into the bed of particles which models the soil. The soil loads are plotted below.</p>
161159
<p>
162160
<img vspace="5" hspace="5" src="Excavator_Motion_B3D_results_soil_loads.png" alt=""> </p>
163-
<p class="footer">Copyright 2022-2024 The MathWorks, Inc.<br>
164-
<a href="https://www.mathworks.com/products/matlab/">Published with MATLAB&reg; R2023b</a>
161+
<p class="footer">Copyright 2022-2023 The MathWorks, Inc.<br>
162+
<a href="https://www.mathworks.com/products/matlab/">Published with MATLAB&reg; R2024b</a>
165163
<br>
166164
</p>
167165
</div>
@@ -174,36 +172,29 @@ <h2 id="2">Model</h2>
174172
% (<matlab:web('Excavator_Design_Overview.html') return to Excavator Design Overview>)
175173
%
176174
% This example models an excavator acting against soil loads modeled using
177-
% discrete element modeling in ThreeParticle/CAE(TM) software. The motion of the
178-
% actuators is prescribed, and the simulation calculates the amount of force
175+
% discrete element modeling in ThreeParticle/CAE software. The motion of the
176+
% actuators is prescribed and the simulation calculates the amount of force
179177
% or torque required to execute the motion. Cosimulation is used to
180-
% connect the Simscape Multibody model to ThreeParticle/CAE(TM).
178+
% connect the Simscape Multibody model to ThreeParticle/CAE.
181179
%
182-
% *If you have downloaded the correct release from GitHub*, you can follow
183-
% the steps below to set up cosimulation on your machine. All of the files
184-
% you need to set up the cosimulation are provided in a specific release
185-
% you must obtain from the <https://github.com/simscape/Excavator-Simscape
186-
% GitHub repository>. You will also need <https://www.becker3d.com/
187-
% ThreeParticle/CAE(TM) software> R6.1 and API version 3.1.1 which you can
188-
% obtain in a trial license from BECKER 3D.
189-
%
190-
% Note that the compiled files provided will only work with MATLAB R2023a
191-
% on a Windows 64-bit operating system. To set up this example for other
192-
% versions or operating systems, please contact the authors of this
193-
% submission on the MATLAB Central File Exchange. We worked with
194-
% <https://simutopia.com/ Simutopia(R)> to create this example.
180+
% Follow the steps below to set up cosimulation on your machine. All of
181+
% the files you need to set up the cosimulation are provided here. You
182+
% will also need ThreeParticle software. Note that the compiled files
183+
% provided will only work with MATLAB R2024b on a Windows 64 bit operating
184+
% system. To set up this example for other versions or operating systems,
185+
% please contact the authors of this submission on the MATLAB Central File
186+
% Exchange.
195187
%
196-
% <matlab:try,open_system('Excavator_Motion_B3D'),catch,warning('Model%20Excavator_Motion_B3D.slx%20not%20found.%20Please%20obtain%20the%20correct%20release%20from%20GitHub.'),end Open Excavator with
197-
% ThreeParticle DEM Soil Loads Model>
188+
% <matlab:open_system('Excavator_Motion_B3D') Open Excavator with ThreeParticle DEM Soil Loads Model>
198189
%
199-
% Copyright 2022-2024 The MathWorks, Inc.
190+
% Copyright 2022-2023 The MathWorks, Inc.
200191
201192
%% Cosimulation Setup
202193
%
203-
% (Note: the compiled files will only work with MATLAB R2023a on a Windows
194+
% (Note: the compiled files will only work with MATLAB R2024b on a Windows
204195
% 64 bit operating system.)
205196
%
206-
% *1. Copy |\Models\Cosim\util_zmq\zmqdll\libzmq-v143-mt-4_3_5.dll| to the
197+
% *1. Copy |\Models\Cosim\util_zmq\zmqdll\libzmq-v143-mt-4_3_6.dll| to the
207198
% "Bin" subfolder within your ThreeParticle installation directory.*
208199
%
209200
% <<Excavator_Motion_B3D_CopyZMQDLL.png>>
@@ -213,7 +204,7 @@ <h2 id="2">Model</h2>
213204
%
214205
% <<Excavator_Motion_B3D_CopyAPICosimDLL.png>>
215206
%
216-
% *3. Open ThreeParticle/CAE(TM) Software*
207+
% *3. Open ThreeParticle Software*
217208
%
218209
% *4. Import keyword file
219210
% |\Models\Cosim\B3D_Bucket\Models_B3D\Bucket_Dig_Cycle.inp|*
@@ -222,7 +213,7 @@ <h2 id="2">Model</h2>
222213
%
223214
% *5. In MATLAB, open Simulink model Excavator_Motion_B3D.slx*
224215
%
225-
% *6. Start the simulation in ThreeParticle/CAE(TM) software*
216+
% *6. Start the simulation in ThreeParticle software*
226217
%
227218
% <<Excavator_Motion_B3D_StartThreeParticleSim.png>>
228219
%
-2 Bytes
Loading
-407 Bytes
Loading
195 Bytes
Loading
-24 Bytes
Loading
22.1 KB
Loading

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ To learn more about modeling and cosimulation with ThreeParticle/CAE&trade; plea
4848
* [BECKER 3D](https://www.becker3d.com/)
4949
* [Simutopia&reg;](https://simutopia.com/)
5050

51+
## **Excavator Model, Soil Loads and Terrain Interaction with Mevea**
52+
![](Models/Cosim/Mevea/Overview/html/Excavator_Mevea_Overview_Image.png)
53+
54+
To learn more about modeling and cosimulation with Mevea please visit [Mevea](https://mevea.com/)
55+
5156
To learn more about modeling and simulation with Simscape, please visit:
5257
* [Simscape Getting Started Resources](https://www.mathworks.com/solutions/physical-modeling/resources.html)
5358
* Product Capabilities:

0 commit comments

Comments
 (0)