diff options
author | supercalvinchan <cc6815@ic.ac.uk> | 2017-03-13 13:05:53 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-13 13:05:53 +0000 |
commit | 55fa9d66cd8993b4e76122d3df4ef42685285770 (patch) | |
tree | d3bd08030885a15c59190c7a4229260cce1658fa | |
parent | 2ebe4bcbfd1b53169cec5c0035e7bed6570a96f4 (diff) | |
download | NumericalAnalysis-55fa9d66cd8993b4e76122d3df4ef42685285770.tar.gz NumericalAnalysis-55fa9d66cd8993b4e76122d3df4ef42685285770.zip |
Update error_script_heun.m
-rw-r--r-- | Part 1/error_script_heun.m | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Part 1/error_script_heun.m b/Part 1/error_script_heun.m index 2aeae88..8c0f49f 100644 --- a/Part 1/error_script_heun.m +++ b/Part 1/error_script_heun.m @@ -18,7 +18,7 @@ func = @(t, iout) (vin(t) - iout*R) / L; % define func vout = vin(t) - iout * R;
%obtaining the exact solution with favorite method
-i_{Exact} = g*(w*sin(w*t) + k*cos(w*t) - k*exp(-k*t))/(w^2 + k^2);
+i_{Exact} = (V_{initial_in}/L)*((2*pi)/T * sin((2*pi)/T*t) + (R/L)*cos((2*pi)/T*t) - (R/L)*exp(-(R/L)*t))/((2*pi)/T^2 + (R/L)^2);
exact = vin(t) - R*i_{Exact};
%error as a function of t
error= exact - vout;
|