0% found this document useful (0 votes)
5 views7 pages

LB1 en

The document outlines the process of solving third-order differential equations using Laplace transforms, detailing the steps for deriving transfer functions and analyzing solutions. It includes references to various MATLAB resources and textbooks, as well as specific tasks to be completed using MATLAB code for practical analysis. Additionally, it emphasizes the importance of initial conditions and the impact of parameter changes on the system's response.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views7 pages

LB1 en

The document outlines the process of solving third-order differential equations using Laplace transforms, detailing the steps for deriving transfer functions and analyzing solutions. It includes references to various MATLAB resources and textbooks, as well as specific tasks to be completed using MATLAB code for practical analysis. Additionally, it emphasizes the importance of initial conditions and the impact of parameter changes on the system's response.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Очистить все предыдущие результаты

clc,clear;

1. Li, Guoyong, ed. 2012. Computer Simulation Technology and CAD: Control Systems Based
on MATLAB. 3rd ed. Deputy edited by Cheng Yongqiang. Beijing: Publishing House of
Electronics Industry. [Chapter 1, 6, 9]
2. Wang, Haiying, Shuangquan Li, and Yu Guan. 2019. MATLAB Simulation and Design of
Control Systems. 2nd ed. Beijing: Higher Education Press.[Chapter 1, 6, 7, 8]
3. Xia, D., & Weng, Y. (2012). Automatic control theory (4th ed.). China Machine Press.
[Chapter 1, 2]
4. Smith C. A., Corripio A. B. Principles and practices of automatic process control. – John
wiley & sons, 2005. [Chapter 2]
5. MathWorks Matlab official documentation page:
https://www.mathworks.com/help/matlab/index.html

Solving a third-order differential equation using Laplace transform.

This equation relates the unknown function ( y(t) ) and the known signal ( x(t) ) with a third variable
( t ) (typically representing time dependence for both variables [8]).

Equation (2.1) can be linear or nonlinear. However, analyzing differential equations with nonlinear
variables [1,2] involves significant computational complexity. For most real-world systems, Equation
(2.1) is nonlinear, complicating further analysis. To simplify systems with nonlinear dependencies,
linearization [3, 4] is applied, converting nonlinear analysis to linear. Thus, a challenging nonlinear
equation is replaced by a linear one within a small time interval. This is achieved by representing
input and output signals as Taylor series [4], resulting in the following system of differential
equations:
where x(t) and y(t) are the system's input and output quantities; ai, bi are coefficients. Equation (2.2)
establishes the relationship between input and output quantities. The coefficients of the differential
equation are parameters dependent on physical constants such as capacitance, inductance, mass,
thermal capacity, etc.

The primary tool for working with transfer functions described by differential equations (2.2) is the
Laplace transform [3,4]. Applying the Laplace transform simplifies the evaluation of the equation’s
roots (2.2) (including formulas presented below, which are the most common in this course).

The algorithm for deriving the system’s transfer function is as follows:

Step 1. Formulating and Solving the Characteristic Equation

Perform the Laplace transform according to [3,4] to obtain the characteristic equation of the system’s
transfer function.

Another form of writing linear equations of links iswriting using a transfer function. Equation (1-5)
takes the form:

or

where

For a fourth-order differential equation, the characteristic equation may take this form (roots vary
based on parameters):
where two roots are complex conjugate, say, and , and the other two roots
are valid, let them be and .

(roots are chosen randomly and can differ from equation to equation).

The general solution (after inverse Laplace transform) is:

where C1, C2, C3, and C4 are arbitrary constants.

Step 2: Getting into real shape

For the convenience of working with the solution, we will express it in terms of real functions. We use
the Euler formula:

Then

Step 3: Representation of the solution in terms of hyperbolic functionsLet's write the solution
in terms of hyperbolic functions:

Let's combine the complex parts:

Let's denote the new constants:

Then:
where A, B, C3, and C4 are arbitrary constans and are parameters depending on the roots of the
characteristic equation.

After performing the inverse transformation for each component, we assemble the complete solution:

Solve and analyze a third-order differential equation (Fig. 3.1) using individual data from Section 5
and complete the following tasks:

