how can I get a model from system identification toolbox for three tank system

4 visualizzazioni (ultimi 30 giorni)
I want to get different models for three tank system imagining that it is a blackbox system as input we have 2 step signals which represent 2 waterflows to thtee tank system and h1 h2 h3 are the heights of the system which are out put of the system . my question is how i should apply these parameters to toolbox system identification to get the models . the problem is the input is signal which is time domain and h1 h2 h3 are 3 different value it means 3 outputs in the same time how i must apply the data to get models ?

Risposte (1)

Shubham
Shubham il 23 Ago 2024
Hi Tannaz,
To model a three-tank system as a black-box system using the System Identification Toolbox in MATLAB, you need to prepare your input-output data properly and then use the toolbox to estimate a model that fits your data. Here's a step-by-step guide on how to achieve this:
Step 1: Prepare Your Data
  1. You have two input signals representing water flows into the system. These should be organized as a matrix where each column represents a different input signal.
  2. You have three output signals representing the heights ( h_1, h_2, ) and ( h_3 ). These should also be organized as a matrix where each column represents a different output signal.
  3. Ensure you have a time vector that corresponds to your input and output data. This is especially important if your data is not sampled at regular intervals.
Here's a basic example of how your data might be structured in MATLAB:
% Example data
time = (0:0.1:10)'; % Time vector
u1 = stepfun(time, 2); % Example step input 1
u2 = stepfun(time, 5); % Example step input 2
h1 = rand(length(time), 1); % Example output 1
h2 = rand(length(time), 1); % Example output 2
h3 = rand(length(time), 1); % Example output 3
% Input matrix
U = [u1, u2];
% Output matrix
Y = [h1, h2, h3];
Step 2: Create an iddata Object
The iddata object in MATLAB is used to store input-output data for system identification.
% Create iddata object
data = iddata(Y, U, 0.1); % 0.1 is the sample time
Step 3: Choose a Model Structure
You can choose from several model structures, such as:
  • ARX (AutoRegressive with eXogenous inputs): Simple and fast to estimate.
  • State-Space Models: More flexible and can handle multiple inputs and outputs.
  • Transfer Function Models: Useful if you have some insight into the system dynamics.
  • For a multi-input multi-output (MIMO) system like yours, state-space models are often a good choice.
Step 4: Estimate the Model
Use the ssest function to estimate a state-space model:
% Estimate a state-space model
model = ssest(data, 3); % The number 3 is an initial guess for the number of states
Step 5: Validate the Model
After estimating the model, validate it by comparing the model's output to the measured data:
% Compare the model output to the actual data
compare(data, model);
Step 6: Refine the Model
  • Adjust Model Order: If the model doesn't fit well, try adjusting the model order (number of states).
  • Try Different Structures: Experiment with different model types (e.g., ARX, transfer function) to see which fits best.
  • Cross-Validation: Use a portion of your data for validation to ensure the model generalizes well.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by