From 6095813c085db0573716accb71e864ed50490aa4 Mon Sep 17 00:00:00 2001 From: "[LucianoS]" <[savoieluciano@gmail.com]> Date: Thu, 25 Jun 2020 19:59:57 -0300 Subject: [PATCH 1/8] docs --- identification_methods.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/identification_methods.m b/identification_methods.m index be48fb2..1464085 100644 --- a/identification_methods.m +++ b/identification_methods.m @@ -1,4 +1,4 @@ -% Ejercicio 1 +% Ejercicio 1 - Cambio acá para no hacer cambios clear; close all; clc %% Apartado A From bf63d9587aedd228b84a1e5ab4e6b20ec7c641c5 Mon Sep 17 00:00:00 2001 From: kps-dot Date: Thu, 25 Jun 2020 20:05:54 -0300 Subject: [PATCH 2/8] generar paquetes se agraga funcion para generar paquetes --- identification_methods.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/identification_methods.m b/identification_methods.m index be48fb2..3ca8bfd 100644 --- a/identification_methods.m +++ b/identification_methods.m @@ -61,7 +61,7 @@ %# INPUT output_signal (double-sym) la señal de salida %# INPUT sample_time (double) tiempo de muestreo %# OUTPUT [data_ident(iddata), data_validation(iddata)] - +%Estoy haciendo un cambiogit end function Gzi = discrete_ident_arx(data, Ts, focus_mode, na, nb, nk, residual_analysis) @@ -90,7 +90,7 @@ %# OUTPUT Gzi_mc(tf): función de transferencia identificada end - +%XXXXXXXXXXXZXZXXXXXXXXXXXXXXX function analyze_residuals(data, sys_id, sampling_frequency) %#ANALYZE_RESIDUALS análisis de residuos y plot %# @@ -101,6 +101,7 @@ function analyze_residuals(data, sys_id, sampling_frequency) end + function validate_identifications(data, Gzi, Gzi_mc) %#VALIDATE_IDENTIFICATIONS %# From 2937170ed17fce0a91090b77fe8e42976816acc4 Mon Sep 17 00:00:00 2001 From: kps-dot Date: Wed, 1 Jul 2020 10:37:24 -0300 Subject: [PATCH 3/8] modificacion generar paquetes --- identification_methods.m | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/identification_methods.m b/identification_methods.m index df5049f..f80aa34 100644 --- a/identification_methods.m +++ b/identification_methods.m @@ -1,4 +1,4 @@ -% Ejercicio 1 - Cambio acá para no hacer cambios +% Ejercicio 1 clear; close all; clc %% Apartado A @@ -54,14 +54,14 @@ end function [data_ident, data_validation] = generate_ident_package(input_signal, output_signal, sample_time, ident_proportion, plot_package) - %#GENERATE_IDENT_PACKAGE arma e imprime el paquete de datos - %# - %# SYNOPSIS generate_ident_package(input_signal, output_signal, sample_time, ident_proportion, plot_package) - %# INPUT input_signal: (double-sym) la señal de entrada - %# INPUT output_signal (double-sym) la señal de salida - %# INPUT sample_time (double) tiempo de muestreo - %# OUTPUT [data_ident(iddata), data_validation(iddata)] -%Estoy haciendo un cambiogit + GENERATE_IDENT_PACKAGE arma e imprime el paquete de datos + + SYNOPSIS generate_ident_package(input_signal, output_signal, sample_time, ident_proportion, plot_package) + INPUT input_signal: (double-sym) la señal de entrada + INPUT output_signal (double-sym) la señal de salida + INPUT sample_time (double) tiempo de muestreo + OUTPUT [data_ident(iddata), data_validation(iddata)] + end function Gzi = discrete_ident_arx(data, Ts, focus_mode, na, nb, nk, residual_analysis) @@ -90,7 +90,7 @@ %# OUTPUT Gzi_mc(tf): función de transferencia identificada end -%XXXXXXXXXXXZXZXXXXXXXXXXXXXXX + function analyze_residuals(data, sys_id, sampling_frequency) %#ANALYZE_RESIDUALS análisis de residuos y plot %# From c93a1bd864354cb69d637fc9a40b31494c877186 Mon Sep 17 00:00:00 2001 From: paulaolmedo Date: Thu, 25 Jun 2020 19:33:43 -0300 Subject: [PATCH 4/8] :sparkles: se agrega .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fee458a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +#Archivos temporales de matlab +*.m~ From a8403ad2309681033828d2f52ddbbdd7f1875d6f Mon Sep 17 00:00:00 2001 From: fernando Date: Wed, 1 Jul 2020 10:46:39 -0300 Subject: [PATCH 5/8] :sparkles: generar paquetes de identificacion --- identification_methods.m | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/identification_methods.m b/identification_methods.m index f80aa34..38737d6 100644 --- a/identification_methods.m +++ b/identification_methods.m @@ -54,14 +54,13 @@ end function [data_ident, data_validation] = generate_ident_package(input_signal, output_signal, sample_time, ident_proportion, plot_package) - GENERATE_IDENT_PACKAGE arma e imprime el paquete de datos - - SYNOPSIS generate_ident_package(input_signal, output_signal, sample_time, ident_proportion, plot_package) - INPUT input_signal: (double-sym) la señal de entrada - INPUT output_signal (double-sym) la señal de salida - INPUT sample_time (double) tiempo de muestreo - OUTPUT [data_ident(iddata), data_validation(iddata)] - + %#GENERATE_IDENT_PACKAGE arma e imprime el paquete de datos + %# + %# SYNOPSIS generate_ident_package(input_signal, output_signal, sample_time, ident_proportion, plot_package) + %# INPUT input_signal: (double-sym) la señal de entrada + %# INPUT output_signal (double-sym) la señal de salida + %# INPUT sample_time (double) tiempo de muestreo + %# OUTPUT [data_ident(iddata), data_validation(iddata)] end function Gzi = discrete_ident_arx(data, Ts, focus_mode, na, nb, nk, residual_analysis) @@ -88,7 +87,22 @@ INPUT sample_time (double) tiempo de muestreo %# INPUT Ts(double): tiempo de muestreo %# INPUT plot_ident(logical): opción de plotear la identificación %# OUTPUT Gzi_mc(tf): función de transferencia identificada - + + N1=plot_ident; + + n = 3; + u = data.InputData; + y = data.OutputData; + Theta = zeros(4, N1); + P = 1e12*eye(4); + + for k = n:N1-1 + Phi = [-y(k-1) -y(k-2) u(k-1) u(k-2)]; + K = P*Phi'/(1+(Phi*P*Phi')); + Theta(:,k+1) = Theta(:,k)+K*(y(k)-Phi*Theta(:,k)); + P = P-(K*Phi*P); + end + Gzi_mc = tf(Theta(3:4,N1)', [1 Theta(1:2,N1)'], Ts) end function analyze_residuals(data, sys_id, sampling_frequency) From 2b508127a137ae4f4aabdaa1985f9d83263dba66 Mon Sep 17 00:00:00 2001 From: fernando Date: Wed, 1 Jul 2020 10:48:40 -0300 Subject: [PATCH 6/8] --- identification_methods.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/identification_methods.m b/identification_methods.m index 38737d6..ee0d7ea 100644 --- a/identification_methods.m +++ b/identification_methods.m @@ -89,7 +89,7 @@ %# OUTPUT Gzi_mc(tf): función de transferencia identificada N1=plot_ident; - + %prueba n = 3; u = data.InputData; y = data.OutputData; From 35501d76b48855865bd16278beac755c609e9e37 Mon Sep 17 00:00:00 2001 From: eduardoadam Date: Thu, 25 Jun 2020 19:52:56 -0300 Subject: [PATCH 7/8] =?UTF-8?q?agregue=20la=20suma=20de=20un=20ruido=20bla?= =?UTF-8?q?nco=20en=20la=20funci=C3=B3n=20add=5Fwhite=5Fnoise=5Fto=5Ffunc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- identification_methods.m | 1 + 1 file changed, 1 insertion(+) diff --git a/identification_methods.m b/identification_methods.m index ee0d7ea..eced200 100644 --- a/identification_methods.m +++ b/identification_methods.m @@ -50,6 +50,7 @@ %# OUTPUT noisy (simbólico) señal con ruido agregado %# + noiseSignal = awgn (clean_signal, snr) end From 213742087a27b0aedf96c22b7b55a29331e21aaa Mon Sep 17 00:00:00 2001 From: kps-dot Date: Wed, 1 Jul 2020 10:48:19 -0300 Subject: [PATCH 8/8] :sparkles: se arma paquete --- identification_methods.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/identification_methods.m b/identification_methods.m index eced200..583328d 100644 --- a/identification_methods.m +++ b/identification_methods.m @@ -36,7 +36,6 @@ %% Identifico por minimos cuadrados en forma recursiva plot_ident = true; Gzi_mc = discrete_ident_recursive_least_squares(data_ident, Ts, plot_ident) - %% Validacion de resultados validate_identifications(data_test, Gzi, Gzi_mc) @@ -62,6 +61,11 @@ %# INPUT output_signal (double-sym) la señal de salida %# INPUT sample_time (double) tiempo de muestreo %# OUTPUT [data_ident(iddata), data_validation(iddata)] +% Armo el paquete de datos +N1 = floor(N/2); +data = iddata(y, u, Ts); +data_ident = data(1:N1); +data_test = data(N1+1:N); end function Gzi = discrete_ident_arx(data, Ts, focus_mode, na, nb, nk, residual_analysis)