plateform stringclasses 1
value | repo_name stringlengths 13 113 | name stringlengths 3 74 | ext stringclasses 1
value | path stringlengths 12 229 | size int64 23 843k | source_encoding stringclasses 9
values | md5 stringlengths 32 32 | text stringlengths 23 843k |
|---|---|---|---|---|---|---|---|---|
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | GJK_mod.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/GJK_Distance/GJK DISTANCE/GJK_mod.m | 6,720 | utf_8 | 5b06ac643912454d6a7709cccdb88a00 | function [a,b,c,d,flag] = GJK_mod(shape1,shape2,iterations)
% GJK Gilbert-Johnson-Keerthi Collision detection implementation.
% Returns whether two convex shapes are are penetrating or not
% (true/false). Only works for CONVEX shapes.
%
% Inputs:
% shape1:
% must have fields for XData,YData,ZData, which are the x,... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | GJK_dist.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/GJK_Distance/GJK DISTANCE/GJK_dist.m | 10,028 | utf_8 | 536b90ca4f66c97f6dad1e522b854947 | %This function is based on the book Real-Time Collision Detection
% (http://realtimecollisiondetection.net/)
%
%It computes the distance, the points of closest proximity points and also
%returns the points last contained in the simplex.
%[dist,pts,G,H] = GJK_dist_7_point_poly( shape1, shape2 )
%
% INPUTS:
%
% ... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | GJK.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/GJK_Distance/GJK DISTANCE/GJK.m | 6,009 | utf_8 | 30df12311f7526c9599cde4b2aaf7a3a | function [flag] = GJK(shape1,shape2,iterations)
% GJK Gilbert-Johnson-Keerthi Collision detection implementation.
% Returns whether two convex shapes are are penetrating or not
% (true/false). Only works for CONVEX shapes.
%
% Inputs:
% shape1:
% must have fields for XData,YData,ZData, which are the x,y,z
% coo... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | distLinSeg.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/GJK_Distance/GJK DISTANCE/distLinSeg.m | 2,407 | utf_8 | f4674ddd3116bd073e046a82cc0b8e1e | % Function for fast computation of the shortest distance between two line segments
%
% Algorithm implemented:
% Vladimir J. LUMELSKY,
% ``ON FAST COMPUTATION OF DISTANCE BETWEEN LINE SEGMENTS'',
% Information Processing Letters 21 (1985) 55-61
%
%
% Input: ([start point of line1], [end point of line1], [s... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | MakeObj.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/Exp_Dubins_SBONL/plotting/MakeObj.m | 683 | utf_8 | a81a3fae729eca365c5bffe0df3d8124 |
% returns convex hull from point cloud
function obj = MakeObj(points, color)
%figure()
% create face representation and create convex hull
F = convhull(points(1,:), points(2,:));
fill(points(1,F),points(2,F),color);
%{
S.Vertices = transpose(points(1:2,:));
S.Faces = F;
S.Face... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PlotSetBasedSim.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/Exp_Dubins_SBONL/plotting/PlotSetBasedSim.m | 1,265 | utf_8 | b7d3080567e0a89bd04feaa865dafaf8 | % PlotSetBasedSim(agentPos, obst, threshold)
%
% plots associated sets with the simulation
function PlotSetBasedSim(agentPos, obst, threshold, target)
figure()
hold on
% mA - coordinate (usually size 3)
% nA - time step, equal to iterations in simulation
[mA,nA] = size(agentPos);
... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PlotSimDistance.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/Exp_Dubins_SBONL/plotting/PlotSimDistance.m | 2,186 | utf_8 | 03c83a059200376eaa6a2ef93b87179e | % PlotSetBasedSim(agentPos, obst, threshold)
%
% plots max distance to target and min distance to projectile throughout
% the simulation
function PlotSimDistance(agentPos, obst, threshold, target)
figure()
hold on
% mA - coordinate (usually size 3)
% nA - time step, equal to iterations in si... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PlotSimDistanceSuccessive.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/Exp_Dubins_SBONL/plotting/PlotSimDistanceSuccessive.m | 2,189 | utf_8 | 1966c59ec2bb87432a05d3b9d69754f9 | % PlotSetBasedSim(agentPos, obst, threshold)
%
% plots max distance to target and min distance to projectile throughout
% the simulation
function PlotSimDistance(agentPos, obst, threshold, target)
figure(1)
hold on
% mA - coordinate (usually size 3)
% nA - time step, equal to iterations in s... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PlotOptimalPredicted.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/Exp_Dubins_SBONL/plotting/PlotOptimalPredicted.m | 1,217 | utf_8 | bd1dc3defa90d676db8e6faddd73e8b5 |
function PlotOptimalPredicted(agentPos, obst, threshold, target)
figure()
hold on
% mA - coordinate (usually size 3)
% nA - time step, equal to iterations in simulation
[mA,nA] = size(agentPos);
% create objects/convex hulls for each set at each time step
for i = 1:nA
... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | Cost.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/Exp_Dubins_SBONL/system/Cost.m | 1,037 | utf_8 | 7d52b29ad7c2ba935094018617a299dc | % c = Cost(x0_set, u, ts, target)
%
% custom cost function - sum of distance from each vertex to target squared
function c = Cost(x0_set, u, ts, target, L, terminalWeight)
% predict system state with set based dynamics
x_set = Dubin(x0_set,u,ts,L);
% calculate cost of prediction for set based dynamic... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | FindOptimalInput.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/Exp_Dubins_SBONL/system/FindOptimalInput.m | 1,227 | utf_8 | 3b444b8c7a413d695610a1b942349128 | % function u0 = FindOptimalInput(x0, N, ts, target)
%
% uses fmincon to minimize cost function given system dynamics and
% nonlinear constraints, returns optimal input sequence
function uopt = FindOptimalInput(x0_set, N, ts, target, xObst, threshold, L, speedBound, steeringBound, terminalWeight, EXP)
A = [];
... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | ObstConstraint.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/Exp_Dubins_SBONL/system/ObstConstraint.m | 1,535 | utf_8 | 2006293a6230997ad0315ff18f16d2a3 | % [c,ceq] = ObstConstraint(x0_set, u, ts, xObst, threshold)
%
% defines the non linear constraint - agent polytope to maintain
% a distance from the obstacle position above threshold
function [c,ceq] = ObstConstraint(x0_set, u, ts, xObst, threshold,L,options,EXP)
% predict agent with set based dynamics
... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | SingleIntegrator.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/Exp_Dubins_SBONL/system/SingleIntegrator.m | 412 | utf_8 | 103d816561c56f118cee17686dc4c4c4 | % x = SingleIntegrator(x0_set, u, ts)
%
% set based dynamics of single integrator
function x = SingleIntegrator(x0_set, u, ts)
[mP,nP] = size(x0_set);
[mH,nH] = size(u);
% coords X time X set points
x = zeros(3,nH+1,nP);
x(:,1,:) = x0_set;
% apply integrator dynamics
for j = 1:nP... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | SimulationProjectilePredict.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/Exp_Dubins_SBONL/projectile/SimulationProjectilePredict.m | 764 | utf_8 | 8ea559140e8b2248afec5e16b1990cb5 | % [trajectory, velocity] = SimulationProjectilePredict(p_0, simTime)
%
% calls on simulink to predict projectile state given initial conditions
function [trajectory, velocity] = SimulationProjectilePredict(p_0, simTime)
% set up simulink
set_param('projectile/rx','Value',num2str(p_0(1)));
set_param('proje... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | CreateSphere.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/Exp_Dubins_SBONL/polytope/CreateSphere.m | 913 | utf_8 | e7fc2c7730cbb8e66f70c29e702d9c20 |
% creates a point cloud in a sphere around the center
function points = CreateSphere(center, r, thetadis, phidis)
% angle discretization
thetas = linspace(0,2*pi,thetadis);
phis = linspace(0,pi,phidis);
% point calculation
points = [];
x = [];
y = [];
z = [];
for i = 1:length(phis)
for j = 1:... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PolytopeMinDist.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/Exp_Dubins_SBONL/polytope/PolytopeMinDist.m | 1,162 | utf_8 | e97b9cd17ce23a47a127987797ca0206 | % minDist = PolytopeMinDist(X1,X2)
%
% finds the minimum distance between two polytopes X1 and X2
function minDist = PolytopeMinDist(X1,X2,options)
% declare constraints for fmincon
lb = [];
ub = [];
% get sizes of vertices for polytopes
[m1,n1] = size(X1);
[m2,n2] = size(X2);
... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PolytopeApproxDist.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/Exp_Dubins_SBONL/polytope/PolytopeApproxDist.m | 474 | utf_8 | 7306751fed5e8ef4b13d8c2a2c0d62e5 |
function dist = PolytopeApproxDist(X1,X2)
[m1,n1] = size(X1);
[m2,n2] = size(X2);
c1 = transpose(mean(transpose(X1)));
c2 = transpose(mean(transpose(X2)));
dist1 = zeros(n1,1);
for i = 1:n1
dist1(i) = norm(X1(:,i)-c1);
end
dist2 = zeros(n2,1);
for i = 1:n2
... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PolytopeDist.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/Exp_Dubins_SBONL/polytope/PolytopeDist.m | 668 | utf_8 | 34f5332d650d2fb60f349903cb7edf17 |
function [f,g] = PolytopeDist(X1,X2,lambda,n1,n2,n)
f = norm((X1 * lambda(1:n1))-(X2 * lambda(n1+1:n)))^2;
%{
g = zeros(n,1);
for i = 1:n1
g(i) = 2*((X1(1,:)*lambda(1:n1))-(X2(1,:)*lambda(n1+1:n)))*X1(1,i) ...
+ 2*((X1(2,:)*lambda(1:n1))-(X2(2,:)*lambda(n1+1:n)))*X1(2,i) ...
... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | GJK.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/TruerMPC/GJK.m | 5,909 | utf_8 | acc17476d868c4bb652640495a721180 | function flag = GJK(shape1,shape2,iterations)
% GJK Gilbert-Johnson-Keerthi Collision detection implementation.
% Returns whether two convex shapes are are penetrating or not
% (true/false). Only works for CONVEX shapes.
%
% Inputs:
% shape1:
% must have fields for XData,YData,ZData, which are the x,y,z
% coord... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | convexhull.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/TruerMPC/convexhull.m | 1,701 | utf_8 | cb09453005f6a6fce441276524c4e5c7 | %How many iterations to allow for collision detection.
iterationsAllowed = 6;
% Make a figure
figure(1)
hold on
% constants for set making
cntr_1 = [0.0, 0.0, 0.0];
cntr_2 = [1.0, 0.0, 0.0];
r_1 = 0.5;
r_2 = 0.2;
tdis = 11;
pdis = 6;
% create point cloud
sphere_1 = CreateSphere(cntr_1, r_1, tdis, pdis);
sphere_2 =... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | CreateSphere.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/TruerMPC/functions/CreateSphere.m | 866 | utf_8 | 3ea485e3c5956a7fef00a0fe4c32bddb |
% creates a point cloud in a sphere around the center
function points = CreateSphere(center, r, thetadis, phidis)
% angle discretization
thetas = linspace(0,2*pi,thetadis);
phis = linspace(0,pi,phidis);
% point calculation
points = [];
x = [];
y = [];
z = [];
for i = 1:length(phis)
for j = 1:... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | SBPC.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/TruerMPC/functions/SBPC.m | 5,590 | utf_8 | bf2e9d6733935b85f70c82b3de97fe38 |
% prediction algorithm
% state - [x, y, z, px, py, pz, pxdot, pydot, pzdot]
function input = SBPC(state,target,sigma,QR,PR,TDIS,PDIS,N,K,TIMESTEP,VELOCITY)
% number of iterations to allow for collision detection.
iterationsAllowed = 6;
% target object
targetSet = CreateSphere(target, 0.001, 5, 5)... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | MakeObj.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/TruerMPC/functions/MakeObj.m | 600 | utf_8 | 53c884edac0b0ac6c6a36eef2b4b63cc |
% returns convex hull from point cloud
function obj = MakeObj(points, color)
%figure()
% create face representation and create convex hull
F = convhull(points(:,1), points(:,2), points(:,3));
S.Vertices = points;
S.Faces = F;
S.FaceVertexCData = jet(size(points,1));
S.FaceColor = 'interp';
... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | SimulationMakeObj.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/TruerMPC/functions/SimulationMakeObj.m | 367 | utf_8 | d4f1152a27a0887bcaaf5135543da40a |
% returns convex hull from point cloud
function obj = SimulationMakeObj(points)
%figure()
% create face representation and create convex hull
F = convhull(points(:,1), points(:,2), points(:,3));
S.Vertices = points;
S.Faces = F;
S.FaceVertexCData = jet(size(points,1));
S.FaceColor = 'interp... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | SimulationSBPC.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/TruerMPC/functions/SimulationSBPC.m | 5,284 | utf_8 | 60c22e645f032eb5bd2dfa58890c8fa7 | % prediction algorithm
% state - [x, y, z, px, py, pz, pxdot, pydot, pzdot]
function input = SimulationSBPC(state,target,sigma,QR,PR,TDIS,PDIS,N,K,TIMESTEP,VELOCITY)
% number of iterations to allow for collision detection.
iterationsAllowed = 3;
% target object
targetSet = CreateSphere(target, 0.0... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | CostSum.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/TruerMPC/functions/CostSum.m | 313 | utf_8 | 49502b1d0e6bda46cdf68a30ef0c6178 |
% calculates total cost of a trajectory
function totalCost = CostSum(trajectory, target, N)
totalCost = 0;
% sum distances between each point in trajectory and target
for i = 1:N
cost = pdist([trajectory(i,:); target], 'euclidean');
totalCost = totalCost + cost;
end
end |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | GJK_mod.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/TruerMPC/GJK DISTANCE/GJK_mod.m | 6,720 | utf_8 | 5b06ac643912454d6a7709cccdb88a00 | function [a,b,c,d,flag] = GJK_mod(shape1,shape2,iterations)
% GJK Gilbert-Johnson-Keerthi Collision detection implementation.
% Returns whether two convex shapes are are penetrating or not
% (true/false). Only works for CONVEX shapes.
%
% Inputs:
% shape1:
% must have fields for XData,YData,ZData, which are the x,... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | GJK_dist.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/TruerMPC/GJK DISTANCE/GJK_dist.m | 10,028 | utf_8 | 536b90ca4f66c97f6dad1e522b854947 | %This function is based on the book Real-Time Collision Detection
% (http://realtimecollisiondetection.net/)
%
%It computes the distance, the points of closest proximity points and also
%returns the points last contained in the simplex.
%[dist,pts,G,H] = GJK_dist_7_point_poly( shape1, shape2 )
%
% INPUTS:
%
% ... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | GJK.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/TruerMPC/GJK DISTANCE/GJK.m | 6,009 | utf_8 | 30df12311f7526c9599cde4b2aaf7a3a | function [flag] = GJK(shape1,shape2,iterations)
% GJK Gilbert-Johnson-Keerthi Collision detection implementation.
% Returns whether two convex shapes are are penetrating or not
% (true/false). Only works for CONVEX shapes.
%
% Inputs:
% shape1:
% must have fields for XData,YData,ZData, which are the x,y,z
% coo... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | distLinSeg.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/TruerMPC/GJK DISTANCE/distLinSeg.m | 2,407 | utf_8 | f4674ddd3116bd073e046a82cc0b8e1e | % Function for fast computation of the shortest distance between two line segments
%
% Algorithm implemented:
% Vladimir J. LUMELSKY,
% ``ON FAST COMPUTATION OF DISTANCE BETWEEN LINE SEGMENTS'',
% Information Processing Letters 21 (1985) 55-61
%
%
% Input: ([start point of line1], [end point of line1], [s... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | MakeObj.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/SBONL_MultipleObst/plotting/MakeObj.m | 624 | utf_8 | 21b5894435118a86bc40d17143893710 |
% returns convex hull from point cloud
function obj = MakeObj(points, color)
%figure()
% create face representation and create convex hull
F = convhull(points(1,:), points(2,:), points(3,:));
S.Vertices = transpose(points);
S.Faces = F;
S.FaceVertexCData = jet(size(points,1));
S.FaceColor =... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PlotSetBasedSim.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/SBONL_MultipleObst/plotting/PlotSetBasedSim.m | 1,440 | utf_8 | 8376aa33d176a72521448eb464a1ad66 | % PlotSetBasedSim(agentPos, obst, threshold)
%
% plots associated sets with the simulation
function PlotSetBasedSim(agentPos, obst, threshold, target)
figure()
hold on
% mA - coordinate (usually size 3)
% nA - number of points in each set
% pA - time step, equal to iterations in simula... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PlotSimDistance.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/SBONL_MultipleObst/plotting/PlotSimDistance.m | 1,669 | utf_8 | e13929ce3bc4fc592bc379669153b036 | % PlotSetBasedSim(agentPos, obst, threshold)
%
% plots max distance to target and min distance to projectile throughout
% the simulation
function PlotSimDistance(agentPos, obst, threshold, target)
figure()
hold on
% mA - coordinate (usually size 3)
% nA - number of points in each set
% p... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PlotOptimalPredicted.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/SBONL_MultipleObst/plotting/PlotOptimalPredicted.m | 1,354 | utf_8 | dfabe81778fe58855a75e53defd5b6c1 |
function PlotOptimalPredicted(agentPos, obst, threshold, target)
figure()
hold on
% mA - coordinate (usually size 3)
% nA - time step, equal to iterations in simulation
% pA - number of points in each set
[mA,nA,pA] = size(agentPos);
% create objects/convex hulls for each ... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | Cost.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/SBONL_MultipleObst/system/Cost.m | 804 | utf_8 | 12eaf7fb318a8f3e60546adda1dbf9e0 | % c = Cost(x0_set, u, ts, target)
%
% custom cost function - sum of distance from each vertex to target squared
function c = Cost(x0_set, u, ts, target)
% predict system state with set based dynamics
x_set = SingleIntegrator(x0_set,u,ts);
% calculate cost of prediction for set based dynamics
%... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | FindOptimalInput.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/SBONL_MultipleObst/system/FindOptimalInput.m | 825 | utf_8 | 7879ed6c2d02f9d83f588dd8e57d0257 | % function u0 = FindOptimalInput(x0, N, ts, target)
%
% uses fmincon to minimize cost function given system dynamics and
% nonlinear constraints, returns optimal input sequence
function u0 = FindOptimalInput(x0_set, N, ts, target, xObst, threshold)
A = [];
b = [];
Aeq = [];
beq = [];
% set l... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | ObstConstraint.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/SBONL_MultipleObst/system/ObstConstraint.m | 1,338 | utf_8 | a8f0d3ca6d3c3ba471cafb6dd54a7ced | % [c,ceq] = ObstConstraint(x0_set, u, ts, xObst, threshold)
%
% defines the non linear constraint - agent polytope to maintain
% a distance from the obstacle position above threshold
function [c,ceq] = ObstConstraint(x0_set, u, ts, xObst, threshold)
% predict agent with set based dynamics
% coords X ti... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | SingleIntegrator.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/SBONL_MultipleObst/system/SingleIntegrator.m | 412 | utf_8 | 103d816561c56f118cee17686dc4c4c4 | % x = SingleIntegrator(x0_set, u, ts)
%
% set based dynamics of single integrator
function x = SingleIntegrator(x0_set, u, ts)
[mP,nP] = size(x0_set);
[mH,nH] = size(u);
% coords X time X set points
x = zeros(3,nH+1,nP);
x(:,1,:) = x0_set;
% apply integrator dynamics
for j = 1:nP... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | SimulationProjectilePredict.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/SBONL_MultipleObst/projectile/SimulationProjectilePredict.m | 764 | utf_8 | 8ea559140e8b2248afec5e16b1990cb5 | % [trajectory, velocity] = SimulationProjectilePredict(p_0, simTime)
%
% calls on simulink to predict projectile state given initial conditions
function [trajectory, velocity] = SimulationProjectilePredict(p_0, simTime)
% set up simulink
set_param('projectile/rx','Value',num2str(p_0(1)));
set_param('proje... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | CreateSphere.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/SBONL_MultipleObst/polytope/CreateSphere.m | 913 | utf_8 | e7fc2c7730cbb8e66f70c29e702d9c20 |
% creates a point cloud in a sphere around the center
function points = CreateSphere(center, r, thetadis, phidis)
% angle discretization
thetas = linspace(0,2*pi,thetadis);
phis = linspace(0,pi,phidis);
% point calculation
points = [];
x = [];
y = [];
z = [];
for i = 1:length(phis)
for j = 1:... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PolytopeMinDist.m | .m | SetBasedPredictionCollisionAndEvasion-master/OldSimFiles/MatlabSim/SBONL_MultipleObst/polytope/PolytopeMinDist.m | 960 | utf_8 | 20c5308cdee25a3c8505d60826371706 | % minDist = PolytopeMinDist(X1,X2)
%
% finds the minimum distance between two polytopes X1 and X2
function minDist = PolytopeMinDist(X1,X2)
% declare constraints for fmincon
lb = [];
ub = [];
% get sizes of vertices for polytopes
[m1,n1] = size(X1);
[m2,n2] = size(X2);
if(m1 ... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PlotSetBasedSimSingle.m | .m | SetBasedPredictionCollisionAndEvasion-master/CASE_Simulation/plotting/PlotSetBasedSimSingle.m | 1,656 | utf_8 | 8cb1287b7a1a2b8f0f8452c845b28882 | % PlotSetBasedSim(agentPos, obst, threshold)
%
% plots associated sets with the simulation
function PlotSetBasedSim(agentPos, obst, threshold, target)
% mA - coordinate (usually size 3)
% nA - time step, equal to iterations in simulation
[mA,nA,pA] = size(agentPos);
% create obje... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PlotSetBasedSim_DO.m | .m | SetBasedPredictionCollisionAndEvasion-master/CASE_Simulation/plotting/PlotSetBasedSim_DO.m | 1,625 | utf_8 | 8864545c8077080445e4361d5bdecdc7 | % PlotSetBasedSim(agentPos, obst, threshold)
%
% plots associated sets with the simulation
function PlotSetBasedSim_DO(agentPos, obst, threshold, target, predictions)
% mA - coordinate
% nA - time step, equal to iterations in simulation
% pA - numSim
[mA,nA,pA] = size(agent... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | MakeObj.m | .m | SetBasedPredictionCollisionAndEvasion-master/CASE_Simulation/plotting/MakeObj.m | 683 | utf_8 | a81a3fae729eca365c5bffe0df3d8124 |
% returns convex hull from point cloud
function obj = MakeObj(points, color)
%figure()
% create face representation and create convex hull
F = convhull(points(1,:), points(2,:));
fill(points(1,F),points(2,F),color);
%{
S.Vertices = transpose(points(1:2,:));
S.Faces = F;
S.Face... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PlotSimDistance_DO.m | .m | SetBasedPredictionCollisionAndEvasion-master/CASE_Simulation/plotting/PlotSimDistance_DO.m | 1,805 | utf_8 | 3210dc4076617da791e502e3997a68e1 | % PlotSetBasedSim(agentPos, obst, threshold)
%
% plots max distance to target and min distance to projectile throughout
% the simulation
function PlotSimDistance_DO(agentPos, obst, threshold, target)
figure()
hold on
% mA - coordinate (usually size 3)
% nA - time step, equal to iterations in... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PlotSetBasedSim16.m | .m | SetBasedPredictionCollisionAndEvasion-master/CASE_Simulation/plotting/PlotSetBasedSim16.m | 2,996 | utf_8 | 18fd234337bdbe6d2e11e27d3c4c7469 | % PlotSetBasedSim(agentPos, obst, threshold)
%
% plots associated sets with the simulation
function PlotSetBasedSim(agentPos, obst, threshold, target)
% mA - coordinate (usually size 3)
% nA - time step, equal to iterations in simulation
[mA,nA,pA] = size(agentPos);
% create... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PlotSetBasedSim_SO.m | .m | SetBasedPredictionCollisionAndEvasion-master/CASE_Simulation/plotting/PlotSetBasedSim_SO.m | 1,679 | utf_8 | f30244ad8222015c7e4b7e7f637ffdd5 | % PlotSetBasedSim(agentPos, obst, threshold)
%
% plots associated sets with the simulation
function PlotSetBasedSim_SO(agentPos, obst, threshold, target, predictions)
figure()
FS = 50;
h = gcf;
set(gca,'FontSize',FS)
axis([-1.5 1.0 -1.5 1.5]);
grid on
box on
% mA - coo... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PlotSimDistance16.m | .m | SetBasedPredictionCollisionAndEvasion-master/CASE_Simulation/plotting/PlotSimDistance16.m | 4,064 | utf_8 | d1c282b26571b195d86ca84a3bf3dde9 | % PlotSetBasedSim(agentPos, obst, threshold)
%
% plots max distance to target and min distance to projectile throughout
% the simulation
function PlotSimDistance(agentPos, obst, threshold, target)
% mA - coordinate (usually size 3)
% nA - time step, equal to iterations in simulation
[mA,nA,... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PlotSimDistance_SO.m | .m | SetBasedPredictionCollisionAndEvasion-master/CASE_Simulation/plotting/PlotSimDistance_SO.m | 2,921 | utf_8 | fb80862abdaa4892147f82d5a38ab012 | % PlotSetBasedSim(agentPos, obst, threshold)
%
% plots max distance to target and min distance to projectile throughout
% the simulation
function PlotSimDistance_SO(agentPos, obst, threshold, target)
% mA - coordinate (usually size 3)
% nA - time step, equal to iterations in simulation
[mA,... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PlotSimDistanceSuccessive.m | .m | SetBasedPredictionCollisionAndEvasion-master/CASE_Simulation/plotting/PlotSimDistanceSuccessive.m | 2,189 | utf_8 | 1966c59ec2bb87432a05d3b9d69754f9 | % PlotSetBasedSim(agentPos, obst, threshold)
%
% plots max distance to target and min distance to projectile throughout
% the simulation
function PlotSimDistance(agentPos, obst, threshold, target)
figure(1)
hold on
% mA - coordinate (usually size 3)
% nA - time step, equal to iterations in s... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PlotOptimalPredicted.m | .m | SetBasedPredictionCollisionAndEvasion-master/CASE_Simulation/plotting/PlotOptimalPredicted.m | 1,231 | utf_8 | a1fa72c034992b3f76f995656abe6af9 |
function PlotOptimalPredicted(agentPos, obst, threshold, target)
figure()
hold on
% mA - coordinate (usually size 3)
% nA - time step, equal to iterations in simulation
[mA,nA] = size(agentPos);
% create objects/convex hulls for each set at each time step
for i = 1:nA
... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | Cost.m | .m | SetBasedPredictionCollisionAndEvasion-master/CASE_Simulation/system/Cost.m | 1,037 | utf_8 | 7d52b29ad7c2ba935094018617a299dc | % c = Cost(x0_set, u, ts, target)
%
% custom cost function - sum of distance from each vertex to target squared
function c = Cost(x0_set, u, ts, target, L, terminalWeight)
% predict system state with set based dynamics
x_set = Dubin(x0_set,u,ts,L);
% calculate cost of prediction for set based dynamic... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | FindOptimalInput.m | .m | SetBasedPredictionCollisionAndEvasion-master/CASE_Simulation/system/FindOptimalInput.m | 1,241 | utf_8 | 5caed38f53976af545767fbafde53c10 | % function u0 = FindOptimalInput(x0, N, ts, target)
%
% uses fmincon to minimize cost function given system dynamics and
% nonlinear constraints, returns optimal input sequence
function uopt = FindOptimalInput(x0_set, N, ts, target, xObst, threshold, L, speedBound, steeringBound, terminalWeight, uGuess, EXP)
A =... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | ObstConstraint.m | .m | SetBasedPredictionCollisionAndEvasion-master/CASE_Simulation/system/ObstConstraint.m | 1,535 | utf_8 | 2006293a6230997ad0315ff18f16d2a3 | % [c,ceq] = ObstConstraint(x0_set, u, ts, xObst, threshold)
%
% defines the non linear constraint - agent polytope to maintain
% a distance from the obstacle position above threshold
function [c,ceq] = ObstConstraint(x0_set, u, ts, xObst, threshold,L,options,EXP)
% predict agent with set based dynamics
... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | SingleIntegrator.m | .m | SetBasedPredictionCollisionAndEvasion-master/CASE_Simulation/system/SingleIntegrator.m | 412 | utf_8 | 103d816561c56f118cee17686dc4c4c4 | % x = SingleIntegrator(x0_set, u, ts)
%
% set based dynamics of single integrator
function x = SingleIntegrator(x0_set, u, ts)
[mP,nP] = size(x0_set);
[mH,nH] = size(u);
% coords X time X set points
x = zeros(3,nH+1,nP);
x(:,1,:) = x0_set;
% apply integrator dynamics
for j = 1:nP... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | SimulationProjectilePredict.m | .m | SetBasedPredictionCollisionAndEvasion-master/CASE_Simulation/projectile/SimulationProjectilePredict.m | 764 | utf_8 | 8ea559140e8b2248afec5e16b1990cb5 | % [trajectory, velocity] = SimulationProjectilePredict(p_0, simTime)
%
% calls on simulink to predict projectile state given initial conditions
function [trajectory, velocity] = SimulationProjectilePredict(p_0, simTime)
% set up simulink
set_param('projectile/rx','Value',num2str(p_0(1)));
set_param('proje... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | CreateSphere.m | .m | SetBasedPredictionCollisionAndEvasion-master/CASE_Simulation/polytope/CreateSphere.m | 913 | utf_8 | e7fc2c7730cbb8e66f70c29e702d9c20 |
% creates a point cloud in a sphere around the center
function points = CreateSphere(center, r, thetadis, phidis)
% angle discretization
thetas = linspace(0,2*pi,thetadis);
phis = linspace(0,pi,phidis);
% point calculation
points = [];
x = [];
y = [];
z = [];
for i = 1:length(phis)
for j = 1:... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PolytopeMinDist.m | .m | SetBasedPredictionCollisionAndEvasion-master/CASE_Simulation/polytope/PolytopeMinDist.m | 1,162 | utf_8 | e97b9cd17ce23a47a127987797ca0206 | % minDist = PolytopeMinDist(X1,X2)
%
% finds the minimum distance between two polytopes X1 and X2
function minDist = PolytopeMinDist(X1,X2,options)
% declare constraints for fmincon
lb = [];
ub = [];
% get sizes of vertices for polytopes
[m1,n1] = size(X1);
[m2,n2] = size(X2);
... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PolytopeApproxDist.m | .m | SetBasedPredictionCollisionAndEvasion-master/CASE_Simulation/polytope/PolytopeApproxDist.m | 474 | utf_8 | 7306751fed5e8ef4b13d8c2a2c0d62e5 |
function dist = PolytopeApproxDist(X1,X2)
[m1,n1] = size(X1);
[m2,n2] = size(X2);
c1 = transpose(mean(transpose(X1)));
c2 = transpose(mean(transpose(X2)));
dist1 = zeros(n1,1);
for i = 1:n1
dist1(i) = norm(X1(:,i)-c1);
end
dist2 = zeros(n2,1);
for i = 1:n2
... |
github | HybridSystemsLab/SetBasedPredictionCollisionAndEvasion-master | PolytopeDist.m | .m | SetBasedPredictionCollisionAndEvasion-master/CASE_Simulation/polytope/PolytopeDist.m | 668 | utf_8 | 34f5332d650d2fb60f349903cb7edf17 |
function [f,g] = PolytopeDist(X1,X2,lambda,n1,n2,n)
f = norm((X1 * lambda(1:n1))-(X2 * lambda(n1+1:n)))^2;
%{
g = zeros(n,1);
for i = 1:n1
g(i) = 2*((X1(1,:)*lambda(1:n1))-(X2(1,:)*lambda(n1+1:n)))*X1(1,i) ...
+ 2*((X1(2,:)*lambda(1:n1))-(X2(2,:)*lambda(n1+1:n)))*X1(2,i) ...
... |
github | nasa/VirtualADAPT-master | FaultInjectionGUI.m | .m | VirtualADAPT-master/MATLAB/FaultInjectionGUI.m | 17,252 | utf_8 | fee51603cf5f6ca78bf33120e3ef2a19 | function varargout = FaultInjectionGUI(varargin)
% FAULTINJECTIONGUI M-file for FaultInjectionGUI.fig
% FAULTINJECTIONGUI, by itself, creates a new FAULTINJECTIONGUI or raises the existing
% singleton*.
%
% H = FAULTINJECTIONGUI returns the handle to a new FAULTINJECTIONGUI or the handle to
% the ex... |
github | xhuang31/LANE-master | Performance.m | .m | LANE-master/Performance.m | 3,202 | utf_8 | ad6f8f3b492868c911c6b76ecf5768ec | function [F1macro,F1micro] = Performance(Xtrain,Xtest,Ytrain,Ytest)
%Evaluate the performance of classification for both multi-class and multi-label Classification
% [F1macro,F1micro] = Performance(Xtrain,Xtest,Ytrain,Ytest)
%
% Xtrain is the training data with row denotes instances, column denotes features
%... |
github | SakaSerbia/MATLAB-Filter-ECG-signal-and-FIR-direct-transposed-Homework-number-3-master | FIR_direct_transpose.m | .m | MATLAB-Filter-ECG-signal-and-FIR-direct-transposed-Homework-number-3-master/FIR_direct_transpose.m | 1,257 | utf_8 | 739f3ed8f5d294dc952ee4d7951be1ca | %Teorija
%Transpozicija se vrsi tako sto ulazni i izlazni signali promene mesta,
%svim granama se promeni smer, cvorovi granjanja postanu sabiraci, a
%sabiraci postanu tacke granjanja.
%Dodatna objasnjenja MIT OpenCourseWare http://ocw.mit.edu
%Signal Processing: Continuous and Discrete, Fall 2008
function [ y ] = FI... |
github | JenifferWuUCLA/DSB2017-1-master | label_stage1.m | .m | DSB2017-1-master/training/detector/labels/label_stage1.m | 4,931 | utf_8 | a9fdc8773cd38b8f717beaf07df746ff | clear
clc
close all
lungwindow = [-1900,1100];
lumTrans = @(x) uint8((x-lungwindow(1))/(diff(lungwindow))*256);
path = 'E:\Kaggle.Data\stage1';
cases = dir(path);
cases = {cases.name};
cases = cases(3:end);
header = {'id', 'coordx1','coordx1','coordx1','diameter'};
labelfile = 'label_job2.csv';
if ~... |
github | pascal220/PMSM_Control-master | MPCController.m | .m | PMSM_Control-master/Model Predictive Control/MPCtools-1.0/MPCtools-1.0/MPCController.m | 4,302 | utf_8 | 66841584b3d48bab415e1eaafb795dad | function [sys,x0,str,ts] = MPCController(t,x,u,flag,md)
%
% [sys,x0,str,ts] = MPCController(t,x,u,flag,md)
%
% is an S-function implementing the MPC controller intended for use
% with Simulink. The argument md, which is the only user supplied
% argument, contains the data structures needed by the controller. The
% in... |
github | pascal220/PMSM_Control-master | ssmpc_simulate.m | .m | PMSM_Control-master/Model Predictive Control/rossiter/ssmpc_simulate.m | 5,037 | utf_8 | fe5c0e959b026751851ad7d07bfcc69a | %%% Simulation of dual mode optimal predictive control
%%%
%% [x,y,u,c,r] = ssmpc_simulate(A,B,C,D,Q,R,umax,umin,Kxmax,xmax,nc,x0,ref,dist,noise)
%%
%%% x(k+1) = A x(k) + B u(k) x0 is the initial condition
%%% y(k) = C x(k) + D u(k) + dist Note: Assumes D=0, dist unknown
%%%
%% input c... |
github | pascal220/PMSM_Control-master | mpc_predtfilt.m | .m | PMSM_Control-master/Model Predictive Control/rossiter/mpc_predtfilt.m | 1,025 | utf_8 | 930a72b67ebbc32559919cf286a96a67 | %%% To find the prediction matrices with a T-filter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% yfut = H*Dufut + Pt*Dut + Qt*yt
%%%
%%% Dut = Du/Tfilt yt = y/Tfilt
%%%
%%% GIVEN yfut = H *Dufut + P*Dupast + Q*ypast
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% [Pt... |
github | pascal220/PMSM_Control-master | imgpc_costfunction.m | .m | PMSM_Control-master/Model Predictive Control/rossiter/imgpc_costfunction.m | 1,783 | utf_8 | 43ab78f5ad32ef078482ebd990bd1682 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Find a predictive control law and optimal cost given predictions
%%%% yfut = P*xfut+H*ufut+L*offset
%%%% uss = M(r-offset)
%%%%
%%%% Uses the cost function J = sum (r-y)^2 + R(u-uss)^2
%%%% J = ufut'*S*ufut + 2 ufut'*X*[x;... |
github | pascal220/PMSM_Control-master | mpc_law.m | .m | PMSM_Control-master/Model Predictive Control/rossiter/mpc_law.m | 1,464 | utf_8 | ad7c22af39298911ea7d46ec1708387c | %%%% Compute MPC control law given the prediction matrices
%%%% Assumes: (i) u constant after nu steps
%%%% (ii) predictions given as
%%%% y = H*Du(future) + P*Du(past) + Q*y(past)
%%%% (iii) weights on cost are Wy (outputs), Wu (inputs)
%%%% (iv) s... |
github | pascal220/PMSM_Control-master | summary.m | .m | PMSM_Control-master/Model Predictive Control/rossiter/summary.m | 1,130 | utf_8 | 0706ed07547ce1a03d5147827795e39f | FILES IN SUPPORT OF: Model-based predictive control: a practical approach,
by J.A. Rossiter
These files are intended as a support to this book to enable
students to investigate predictive control algorithms from the formulation of the
prediction equations right through to the closed-loop simulation.
The co... |
github | pascal220/PMSM_Control-master | mpc_simulate.m | .m | PMSM_Control-master/Model Predictive Control/rossiter/mpc_simulate.m | 6,141 | utf_8 | 8a8b31fbc04bc0109e3963b34a0c1ffc | %%%%%%%%%%%%%% Either: (NO T-filter!!)
%%%%%%%%%%%%%% (1) Gives control law parameters (nargin = 6 only)
%%%%%%%%%%%%%% (2) Simulates MIMO GPC with constraint handling
%%%
%%%%% [Nk,Dk,Pr] = mpc_simulate(B,A,nu,ny,Wu,Wy)
%%%%% Du(k) = Pr*r(k+1) - Dk*Du(k-1) - Nk*y(k)
%%
%%%%% ... |
github | pascal220/PMSM_Control-master | imgpc_predmat.m | .m | PMSM_Control-master/Model Predictive Control/rossiter/imgpc_predmat.m | 1,002 | utf_8 | fb63d0fcda8514a1ecbbded69d442163 | %%%% To form prediction matrices over horizon ny given
%%%%
%%%% x(k+1) = Ax(k)+Bu(k); y(k) = Cx(k) + D u(k); Assumes D=0
%%%%
%%%% Use absolute inputs (not increments)
%%%%
%%%% yfut = P*x + H*ufut + L*offset [offset = y(process) - y(model)]
%%%%
%%% Also estimate steady-state input as uss... |
github | pascal220/PMSM_Control-master | mpc_simulate_tfilt.m | .m | PMSM_Control-master/Model Predictive Control/rossiter/mpc_simulate_tfilt.m | 6,612 | utf_8 | e58a9597a07c38d673092adcc08d4907 | %%%%%%%%%%%%%% Either: (WITH T-filter!!)
%%%%%%%%%%%%%% (1) Gives control law parameters (nargin = 6 only)
%%%%%%%%%%%%%% (2) Simulates MIMO GPC with constraint handling
%%%
%%%%% [Nk,Dk,Pr] = mpc_simulate_tfilt(B,A,Tfilt,nu,ny,Wu,Wy)
%%%%% Du(k) = Pr*r(k+1) - Dk*Du(k-1) - Nk*y(k)... |
github | pascal220/PMSM_Control-master | caha.m | .m | PMSM_Control-master/Model Predictive Control/rossiter/caha.m | 664 | utf_8 | 8a6e93e762728865acd3f8797920c379 | % function [CA,HA] = caha(A,sizey,n)
%%
%% To find Toeplitz matrix Ca and hankel matrix Ha
%% with Ca having n block rows
%% Assume n > order(A)
%% sizey is the dimension of implied A(z)
%%
%% Author: J.A. Rossiter (email: J.A.Rossiter@shef.ac.uk)
function [Ca,Ha] = caha(A,sizey,n)
na = size(A... |
github | pascal220/PMSM_Control-master | imgpc_simulate.m | .m | PMSM_Control-master/Model Predictive Control/rossiter/imgpc_simulate.m | 5,712 | utf_8 | 239e7422c6460da4318cb9c812544e5d | %%% Simulation of independent model GPC with a state space model (Figure 1 on)
%%%
%%% Uses the cost function J = sum (r-y)^2 + R(u-uss)^2
%%% (weights absolute inputs not increments)
%%%
%% [x,y,u,r] = imgpc_simulate(A,B,C,D,R,ny,nu,umax,umin,Dumax,x0,ref,dist,noise);
%%
%%% x(k+1) = A x(k) + B u(k) ... |
github | pascal220/PMSM_Control-master | imgpc_constraints.m | .m | PMSM_Control-master/Model Predictive Control/rossiter/imgpc_constraints.m | 884 | utf_8 | 9e4933e9823712e2b43e6aec76d6e353 | %%%%% Constraints are summarised as
%%%%% umin < u < umax and | Du | < Dumax
%%%%%
%%%%% or CC*ufut -dfixed - dxu*u(k-1)<=0
%%%%% [Note: absolute inputs not increments]
%%%%%
%%%%% nu is the control horizon
%%%%%
%%%%% [CC,dfixed,dxu] = imgpc_constraints(nu,umin,... |
github | pascal220/PMSM_Control-master | ssmpc_costfunction.m | .m | PMSM_Control-master/Model Predictive Control/rossiter/ssmpc_costfunction.m | 718 | utf_8 | 4138d9ebd39bd4a954fe8832dc00d2c8 | %%% Given a model x = Ax + Bu
%%% control u = -Kx + c
%%% cost function J = sum xQx + uRu (sum to infinity)
%%%
%%% Then the cost function reduces to
%%% J = cSc + unconstrained optimal
%%% SS is for just one block, S is for nc blocks
%%%
%%% [S,SS] = ssmpc_costfunction(A,B,K,nc,Q,R)... |
github | pascal220/PMSM_Control-master | ssmpc_constraints.m | .m | PMSM_Control-master/Model Predictive Control/rossiter/ssmpc_constraints.m | 2,262 | utf_8 | 5c5ee9bf6f1761a7c7b647eba28610f6 | %%%%% Constraints are summarised as
%%%%% CC c - dfixed - dx0*[z;r;d] <= 0
%%%%% d is a known disturbance
%%%%%
%%%%% Predictions are
%%%%% x = Pc1*c + Pz1*z + Pr1*r + Pd1*d
%%%%% u = Pc2*c + Pz2*z + Pr2*r + Pd2*d
%%%%% Constraints are
%%%%% umin < u < umax Kxmax * x <... |
github | Chaogan-Yan/PaperScripts-master | SexinSeparateSites.m | .m | PaperScripts-master/WangYW_2023_NeuroImage/6Misuse/SexinSeparateSites.m | 14,920 | utf_8 | 9292a40c5035c39ae19742388b062dee | %% SMA
clear;
clc;
info = importdata('/mnt/Data3/RfMRILab/Wangyw/harmonization_project/old/CoRR/SubInfo/SubInfo_420.mat');
site = info.Site;
age = info.Age;
sex = info.Sex;
sex(sex==-1)=0;
motion1 = info.Motion(:,1);
motion2 = info.Motion(:,2);
subid = info.SubID;
SiteSWU_ind = find(site==8);
ResultsSet = {'Results','S... |
github | Chaogan-Yan/PaperScripts-master | SMA_TSP3.m | .m | PaperScripts-master/WangYW_2023_NeuroImage/1Harmo/1TSP3/SMA_TSP3.m | 2,490 | utf_8 | 6d2d91e5739a96f4ab4ab13282dfc43a | %% fitMMD for TST dataset
% different reference site
% calculate rmse and ICC
% IndexName ={'ReHo_FunImgARCWF','ALFF_FunImgARCW','fALFF_FunImgARCW','DegreeCentrality_FunImgARCWF','FC_D142'};
% % MeasurePrefixSet={'szReHoMap_','szALFFMap_','szfALFFMap_','szDegreeCentrality_PositiveWeightedSumBrainMap_'};
% datapath = '/... |
github | Chaogan-Yan/PaperScripts-master | FCP_ComBatcorr2022.m | .m | PaperScripts-master/WangYW_2023_NeuroImage/1Harmo/3FCP/FCP_ComBatcorr2022.m | 3,283 | utf_8 | f9b67608a18ee406532492ed29d689c9 | clear;clc;
%%load info
%corr
load /mnt/Data3/RfMRILab/Wangyw/harmonization_project/CoRR/SubInfo/SubInfo_420.mat ;
%load /mnt/Data3/RfMRILab/Wangyw/harmonization_project/CoRR/SubInfo/map_402in420.mat ;
Sex(Sex==-1)=0; %female
%fcp
FCP.info = importdata('/mnt/Data3/RfMRILab/Wangyw/harmonization_project/FCP_Organized/SubI... |
github | Chaogan-Yan/PaperScripts-master | bootstrappingExps2.m | .m | PaperScripts-master/WangYW_2023_NeuroImage/7SMATargetsiteChoice/FCP-Bootstrapping-Stability/bootstrappingExps2.m | 3,547 | utf_8 | 921a7c03bbb6bb708af0ecc21df261ab | %% bootstrapping for hypothsis test
% H0.a sample size does not affect result when distribution unchanged
% H0.b distribution does not affect result when sample size unchanged
%% H0.b distribution does not affect result when sample size unchanged
% target site: beijing
% source sites: leidein2200 satitlouis
%... |
github | Chaogan-Yan/PaperScripts-master | bootstrappingExps.m | .m | PaperScripts-master/WangYW_2023_NeuroImage/7SMATargetsiteChoice/FCP-Bootstrapping-Stability/bootstrappingExps.m | 3,913 | utf_8 | 95c431f6f43e369b49289a9b95fc18de | %% bootstrapping for hypothsis test
% H0.a sample size does not affect result when distribution unchanged
% H0.b distribution does not affect result when sample size unchanged
%% H0.a sample size does not affect result when distribution unchanged
% target site: beijing
% source sites: leidein2200 satitlouis
% ... |
github | skyhejing/IJCAI2017-master | list_update_u_l_three.m | .m | IJCAI2017-master/list_update_u_l_three.m | 1,575 | utf_8 | 77637ea8b8c19135e77e48efc352c342 | % function [f,g] = list_update_u_l_three(u_l_sample,user_unique_three, l_u,trainset_three,lamda,h,matrix_feature)
function [f,g] = list_update_u_l_three(u_l_sample, l_u,trainset_three,lamda,h,matrix_feature)
%deal f
u_l_sample=reshape(u_l_sample, h, matrix_feature);
u_l_trainset=u_l_sample(trainset_three(:,1),:... |
github | abhijitbendale/OWR-master | OW_plotResults.m | .m | OWR-master/src/OW_plotResults.m | 2,077 | utf_8 | a67559535bad8f1fb0de24dcf1c12fe2 |
function OW_plotResults(OSNCM, OSNNO, xx, yy)
% This script illustrates the a way to generate surface plots as shown
% in the paper [1]. You can replace performance numbers for OSNCM and
% OSNNO with whatever algorithm you prefer. A script that contains
% hard-coded performance numbers used in the paper are available... |
github | wme7/MultiGPU_AdvectionDiffusion-master | diffusion2dTest.m | .m | MultiGPU_AdvectionDiffusion-master/Matlab_Prototipes/DiffusionNd/diffusion2dTest.m | 1,860 | utf_8 | 5c2e8fdbee601257cce69d07c903db7c | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Solving 2-D heat equation with jacobi method
%
% u_t = D*(u_xx + u_yy) + s(u),
% for (x,y) \in [0,L]x[0,W] and S = s(u): source term
%
% coded by Manuel Diaz, manuel.ade'at'gmail.com
% ... |
github | wme7/MultiGPU_AdvectionDiffusion-master | diffusion1dTest.m | .m | MultiGPU_AdvectionDiffusion-master/Matlab_Prototipes/DiffusionNd/diffusion1dTest.m | 1,724 | utf_8 | 5dceb46128b35b857dee840a8bf932f4 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Solving 2-D heat equation with jacobi method
%
% u_t = D*(u_xx + u_yy) + s(u),
% for (x,y) \in [0,L]x[0,W] and S = s(u): source term
%
% coded by Manuel Diaz, manuel.ade'at'gmail.com
% ... |
github | wme7/MultiGPU_AdvectionDiffusion-master | diffusion3dTest.m | .m | MultiGPU_AdvectionDiffusion-master/Matlab_Prototipes/DiffusionNd/diffusion3dTest.m | 2,010 | utf_8 | 370e428c010b3f77f0bbb480b6fa1455 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Solving 3-D heat equation with jacobi method
%
% u_t = D*(u_xx + u_yy + u_zz) + s(u),
% for (x,y,z) \in [0,L]x[0,W]x[0,H] and S = s(u): source term
%
% coded by Manuel Diaz, manuel.ade'at'gmail.com
... |
github | yhw-yhw/caffe_rtpose-master | classification_demo.m | .m | caffe_rtpose-master/matlab/demo/classification_demo.m | 5,412 | utf_8 | 8f46deabe6cde287c4759f3bc8b7f819 | function [scores, maxlabel] = classification_demo(im, use_gpu)
% [scores, maxlabel] = classification_demo(im, use_gpu)
%
% Image classification demo using BVLC CaffeNet.
%
% IMPORTANT: before you run this demo, you should download BVLC CaffeNet
% from Model Zoo (http://caffe.berkeleyvision.org/model_zoo.html)
%
% *****... |
github | zhxing001/DIP_exercise-master | vanherk.m | .m | DIP_exercise-master/matlab/defog_hekaiming/vanherk.m | 4,665 | utf_8 | 29b98c380fda32f85f9b5f3d68ad8529 | function Y = vanherk(X,N,TYPE,varargin)
% VANHERK Fast max/min 1D filter
%
% Y = VANHERK(X,N,TYPE) performs the 1D max/min filtering of the row
% vector X using a N-length filter.
% The filtering type is defined by TYPE = 'max' or 'min'. This function
% uses the van Herk algorithm for min/max filters th... |
github | zhxing001/DIP_exercise-master | maxfilt2.m | .m | DIP_exercise-master/matlab/defog_hekaiming/maxfilt2.m | 1,784 | utf_8 | 30164e098eb4173079a7fe2779af8e60 | function Y = maxfilt2(X,varargin)
% MAXFILT2 Two-dimensional max filter
%
% Y = MAXFILT2(X,[M N]) performs two-dimensional maximum
% filtering on the image X using an M-by-N window. The result
% Y contains the maximun value in the M-by-N neighborhood around
% each pixel in the original image.
% ... |
github | zhxing001/DIP_exercise-master | minfilt2.m | .m | DIP_exercise-master/matlab/defog_hekaiming/minfilt2.m | 1,784 | utf_8 | 0100bdead43e5b8aad8f8e1e40699621 | function Y = minfilt2(X,varargin)
% MINFILT2 Two-dimensional min filter
%
% Y = MINFILT2(X,[M N]) performs two-dimensional minimum
% filtering on the image X using an M-by-N window. The result
% Y contains the minimun value in the M-by-N neighborhood around
% each pixel in the original image.
% ... |
github | zhxing001/DIP_exercise-master | buildWpyr.m | .m | DIP_exercise-master/matlab/denoiseBLS_GSM/Simoncelli_PyrTools/buildWpyr.m | 2,605 | utf_8 | 16663cdfba931a8f5e2ae6a4477253d0 | % [PYR, INDICES] = buildWpyr(IM, HEIGHT, FILT, EDGES)
%
% Construct a separable orthonormal QMF/wavelet pyramid on matrix (or vector) IM.
%
% HEIGHT (optional) specifies the number of pyramid levels to build. Default
% is maxPyrHt(IM,FILT). You can also specify 'auto' to use this value.
%
% FILT (optional) can be a st... |
github | zhxing001/DIP_exercise-master | pyrBand.m | .m | DIP_exercise-master/matlab/denoiseBLS_GSM/Simoncelli_PyrTools/pyrBand.m | 395 | utf_8 | 39c1e3772426a1362119d302d9767a24 | % RES = pyrBand(PYR, INDICES, BAND_NUM)
%
% Access a subband from a pyramid (gaussian, laplacian, QMF/wavelet,
% or steerable). Subbands are numbered consecutively, from finest
% (highest spatial frequency) to coarsest (lowest spatial frequency).
% Eero Simoncelli, 6/96.
function res = pyrBand(pyr, pind, band)
re... |
github | zhxing001/DIP_exercise-master | buildFullSFpyr2.m | .m | DIP_exercise-master/matlab/denoiseBLS_GSM/Simoncelli_PyrTools/buildFullSFpyr2.m | 3,031 | utf_8 | 4a1191e10f08e0d219040bdc7864a575 | % [PYR, INDICES, STEERMTX, HARMONICS] = buildFullSFpyr2(IM, HEIGHT, ORDER, TWIDTH)
%
% Construct a steerable pyramid on matrix IM, in the Fourier domain.
% Unlike the standard transform, subdivides the highpass band into
% orientations.
function [pyr,pind,steermtx,harmonics] = buildFullSFpyr2(im, ht, order, twidth)
%... |
github | zhxing001/DIP_exercise-master | var2.m | .m | DIP_exercise-master/matlab/denoiseBLS_GSM/Simoncelli_PyrTools/var2.m | 376 | utf_8 | ecdc1380cd3f7549b769d86bc0a25e12 | % V = VAR2(MTX,MEAN)
%
% Sample variance of a matrix.
% Passing MEAN (optional) makes the calculation faster.
function res = var2(mtx, mn)
if (exist('mn') ~= 1)
mn = mean2(mtx);
end
if (isreal(mtx))
res = sum(sum(abs(mtx-mn).^2)) / (prod(size(mtx)) - 1);
else
res = sum(sum(real(mtx-mn).^2)) + i*sum(sum(imag(... |
github | zhxing001/DIP_exercise-master | reconSFpyrLevs.m | .m | DIP_exercise-master/matlab/denoiseBLS_GSM/Simoncelli_PyrTools/reconSFpyrLevs.m | 1,945 | utf_8 | 11703edfa70ae1e00ba5819c7497efd3 | % RESDFT = reconSFpyrLevs(PYR,INDICES,LOGRAD,XRCOS,YRCOS,ANGLE,NBANDS,LEVS,BANDS)
%
% Recursive function for reconstructing levels of a steerable pyramid
% representation. This is called by reconSFpyr, and is not usually
% called directly.
% Eero Simoncelli, 5/97.
function resdft = reconSFpyrLevs(pyr,pind,log_rad,Xr... |
github | zhxing001/DIP_exercise-master | rcosFn.m | .m | DIP_exercise-master/matlab/denoiseBLS_GSM/Simoncelli_PyrTools/rcosFn.m | 1,122 | utf_8 | 36283e0a34f1baf7ea2c5e6cb23aab89 | % [X, Y] = rcosFn(WIDTH, POSITION, VALUES)
%
% Return a lookup table (suitable for use by INTERP1)
% containing a "raised cosine" soft threshold function:
%
% Y = VALUES(1) + (VALUES(2)-VALUES(1)) *
% cos^2( PI/2 * (X - POSITION + WIDTH)/WIDTH )
%
% WIDTH is the width of the region over which the tra... |
github | zhxing001/DIP_exercise-master | vector.m | .m | DIP_exercise-master/matlab/denoiseBLS_GSM/Simoncelli_PyrTools/vector.m | 231 | utf_8 | a3c1b483d801607eaef848381d85f189 | % [VEC] = vector(MTX)
%
% Pack elements of MTX into a column vector. Same as VEC = MTX(:)
% Previously named "vectorize" (changed to avoid overlap with Matlab's
% "vectorize" function).
function vec = vector(mtx)
vec = mtx(:);
|
github | zhxing001/DIP_exercise-master | showIm.m | .m | DIP_exercise-master/matlab/denoiseBLS_GSM/Simoncelli_PyrTools/showIm.m | 6,111 | utf_8 | 15fbbf55e2fd54e3f48ca936e23c3f32 | % RANGE = showIm (MATRIX, RANGE, ZOOM, LABEL, NSHADES )
%
% Display a MatLab MATRIX as a grayscale image in the current figure,
% inside the current axes. If MATRIX is complex, the real and imaginary
% parts are shown side-by-side, with the same grayscale mapping.
%
% If MATRIX is a string, it should be the name of... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.