From a23ba49056a36aff221d0c23e228b981222c3576 Mon Sep 17 00:00:00 2001 From: Yuan Xu Date: Wed, 24 May 2023 17:35:46 +0200 Subject: add submission zip --- Submission files/generate_params.m | 58 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 Submission files/generate_params.m (limited to 'Submission files/generate_params.m') diff --git a/Submission files/generate_params.m b/Submission files/generate_params.m new file mode 100644 index 0000000..4b61e31 --- /dev/null +++ b/Submission files/generate_params.m @@ -0,0 +1,58 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Copyright (c) 2023, Amon Lahr, Simon Muntwiler, Antoine Leeman & Fabian Flürenbrock Institute for Dynamic Systems and Control, ETH Zurich. +% +% All rights reserved. +% +% Please see the LICENSE file that has been included as part of this package. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function [params] = generate_params() +params = struct(); + +Tf = 60*60*24 * 2; % = 2 days +dt = 60 * 10; % = 10 minutes + +% model +params.model = struct(... + 'nx', 6, ... + 'nu', 3, ... + 'Mass', 300, ... + 'GravitationalParameter', 3.986e14, ... + 'ScalingMatrix', [1e-6*eye(3), zeros(3); zeros(3), 1e-3*eye(3)], ... + 'TargetRadius', 7000e3, ... + 'TimeStep', dt, ... + 'HorizonLength', ceil(Tf / dt), ... + 'InitialConditionA', [-15e-3; -400e-3; 24.4e-3; 0; 0.0081; 0], ... + 'InitialConditionB', [-20e-3; 400e-3; 24.4e-3; 0; 0.0108; 0], ... + 'InitialConditionC', [0.02; 0.01; -0.005; 0; 0; 0] ... +); + +% constraints +params.constraints = struct(... + 'MaxAbsPositionXZ', 0.1, ... + 'MaxAbsPositionY', 1, ... + 'MaxAbsThrust', 1, ... + 'MaxFinalPosDiff' , 3e-4, ... + 'MaxFinalVelDiff', 1e-3 ... +); + +params.exercise = struct( ... + 'QdiagOptA', [94.0; 0.1579; 300; 0.01; 0.10; 0.10] ... +); + +% Add system model +[Ac, Bc] = generate_system_cont(params); +[At, Bt] = generate_system(Ac, Bc, params); +[A, B] = generate_system_scaled(At, Bt, params); + +params.model.A = A; +params.model.B = B; + +% Add constraints +[H_u, h_u, H_x, h_x] = generate_constraints(params); +params.constraints.InputMatrix = H_u; +params.constraints.InputRHS = h_u; +params.constraints.StateMatrix = H_x; +params.constraints.StateRHS = h_x; + +end -- cgit v1.2.1