sEnglish for Scientist, Engineers and Agents
This document is understandable by any agent produced by the Cognitive Agents Toolbox (http://www.cognitive-agents-toolbox.com) and by any sEnglish Agent (http://www.system-english.com).
This paper is an HTML document that can be read and understood by any sEnglish Agent (available from system-english.com) that has the ability to interpret English sentences. Paragraphs in italics, such as this, are informal English inserted by the human author of this document to enhance understanding by human readers. All non-italics text, including titles of sections, are read by the agent, this is not an annotated document with hidden markers of meanings.
Application of sliding mode control
Demonstration of sliding mode control of spacecraft
Imagining of spacecraft movements
Spacecraft state change
Computation of attitude error
Computation of control torque and force
Computation of dynamical state derivative
Computation of errors to guidance
Computation of gradients to guidance potentials
Computation of position error
Computation of special dynamical force matrix
Definition of joint sliding surface
Definition of sliding surface weights
Forgetting the past
Initializing dynamical guidance state
Display of imagined movements
Getting the desired dynamical state
Getting the spacecraft data
Computation of inverse matrix
Computation of smoothed sign function
Concatenation of vectors
Definition of class
Definition of global variables
Definition of object by property value
Definition of property as given object
Initializing matrix
Truth value of strings are equal
Sentences to use: Use 'smc01-control' to obtain control torque T and control force U for spacecraft Spc01 from dynamical state X and guidance reference Xnow and Diffdot .
Available things are: U_( quote) , Xnow( guidance reference) , Spc01( spacecraft) , X( dynamical state) , Diffdot( *) ,
Details of the meaning:
If U_ is 'smc01-control', then do the following. Define surface weights Alpha as "[0.5, 0.5]". Initialise matrix Phi as a 'unit matrix'. Define J as the 'inertia matrix' of Spc01. Compute matrix J2 as the inverse of J . Compute position velocity error Ve and angular velocity error Oe from dynamical state X, guidance reference Xnow . Define the joint sliding surface G2 from the position velocity error Ve and angular velocity error Oe using the surface weights Alpha. Compute the smoothed sign function SG2 from the joint sliding surface G2 with sign threshold 0.01. Compute special dynamical force F from dynamical state X and surface weights Alpha. Execute "Diffdot=zeros(6,1);". Compute control torque T and control force U from matrix J2, surface weights Alpha, special dynamical force F , smoothed sign function SG2 and Diffdot. Finish conditional actions.
Resulting things are: T(control torque) , U(control force) .
Sentences to use: Demonstrate sliding mode control .
Details of the meaning:
Get data for spacecraft Sc01 by 'human input'. Get desired dynamical state Xd of Sc01. Define dynamical state X0 as 'current dynamical state' of Sc01. Imagine spacecraft movements XX of spacecraft Sc01 for initial dynamical state X0 and desired dynamical state Xd. Display spacecraft movements XX in 'graphs of variables'.
Sentences to use: Imagine spacecraft movements XX of spacecraft Spc01 for initial dynamical state X0 and desired dynamical state Xd .
Available things are: Spc01( spacecraft) , X0( dynamical state) , Xd( desired dynamical state) ,
Details of the meaning:
Execute "global Xdes;global Sc01;global Diffdot; Xdes=Xd;Sc01=Spc01". Define X0 as the 'current dynamical state' of Sc01. Define Tspan as the 'time horizon' of Xdes. Execute "Options=odeset('RelTol',1e-6,'AbsTol',1e-8,'InitialStep',0.025);Diffdot=zeros(6,1); [t,X]=ode11_Euler('spacecraft_state_change',Tspan,X0,Options,[]); XX.data_labels={'x','y','z','vx','vy','vz', 'q1','q2','q3','q0','ox','oy','oz'}; XX.time_dimension=t;XX.data=X;".
Resulting things are: XX(spacecraft movements) .
Sentences to use: Compute dynamical state derivative Xdot for Time , from dynamical state X with numerical Options and Flag .
Available things are: Time( scalar) , X( dynamical state) , Options( vector) , Flag( vector) ,
Details of the meaning:
Execute "global Xdes; global Sc01;global Diffdot". Compute position error Xe from desired position Xdes and dynamical state X. Compute attitude error Qe from desired position Xdes and dynamical state X . Compute guidance omega gradient Vom and guidance direction Vx from attitude error Qe and position error Xe. Concatenate Vx and Vom to get guidance reference Xnow. Use 'smc01-control' to obtain control torque T and control force U for spacecraft Sc01 from dynamical state X and guidance reference Xnow and Diffdot. Compute dynamical state derivative Xdot from dynamical state X for spacecraft Sc01 using control force U, control torque T and guidance reference Xnow.
Resulting things are: Xdot(dynamical state derivative) .
Sentences to use: Compute attitude error Qe from desired position Xdes and dynamical state X .
Available things are: Xdes( desired position) , X( dynamical state) ,
Details of the meaning:
Execute code "Qe=QuatError(X(7:10),Xdes.values(7:10));".
Resulting things are: Qe(attitude error) .
Sentences to use: Compute control torque T and control force U from matrix J2 , surface weights Alpha , special dynamical force F , smoothed sign function SG2 and Diffdot .
Available things are: J2( matrix) , Alpha( surface weights) , F( special dynamical force) , SG2( smoothed sign function) , Diffdot( *) ,
Details of the meaning:
Execute code " B=[Alpha(1)*eye(3), zeros(3,3); zeros(3,3), Alpha(2)*J2]; Uin=pinv(B)*(Diffdot-F-SG2);U=Tbound(Uin(1:3),1,0);T=Tbound(Uin(4:6),1,0);".
Resulting things are: T(control torque) , U(control force) .
Sentences to use: Compute dynamical state derivative Xdot from dynamical state X for spacecraft Sc01 using control force U , control torque T and guidance reference Xnow .
Available things are: X( dynamical state) , Sc01( spacecraft) , U( control force) , T( control torque) , Xnow( guidance reference) ,
Details of the meaning:
Let J be the 'inertia matrix' of spacecraft Sc01. Define M as the 'total mass' of Sc01. Execute code " F1= -crossM(X(11:13))*X(1:3) + X(4:6); F2= -crossM(X(11:13))*X(4:6); F3=0.5*crossMM(X(11:13))*X(7:10); F4=inv(J)*crossM(X(11:13))*J*X(11:13);F=[F1;F2;F3;F4];". Execute code " B=[zeros(3,3), zeros(3,3); (1/M)*eye(3,3), zeros(3,3); zeros(4,3), zeros(4,3); zeros(3,3), inv(J) ];". Execute code " Xdot=[F+B*[U;T]]; ".
Resulting things are: Xdot(dynamical state derivative) .
Sentences to use: Compute position velocity error Ve and angular velocity error Oe from dynamical state X , guidance reference Xnow .
Available things are: X( dynamical state) , Xnow( guidance reference) ,
Details of the meaning:
Execute "V=X(4:6,1); Vg=Xnow(1:3); Ve=V-Vg;". Execute " Om=X(11:13,1); Og=Xnow(4:6); Oe=Om-Og;".
Resulting things are: Ve(position velocity error) , Oe(angular velocity error) .
Sentences to use: Compute guidance omega gradient Vom and guidance direction Vx from attitude error Qe and position error Xe .
Available things are: Qe( attitude error) , Xe( position error) ,
Details of the meaning:
Execute "[Vx,Vom]=Potentials(Xe,Qe);".
Resulting things are: Vom(guidance omega gradient) , Vx(guidance direction) .
Sentences to use: Compute position error Xe from desired position Xdes and dynamical state X .
Available things are: Xdes( desired position) , X( dynamical state) ,
Details of the meaning:
Execute "Xe=X(1:3)-Xdes.values(1:3);".
Resulting things are: Xe(position error) .
Sentences to use: Compute special dynamical force F from dynamical state X and surface weights Alpha .
Available things are: X( dynamical state) , Alpha( surface weights) ,
Details of the meaning:
Execute " pos=X(1:3); vel=X(4:6); omega=X(11:13); F1=-crossM(omega)*pos + vel; F2=-crossM(omega)*vel; F=[Alpha(1)*F1; Alpha(2)*F2];".
Resulting things are: F(special dynamical force) .
Sentences to use: Define the joint sliding surface G2 from the position velocity error Ve and angular velocity error Oe using the surface weights Alpha .
Available things are: Ve( position velocity error) , Oe( angular velocity error) , Alpha( surface weights) ,
Details of the meaning:
Execute " G2=[Alpha(1)*Ve; Alpha(2)*Oe];".
Resulting things are: G2(joint sliding surface) .
Sentences to use: Define surface weights Alpha as "[0.5, 0.5]" .
Available things are: L_( matlab code) ,
Details of the meaning:
Execute "Alpha=L_;".
Resulting things are: Alpha(surface weights) .
Sentences to use: Forget the past . Do not remember any past objects . Forget all past objects .
Details of the meaning:
Execute "global local_memory;local_memory=cell(0,3);".
Sentences to use: Initialize dynamical guidance state X0 with matlab code "[0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0]" .
Available things are: U_( matlab code) ,
Details of the meaning:
Execute "X0=U_;".
Resulting things are: X0(dynamical guidance state) .
Sentences to use: Display spacecraft movements XX in 'graphs of variables' . Show spacecraft movements XX in 'animation' .
Available things are: XX( spacecraft movements) , U_( quote) ,
Details of the meaning:
If U_ is 'graphs of variables', then do the following. Define Label as the 'data labels' of XX. Define Mov as the 'data' of XX . Define Td as the 'time dimension' of XX. Execute code " figure; t=Td; tL=' time (s) '; subplot(311), plot(t,Mov(:,1),'-b'); xlabel(tL); ylabel(Label{1}); subplot(312), plot(t,Mov(:,2),'-r'); xlabel(tL); ylabel(Label{2}); subplot(313), plot(t,Mov(:,3),'-g'); xlabel(tL); ylabel(Label{3}); figure; subplot(411), plot(t,Mov(:,7),'-b'); xlabel(tL); ylabel(Label{7}); subplot(412), plot(t,Mov(:,8),'-r'); xlabel(tL); ylabel(Label{8}); subplot(413), plot(t,Mov(:,9),'-g'); xlabel(tL); ylabel(Label{9}); subplot(414), plot(t,Mov(:,10),'-k'); xlabel(tL); ylabel(Label{10}); ". Finish conditional actions.
Sentences to use: Get desired dynamical state Xd of spacecraft Sc01 .
Available things are: Sc01( spacecraft) ,
Details of the meaning:
Define Xd as the 'desired state' of spacecraft Sc01. Set the class of 'Xd' to 'desired dynamical state'.
Resulting things are: Xd(desired dynamical state) .
Sentences to use: Get data for spacecraft Sc01 by 'human input' .
Available things are: U_( quote) ,
Details of the meaning:
Execute " DesX=object_definition('desired dynamical state','DesX'); Sc01=object_definition('spacecraft','Sc01');". Define the 'desired state' of Sc01 by DesX.
Resulting things are: Sc01(spacecraft) .
Sentences to use: Compute matrix J2 as the inverse of J .
Available things are: J( matrix) ,
Details of the meaning:
Execute code "J2=pinv(J);".
Resulting things are: J2(matrix) .
Sentences to use: Compute the smoothed sign function SG2 from the joint sliding surface G2 with sign threshold 0.02 .
Available things are: G2( joint sliding surface) , Q_( number) ,
Details of the meaning:
Execute "Sth=Q_;SG2=SatFunc(G2,Sth);" .
Resulting things are: SG2(smoothed sign function) .
Sentences to use: Concatenate vector Vx and vector Vom to get vector Xnow .
Available things are: Vx( vector) , Vom( vector) ,
Details of the meaning:
Execute " try Xnow=[Vx;Vom];catch Xnow=[Vx,Vom];end ".
Resulting things are: Xnow(vector) .
Sentences to use: Set the class of 'Sc1' to 'spacecraft' . Define the class of 'Sc1' as 'spacecraft' .
Available things are: U1_( quote) , U2_( quote) ,
Details of the meaning:
Execute "set_object_class(U2_,U1_);".
Sentences to use: Define 'bac, cop' as global variables . Let 'bac, cop' be global variables .
Available things are: U_( quote) ,
Details of the meaning:
Execute " gv=separc(U_); for k=1:length(gv), eval(['global ',gv{k}]);end ".
Sentences to use: Define O as the 'property' of O2 . Define O by 'property' of O2 . Let O be the 'property' of O2 .
Available things are: U1_( quote) , O2( *) ,
Details of the meaning:
Execute code "O=getfield(O2,fillin(U1_));".
Resulting things are: O(*) .
Sentences to use: Let 'property' of Obj become P . Define the 'property' of Obj by P . Make P be the 'property' of Obj .
Available things are: P( *) , U1_( quote) , Obj( *) ,
Details of the meaning:
Execute code "Obj=setfield(Obj,fillin(U1_),P)".
Resulting things are: Obj(*) .
Sentences to use: Initialise matrix Phi as a 'unit matrix' .
Available things are: U_( quote) ,
Details of the meaning:
if U_ is 'unit matrix', then execute "Phi=eye(3);".
Resulting things are: Phi(matrix) .
Sentences to use: Quote Q is 'dingo' .
Available things are: Q( quote) , U_( quote) ,
Details of the meaning:
Execute code "B=strcmp(Q,U_);".
Resulting things are: B(relation Boolean) .
function MMx=crossMM(o);
MMx=[0, o(3), -o(2), o(1);
-o(3), 0, o(1), o(2);
o(2), -o(1), 0, o(3);
-o(1),-o(2), -o(3), 0];
function Qout=Euler2Quat3(angs)
Xrot=angs(1);
Yrot=angs(2);
Zrot=angs(3);
A=deg2rad(Xrot);
B=deg2rad(Yrot);
C=deg2rad(Zrot);
EulerM=[ cos(B)*cos(A), cos(B)*sin(A), -sin(B);
-cos(C)*sin(A)+sin(C)*sin(B)*cos(A), cos(C)*cos(A)+sin(C)*sin(B)*sin(A), sin(C)*cos(B);
sin(C)*sin(A)+cos(C)*sin(B)*cos(A), -sin(C)*cos(A)+cos(C)*sin(B)*sin(A), cos(C)*cos(B)];
q0=0.5*sqrt(1+EulerM(1,1)+EulerM(2,2)+EulerM(3,3));
q1=0.5*sqrt(1+EulerM(1,1)-EulerM(2,2)-EulerM(3,3));
q2=0.5*sqrt(1-EulerM(1,1)+EulerM(2,2)-EulerM(3,3));
q3=0.5*sqrt(1-EulerM(1,1)-EulerM(2,2)+EulerM(3,3));
if q0 >=q1 && q0>q2 && q0>q3
Q0=q0;
Q1=(EulerM(2,3)-EulerM(3,2))/(4*q0);
Q2=(EulerM(3,1)-EulerM(1,3))/(4*q0);
Q3=(EulerM(1,2)-EulerM(2,1))/(4*q0);
elseif q1 >=q0 && q1>q2 && q1>q3
Q1=q1;
Q2=(EulerM(1,2)+EulerM(2,1))/(4*q0);
Q3=(EulerM(1,3)+EulerM(3,1))/(4*q0);
Q0=(EulerM(2,3)+EulerM(3,2))/(4*q0);
elseif q2 >=q0 && q2>q1 && q2>q3
Q2=q2;
Q1=(EulerM(1,2)+EulerM(2,1))/(4*q0);
Q3=(EulerM(2,3)+EulerM(3,2))/(4*q0);
Q0=(EulerM(3,1)-EulerM(1,3))/(4*q0);
elseif q3 >=q0 && q3>q2 && q3>q1
Q3=q3;
Q1=(EulerM(1,3)+EulerM(3,1))/(4*q0);
Q2=(EulerM(2,3)+EulerM(3,2))/(4*q0);
Q0=(EulerM(1,2)-EulerM(2,1))/(4*q0);
end
Qout=[Q1;Q2;Q3;Q0];
function Gps = getting_gps;
Gps=[];
Gps=get_gps;
function Ss = getting_star_sensor_data;
Ss=[];
Ss=star_sensor_data;
function [t,X]=ode11_Euler(txt,Tspan,X0,Options,Xtra);
global Flag
global recentdir
dt=Options.InitialStep;
t=[0:dt:Tspan]';
X=zeros(size(t,1),length(X0));
if size(X0,1)==1, x=X0';elseif size(X0,2)==1, x=X0;else
disp('ERROR: wring initial state dimensions in ODE11_EULER');
end
X(1,:)=x';
gui_active(1);
tit='ODE solution' ;
h = progressbar( [],0,'progress in solution time',tit);
pause(0.001);
od=cd;
eval(['cd(',char(39),recentdir,char(39),');']);
for k=1:length(t)-1,
eval(['dx=ML_function(',char(39),txt,'___',char(39),',t(k+1),x,Options,Flag);']);
x=x+dt*dx;
X(k+1,:)=x';
if mod(k,10)==0,
h = progressbar( h,10/length(t) );
end
if ~gui_active, break; end
end
eval(['cd(',char(39),od,char(39),');']);
progressbar( h,-1 )
function [Vx,Vomega]=Potentials(Xe,Qe)
Xscale=norm(Xe,inf);
if Xscale==0;Xscale=eps;end
Xdir=Xe/Xscale;
Xmag=norm(Xe);
Vx=-0.05*Xdir*Xmag;
Ox=Qe(1)*Qe(4);
Oy=Qe(2)*Qe(4);
Oz=Qe(3)*Qe(4);
Vomega=0.05*[Ox;Oy;Oz];
function Qe=QuatError(Qnow,Qdes)
QT=[ Qdes(4), Qdes(3), -Qdes(2), Qdes(1);
-Qdes(3), Qdes(4), Qdes(1), Qdes(2);
Qdes(2), -Qdes(1), Qdes(4), Qdes(3);
-Qdes(1), -Qdes(2), -Qdes(3), Qdes(4)];
QS=[-Qnow(1),-Qnow(2),-Qnow(3),Qnow(4)]';
Qe=QT*QS;
function Qx=quatM(om);
Qx=0.5*[0, om(3), -om(2), om(1);
-om(3), 0, om(1), om(2);
om(2), -om(1), 0, om(3);
-om(1), -om(2), -om(3), 0];
function Sout=SatFunc(S,E)
for i=1:length(S),
if abs(S(i))>E
Sout(i,1)=sign(S(i));
elseif abs(S(i)) <= E,
Sout(i,1)=S(i)/E;
end
end
function Tout=Tbound(T,Tmax,Tmin)
for i=1:length(T)
dir=sign(T(i,1));
req=abs(T(i,1));
if req>=Tmax,call=Tmax;
elseif req
else
call=req;
end
Tout(i,1)=dir*call;
end
Ontology source text used
% ID : agent ontology
% Author : S M Veres, 29 March 2008
% ALGEBRAIC AND NUMERICAL CONCEPTS
>variable
@notation: char
@assigment: char
@domain : set
>>scalar real variable
>>scalar complex variable
>>vector variable
>>matrix variable
>set -- {1,'a',[2,3]}
@members: char
@@members: char
@members list: cell
>algebraic term
@member variables: set of char
@formula : char
@reduced form: char
>algebraic equation
@left hand side : algebraic term
@right hand side : algebraic term
@unkowns: set of variables
>>algebraic definition
@defined variable: variable
>algebraic function
@input variables: set of char
@formula: char
>numerical function
@name: char
>>m-function
@file name: char
@input variables: set of char
@output variables: set of char
>>>kernel
>text : char
>>sentence
>>string -- char(round(66+rand(1,20)*30))
@@..: size(..,1)==1
>array : double -- s=rand(10,2)
>>periodic time axis -- s=0.1*(1:1000)
@@..: min(size(..))==1 & length(size(..))==2
>>vector
>>>regressor vector
>>>classification surface
>>matrix -- rand(2,2)
@@..:min(size(..))>1
>>>symmetric matrix -- [3 1; 1 2]
>>time lagged array
>>>scalar -- s=1000*randn(1)
@@..: max(size(..))==1
>>>>learning rate -- rand(1)
@@..: ..>0
>>>>integer -- s=round(1000*randn(1))
@@..:round(..)==..
>>>>positive number -- s=round(1000*rand(1))
@@..: ..>0
>>>>nonnegative number -- s=round(1000*randn(1))
@@..: ..>=0
>>>>negative number -- s=-round(1000*randn(1))
@@..: ..<0
>>>>imaginary number -- s=sqrt(-1)*round(1000*randn(1))
@@..: imag(..)~=0 & real(..)==0
>>>>complex number -- s=round(1000*randn(1))+sqrt(-1)*round(1000*randn(1))
@@..: imag(..)~=0
>>>>real number -- s=-round(1000*randn(1))
@@..: imag(..)~=0
>time period : physical quantity
>quaternion: vector
>unit matrix : matrix
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% SPACECRAFT SPECIFIC CONCEPTS
>spacecraft : physical object
@coordinate frames : set of char
@inertia matrix : matrix
@inertia matrix dimension: char
@total mass : double
@current dynamical state : dynamical state
@desired state: desired dynamical state
>spacecraft movements
@time axis : double
@rotations : set of quaternions
@translation : set of vectors
>desired attitude
@dimension : {'Euler angles', 'quaternion'}
@values : vector
@reference frame : char
>desired dynamical state
@dimensions: set of char
@values : vector
@reference frame : char
@time horizon: double
>attitude error
@dimension : {'Euler angles', 'quaternion'}
@values : vector
@reference frame : char
>desired position
@dimension : {'km','m','mm'}
@values : vector
@reference frame : char
>position error
@dimension : {'km','m','mm'}
@values : vector
@reference frame : char
>guidance omega gradient : vector
>guidance direction : vector
>guidance reference : vector
>dynamical state: vector
>dynamical state derivative: vector
>dynamical guidance state : vector
>surface weights : vector
>joint sliding surface : vector
>smoothed sign function : vector
>position velocity : vector
>position velocity error : vector
>angular velocity : vector
>angular velocity error : vector
>special dynamical force : matrix
>sign threshold : scalar
>control torque : vector
>control force : vector
>spacecaft movements
@craft name: char
@data : double
@data labels : set of char
@time dimension: {'s','h','ms'}
@data dimensions: set of char