Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

% Open - Loop Fault Detection, Isolation and Recovery System % % INITIAL SEGMENT % clear all % Define model parameters U 0 = 3

% Open-Loop Fault Detection, Isolation and Recovery System
%
%INITIAL SEGMENT
%
clear all
% Define model parameters
U0=30; % m/s
delta_r_max =60* pi /180; % Maximum rudder deflection (rad)
delta_r_rate_max =30* pi /180; % Maximum rudder rate limit (rad)
%fault_time =30; % Time at which the stepwise fault occurs
%fault_value =20* pi/180; % Fault value to be added to the measurement
%fault_time =20; % Time at which the driftwise fault occurs
%fault_value =0.5* pi/180; % Fault value to be added to the measurement
% Initial Conditions of all inputs, states, and state derivatives
u =[0,0.43625]'; % Define Initial Simulation Input
x =[0,0,0,0,0]'; % Define Initial Model States
xdot =[0,0,0,0,0]'; % Define Initial Model State Derivatives
% Define parameters for the simulation
stepsize =0.01; % Simulation step size
comminterval =0.1; % Communications interval
EndTime =100; % Simulation End Time
i =0; % Initialize counter for data storage
% END OF INITIAL SEGMENT - all parameters initialized
% DYNAMIC SEGMENT
%
for time =0:stepsize:EndTime
% STORAGE SECTION
% Store time, state, and state derivative data every communication interval
if rem(time, comminterval)==0
i = i +1; % Increment counter
tout(i)= time; % Store time
xout(i, :) = x; % Store states
xdout(i, :) = xdot; % Store state derivatives
uout(i, :) = u; % Store input
end
% End of STORAGE SECTION
% CONTROL SECTION
u(1)=0;
if x(5)>0.43625% If heading is greater than 25\deg , set rudder deflection to -25\deg
% u(2)=-0.43625;
u(2)= u(2)- delta_r_rate_max * stepsize;
if u(2)<-0.43625
u(2)=-0.43625;
end
elseif x(5)<-0.43625% Otherwise, set rudder deflection to +25\deg
% u(2)=0.43625;
u(2)= u(2)+ delta_r_rate_max * stepsize;
if u(2)>0.43625
u(2)=0.43625;
end
else
u(2)= u(2);
end
% Apply stepwise fault to the sensor measurement
%if time == fault_time
%x(5)= x(5)+ fault_value;
%end
% Apply driftwise fault to the sensor measurement
%if time >= fault_time
%x(5)= x(5)+ fault_value;
%end
% Apply stepwise fault to the rudder measurement
%if time == fault_time
%u(2)= u(2)+ fault_value;
%end
% Apply driftwise fault to the rudder measurement
%if time >= fault_time
%u(2)= u(2)+ fault_value;
%end
% DERIVATIVE SECTION
xdot = FDIRModel(x, u);
% INTEGRATION SECTION
x = rk4int('FDIRModel', stepsize, x, u); % Fourth Order Runge-Kutta
end
% END OF DYNAMIC SEGMENT
Given the above MATLAB scripts, Develop a kalman filter algorithm in MATLAB script to analyze the system's behaviour to determine when and
where these faults occur during the Open-Loop25\deg /-25\deg zig-zag manoeuvre

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago