Skip to content

Commit 03e346b

Browse files
author
vikrants
committed
First commit for R2024a
0 parents  commit 03e346b

File tree

625 files changed

+34336
-0
lines changed

Some content is hidden

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

625 files changed

+34336
-0
lines changed

.gitattributes

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
* text=auto
2+
3+
*.fig binary
4+
*.mat binary
5+
*.mdl binary diff merge=mlAutoMerge
6+
*.mdlp binary
7+
*.mex* binary
8+
*.mlapp binary
9+
*.mldatx binary
10+
*.mlproj binary
11+
*.mlx binary
12+
*.p binary
13+
*.sfx binary
14+
*.sldd binary
15+
*.slreqx binary merge=mlAutoMerge
16+
*.slmx binary merge=mlAutoMerge
17+
*.sltx binary
18+
*.slxc binary
19+
*.slx binary merge=mlAutoMerge
20+
*.slxp binary
21+
22+
## Other common binary file types
23+
*.docx binary
24+
*.exe binary
25+
*.jpg binary
26+
*.pdf binary
27+
*.png binary
28+
*.xlsx binary

.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Autosave files
2+
*.asv
3+
*.m~
4+
*.autosave
5+
*.slx.r*
6+
*.mdl.r*
7+
8+
# Derived content-obscured files
9+
*.p
10+
11+
# Compiled MEX files
12+
*.mex*
13+
14+
# Packaged app and toolbox files
15+
*.mlappinstall
16+
*.mltbx
17+
18+
# Deployable archives
19+
*.ctf
20+
21+
# Generated helpsearch folders
22+
helpsearch*/
23+
24+
# Code generation folders
25+
slprj/
26+
sccprj/
27+
codegen/
28+
29+
# Cache files
30+
*.slxc
31+
32+
# Cloud based storage dotfile
33+
.MATLABDriveTag
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<MATLABProject xmlns="http://www.mathworks.com/MATLABProjectFile" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0"/>

Components/Ambient/EnvModel.png

26.7 KB
Loading

Components/Ambient/EnvModel.ssc

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
component (Propagation = blocks) EnvModel
2+
%EnvModel
3+
% Ambient temperature model
4+
% <br/>
5+
% <br/>
6+
% <a href="matlab:open DocumentationCustomBlockAmbient.html">Ambient Model Documentation</a>
7+
% <br/>
8+
9+
% Copyright 2024 The MathWorks, Inc.
10+
11+
nodes
12+
A = foundation.thermal.thermal; % H
13+
end
14+
15+
variables (Access=private)
16+
Q = {0, 'W'}; % Heat flow rate
17+
end
18+
19+
branches
20+
Q : A.Q -> *;
21+
end
22+
23+
parameters
24+
listOfDays = 1:10; % List of days
25+
sunrise = {ones(1,10),'s'}; % Sunrise time vector
26+
sunset = {ones(1,10),'s'}; % Sunset time vector
27+
startTime = {0,'s'}; % Start time for simulation
28+
avgDayTvec = {300*ones(1,10),'K'}; % Average day temperature vector
29+
pcDayTvar = 5; % Percent variation in day temperature
30+
avgNightTvec = {300*ones(1,10),'K'}; % Average night temperature vector
31+
pcNightTvar = 5; % Percent variation in night temperature
32+
cloudData = cloudCoverOptions.daily; % Cloud cover data option
33+
cloudCoverVal = zeros(1,10); % Cloud cover value
34+
end
35+
36+
% Error Checks
37+
equations
38+
assert(length(listOfDays)==length(sunrise));
39+
assert(length(listOfDays)==length(sunset));
40+
assert(length(listOfDays)==length(avgDayTvec));
41+
assert(length(listOfDays)==length(avgNightTvec));
42+
end
43+
44+
if cloudData == cloudCoverOptions.daily
45+
equations
46+
assert(length(listOfDays)==length(cloudCoverVal))
47+
end
48+
else % cloudCoverOptions.hourly
49+
equations
50+
assert(24*length(listOfDays)==length(cloudCoverVal))
51+
end
52+
end
53+
54+
parameters(Access=private)
55+
[t,Tamb] = get24HrTemperatureProfile( ...
56+
value(avgDayTvec,'K'),pcDayTvar/100, ...
57+
value(avgNightTvec,'K'),pcNightTvar/100, ...
58+
value(sunrise,'s'),value(sunset,'s'));
59+
cloudCoverTime = 1:length(cloudCoverHourly);
60+
end
61+
62+
if cloudData == cloudCoverOptions.daily
63+
parameters(Access=private)
64+
cloudCoverHourly = repelem(cloudCoverVal,24);
65+
end
66+
else
67+
parameters(Access=private)
68+
cloudCoverHourly = cloudCoverVal;
69+
end
70+
end
71+
72+
outputs
73+
cloud = {0,'1'}; % C
74+
end
75+
76+
annotations
77+
A : Side=Right; % H
78+
UILayout = [UIGroup("Simulation Timeframe",listOfDays,sunrise,sunset,startTime) ...
79+
UIGroup("Temperature Model",avgDayTvec,pcDayTvar,avgNightTvec,pcNightTvar)...
80+
UIGroup("Cloud Cover Model",cloudData,cloudCoverVal)];
81+
end
82+
83+
intermediates
84+
currentTime = value(time + startTime,'s');
85+
end
86+
87+
equations
88+
A.T == {tablelookup(t,Tamb,currentTime,interpolation=linear,extrapolation=nearest),'K'};
89+
cloud == {tablelookup(cloudCoverTime,cloudCoverHourly,floor(currentTime/3600),interpolation=linear,extrapolation=nearest),'1'};
90+
end
91+
end
92+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
classdef cloudCoverOptions < int32
2+
% Cloud cover option definition.
3+
4+
% Copyright 2024 The MathWorks, Inc.
5+
6+
enumeration
7+
hourly (1)
8+
daily (2)
9+
end
10+
methods(Static)
11+
function map = displayText()
12+
map = containers.Map;
13+
map('hourly') = 'Hourly data';
14+
map('daily') = 'Day-wise data';
15+
end
16+
end
17+
end
13.8 KB
Loading

0 commit comments

Comments
 (0)