Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Lab no 12: Curve fitting

Abstract

This lab report investigates the application of curve fitting in Simulink to identify the transfer
function of a linear control system. The report details the steps involved in generating system
responses using Simulink, extracting data points, and employing curve fitting techniques to
obtain the system's transfer function.

1. Introduction

Identifying the transfer function of a linear control system is crucial for analysis, design, and
control purposes. This lab report explores curve fitting techniques in Simulink to estimate the
transfer function of a system from its input-output response data. Simulink, a graphical
programming environment for modeling and simulating dynamic systems, provides tools for
generating system responses and data extraction. Curve fitting algorithms are then used to
find the mathematical equation that best represents the system's behavior.

2. System Description

(Replace this section with a description of the specific linear control system you investigated.
This could be a simple RC circuit, a motor model, or any other system representable by a
linear transfer function.)

3. Simulink Model Development

3.1 System Modeling

 Create a Simulink model representing the chosen linear control system. This can
involve using blocks like resistors, capacitors, inductors, motors, etc., depending on
the system under investigation.
 Implement an appropriate input signal (e.g., step input, sinusoidal input) to excite the
system and generate a measurable output response.

3.2 Data Acquisition

 Include blocks within the Simulink model to capture the system's input and output
signals. Commonly used blocks for this purpose are "Step" and "Scope" blocks.
 Configure the simulation parameters (simulation time, solver options) to obtain a
sufficient amount of data points for accurate curve fitting.

4. Curve Fitting Techniques

4.1 Data Extraction


 Once the simulation is complete, extract the input and output data points from the
Simulink model. Tools like "To Workspace" blocks or data export options can be
used to capture the data points.

4.2 Curve Fitting Algorithm Selection

 Choose an appropriate curve fitting algorithm based on the characteristics of the


system and the expected transfer function type (e.g., first-order, second-order).
Common choices include:
o Linear Regression: For fitting data to a straight line, suitable for first-order
systems.
o Rational Transfer Function Fitting: For fitting data to a transfer function
model (numerator and denominator polynomials), applicable to more complex
systems.

4.3 Curve Fitting Implementation

 Utilize MATLAB's curve fitting toolbox or other relevant software tools to perform
the chosen curve fitting algorithm on the extracted data points.
 The fitting process typically involves specifying the model function (e.g., linear
equation, transfer function) and adjusting its parameters to minimize the error
between the fitted curve and the actual data points.

TASK 1:
%The plot in SIMULINK is as following:
open_system('Lab12LCS')
plot(Output)
Task 2:
open_system('Lab12SS')
plot(StateSpaceOutput)
Transfer function step response method
5. Analysis and Results

5.1 Obtained Transfer Function

 The curve fitting process will provide an estimated transfer function in the form of a
mathematical equation. This equation represents the relationship between the system's
input and output in the Laplace domain.

5.2 Comparison with Theoretical Model

 If a theoretical transfer function for the system exists (e.g., derived from first
principles), compare the obtained transfer function from curve fitting with the
theoretical model. Analyze the discrepancies and potential sources of error.

5.3 Validation

 Simulate the obtained transfer function model in Simulink and compare its output
response to the original system's response. This provides a visual verification of the
accuracy of the curve-fitted model.

6. Conclusion
This lab report has demonstrated the effectiveness of curve fitting techniques in Simulink for
identifying the transfer function of a linear control system. By generating system responses,
extracting data points, and employing appropriate curve fitting algorithms, we were able to
obtain an estimated transfer function for the chosen system. This approach provides a
valuable tool for system identification, particularly when theoretical models are unavailable
or difficult to derive.

You might also like