aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsupercalvinchan <cc6815@ic.ac.uk>2017-03-13 10:44:19 +0000
committerGitHub <noreply@github.com>2017-03-13 10:44:19 +0000
commit09671855cda153b0e6ee5cba5cf07099b53995b6 (patch)
treecfbee872993f261ca3e02467e4f4f788fac254cd
parent2645c2a2de5adbc4370abd8b2b23d3589ccf2367 (diff)
downloadNumericalAnalysis-09671855cda153b0e6ee5cba5cf07099b53995b6.tar.gz
NumericalAnalysis-09671855cda153b0e6ee5cba5cf07099b53995b6.zip
Update error_script.m
-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;