diff --git a/missions/2024_Lyra_Roccaraso_September/data/aerodynamics.mat b/missions/2024_Lyra_Roccaraso_September/data/aerodynamics.mat index b4fe7f40100a274ac7ef733e753e24917d61d0b8..02c6f1eb4a01d10a03b91b82bd09aff0f83fc0b7 100644 --- a/missions/2024_Lyra_Roccaraso_September/data/aerodynamics.mat +++ b/missions/2024_Lyra_Roccaraso_September/data/aerodynamics.mat @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6aef0549361528025e4525ad22a9938063135c5467b5a93e6e8e1661789868ba -size 61487003 +oid sha256:bfe5ec74ea1cd080bb24101812563ab3e85328497130f7393d80907f1ef100fa +size 102505382 diff --git a/tests/Test.m b/tests/Test.m index 0c7084755fb6b89af1e337ebb2dca8e1e8e35aa7..5021898fd986bc796805d081894b8e2d67158bcb 100644 --- a/tests/Test.m +++ b/tests/Test.m @@ -12,6 +12,10 @@ classdef Test < Config d double end + properties(Dependent) + e + end + properties(Access = protected) configName = ''; mission Mission @@ -24,5 +28,9 @@ classdef Test < Config obj.c = c; obj.d = d; end + + function e = get.e(obj) + e = obj.c*ones(10000, 10000); + end end end \ No newline at end of file diff --git a/tests/speedBenchmark.m b/tests/speedBenchmark.m index 36762e2e7d8bb07dc8e1af8e0e95a490240b1d3f..68055776ad1243bac7db8bd31bffdbf29847e8cd 100644 --- a/tests/speedBenchmark.m +++ b/tests/speedBenchmark.m @@ -97,23 +97,23 @@ t = 0; Y = zeros(1,13); Y(end) = 1; -%tic +tic [Ta, Ya] = ode113(@ascent, [0, tf], Y0a, settings.ode.optionsasc1, geo, mass, motor, inertia, ... env, wind, aero, settings); % till the apogee -%classTime = toc; - -% motor = struct(motor); -% wind = struct(wind); -% aero = struct(aero); -% mass = struct(mass); -% env = struct(env); -% geo = struct(geo); -% inertia = struct(inertia); -% clc; -% -% tic -% [~, ~] = ode113(@ascent, [0, tf], Y0a, settings.ode.optionsasc1, geo, mass, motor, inertia, ... -% env, wind, aero, settings); % till the apogee -% structTime = toc; -% -% fprintf('speed ratio (class/struct): %f\n', (classTime / structTime)); \ No newline at end of file +classTime = toc; + +motor = struct(motor); +wind = struct(wind); +aero = struct(aero); +mass = struct(mass); +env = struct(env); +geo = struct(geo); +inertia = struct(inertia); +clc; + +tic +[~, ~] = ode113(@ascent, [0, tf], Y0a, settings.ode.optionsasc1, geo, mass, motor, inertia, ... + env, wind, aero, settings); % till the apogee +structTime = toc; + +fprintf('speed ratio (class/struct): %f\n', (classTime / structTime)); \ No newline at end of file diff --git a/tests/speedBenchmark2.m b/tests/speedBenchmark2.m new file mode 100644 index 0000000000000000000000000000000000000000..b164cda1587c66e065ec229e5929d6341858d4af --- /dev/null +++ b/tests/speedBenchmark2.m @@ -0,0 +1,30 @@ +a = 1; +b = 2; +c = 3; +d = 4; + +tic +e = ones(10000, 10000) * c; +toc + +tic +for i = 1:10 + t1 = e(i); +end +toc + +fprintf('\n=== CLASS ===\n\n') + +test = Test(1,2,3,4); + +tic + test.e; +toc + +e1 = test.e; + +tic +for i = 1:10 + t2 = e1(i); +end +toc \ No newline at end of file