how to create an discrete equation

34 Ansichten (letzte 30 Tage)
Seungil Oh
Seungil Oh am 5 Aug. 2020
Beantwortet: Surya Talluri am 10 Aug. 2020
my question is how to creat discrete equations, calculate them and put the created discrete equations in each other such that i get an final diskrete equation
For example:
I. y_1(k) = a*y_1(k-1)+b*x_1(k-1)
II. y_2(k) = c*y_2(k-1) + d*y_1(k-1)
Final equation: y_2(k) = c*y_2(k-1) + d*a*y_1(k-2) + d*b*x_1(k-2)
** The values of x_1, i can get from the data set x_1 and for k = 1, y_1(k-1) = 0
** I would like to realize it into "sym".
thank you in advance

Antworten (1)

Surya Talluri
Surya Talluri am 10 Aug. 2020
I understand that you want to create discrete functions using Symbolic Math Toolbox. You can implement it by creating symbolic functions x_1(k), y_1(k), y_2(k)
syms a b c d x_1(k) y_1(k) y_2(k)
y_1(k) = a*y_1(k-1)+b*x_1(k-1);
y_2(k) = c*y_2(k-1) + d*y_1(k-1);
y_2(k)
ans =
c*y_2(k - 1) + d*(a*y_1(k - 2) + b*x_1(k - 2))
For replacing x_1 values, you can use “subs” function.
You can refer to following documentation for further understanding:

Kategorien

Mehr zu Formula Manipulation and Simplification finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by