aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Part 1/error_script.m2
1 files changed, 2 insertions, 0 deletions
diff --git a/Part 1/error_script.m b/Part 1/error_script.m
index 43f8dda..5c2514e 100644
--- a/Part 1/error_script.m
+++ b/Part 1/error_script.m
@@ -19,6 +19,8 @@ vout = vin(t) - iout * R;
%obtaining the exact solution with favorite method
exact= @(t) 0.07553*cos( 41883.7*(t) ) + 0.94901*sin( 41883.7*(t) ); % works for arrays
+%exact = Vin0 - R*((Vin0/R) * (1 - exp(-(R/L)*ta))); %Vin0 is the initial value of Vin, ta is the value of t
+
%error as a function of t
error = @(t) exact(t) -vout;