1. Find the solution with coefficients from table 5.1. (by variant) under initial conditions.
2. Plot the resulting function.
3. Decreasing coefficient a1 by D = 0.5, obtain multiple solutions, and plot them on a single
graph (minimum 5 trials).
4. Explain the results in terms of changes to the roots of the characteristic equation.
5. Solve the original equation under non-zero initial conditions and analyze the changes in
solution plots.

Fig. 3.1. Original third-order differential equation

where y is the Heaviside step function (1(t)) [3,4].

For a second-order differential equation, complete tasks from Section 3.1

(Heaviside function), k =100, , ,


Starting with the numerical data defining in MATLAB Workspace:

k = 100;
a0 = 2;
a1 = 5;
a2 = 8;

Use symbolic calculation with syms [5] to define variable s:

syms s complex dx_0 x_0

Perform transition from the original to the Laplace domain according to the theory in Section 2.

Write the equation in MATLAB code format and assign it to the variable eqn.

eqn = a0*s^2+a1*s+a2 == k/s

CHarachteristic equation is formed using left side of eqn multiplied by s

character_eqn = lhs(eqn)*s

Formulate the equation in Laplace domain and solve using solve [5]

res = solve(character_eqn,s);

Record the results in numerical format in the variable s_roots:

s_roots = double(vpa(res))

In this case, we will write the general solution of the differential equation according to the theory
discussed in section 2, simultaneously transitioning from the image to the original form, first in the
general form, and then we will define it in code in the variable y:

A*exp(a*t)*cos(b*t) + B*exp(a*t)*sin(b*t) + C*exp(a*t)

Next, it is necessary to solve the system of equations for zero initial conditions and find the
coefficients A, B, and C. In this case: . Apply zero initial
conditions and find derivatives using "diff" [5]

syms A B C t

y = A*exp(real(s_roots(2))*t)*cos(imag(s_roots(2))*t) + ...
B*exp(real(s_roots(3))*t)*sin(imag(s_roots(3))*t) + ...
C*exp(real(s_roots(1))*t)
eq1 = y == 0;
eq2 = diff(y,t) == 0;
eq3 = diff(diff(y,t)) == 0;
abc_vals = solve(eq1, eq2, eq3, [A,B,C])
double(subs(abc_vals.A, t, 0))
double(subs(abc_vals.B, t, 0))
double(subs(abc_vals.C, t, 0))

Result equation

subs(y, [A,B,C], [abc_vals.A,abc_vals.B,abc_vals.C])

Solution check using built-in Matlab function ilaplace [5] with default zero conditions

Y_s = rhs(eqn)/lhs(eqn)
ilaplace(Y_s)

Indeed, in this case, if all initial conditions are set to zero, the signal will ultimately equal zero.
However, if we assign some random values to the initial conditions of the signal at the initial moment
in time, it indicates that the signal had a certain magnitude at the outset, and a transient process was
taking place:

eq1 = y == 1;
eq2 = diff(y,t) == 2;
eq3 = diff(diff(y,t)) == 3;
abc_vals = solve(eq1, eq2, eq3, [A,B,C])

Let's assign the values of the obtained constants A, B, and C to the variables

A_calc = double(subs(abc_vals.A, t, 0))


B_calc = double(subs(abc_vals.B, t, 0))
C_calc = double(subs(abc_vals.C, t, 0))
We will then derive the final function that describes the transient process, which we will plot in the
time interval from 0 to 2 seconds with a step size of 0.1 seconds.

t_interval = 0:0.1:2;
y_res = zeros(length(t_interval),1);
for i = 1:length(t_interval)
y_res(i) =
A_calc*exp(real(s_roots(2))*t_interval(i))*cos(imag(s_roots(2))*t_interva
l(i)) + ...

B_calc*exp(real(s_roots(3))*t_interval(i))*sin(imag(s_roots(3))*t_interva
l(i)) + ...
C_calc*exp(real(s_roots(1))*t_interval(i));
end
plot(t_interval, y_res)

The graph clearly illustrates the system's response, as described by the equation, to a unit step
signal of the Heaviside function applied at the initial moment of time.

Groups:

 Group 23210304/23210305: Variants 1–45.


 Group 23210305/23210306: Variants 46–90

Initial coefficients for the equation in fig.3.1. for each fariant is given in Data.xlsx.

% место для кода программы

 Objective of work;
 Completion of tasks from Section 3 using individual date from Section 5;
 Conclusion summarizing the results and analysis of tasks from Section 3.

Report example is given in Example.docx.

You might also like