From a33cb1e6d822c8375d3ae383790e420b6b35a536 Mon Sep 17 00:00:00 2001
From: "corentin.cotture" <corentin.cotture@etu.hesge.ch>
Date: Tue, 23 May 2023 20:06:57 +0200
Subject: [PATCH] =?UTF-8?q?ajout=20de=20commentaire=20pour=20la=20compr?=
 =?UTF-8?q?=C3=A9hension?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 circuit_rc.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/circuit_rc.c b/circuit_rc.c
index 3c08a25..46bd0b1 100644
--- a/circuit_rc.c
+++ b/circuit_rc.c
@@ -1,14 +1,26 @@
 #include "circuit_rc.h"
 
+// Signal à filtrer
+float v_t (float t) {
+    return t;
+}
 
-float vc_t(float t) {
+
+float vc_attendu(float t) {
     return Vo - exp(-t / (R * C));
 }
 
-float v_t (float t) {
-    return t;
+// Théoriquement mieux et plus juste
+float vc_t_new(float t, float old_vc) {
+    return vc_t(t) + delta_t * (v_t(t) - vc_t(t)) / (R * C);
+}
+
+// le résultat attendu
+float vc_t(float t) {
+    return Vo - exp(-t / (R * C));
 }
 
+// ce qu'on a fait pendant le cours, 
 float circuit_rc(float t) {
     return vc_t(t) + delta_t * (v_t(t) - vc_t(t)) / (R * C);
 }
@@ -17,4 +29,4 @@ int main() {
 // int main(int argc, char *argv[]) {
     printf("Circuit RC\n");
     return 0;
-}
\ No newline at end of file
+}
-- 
GitLab