diff options
author | Prashant S | 2019-10-04 12:27:32 +0530 |
---|---|---|
committer | GitHub | 2019-10-04 12:27:32 +0530 |
commit | ac2986488a9731cff5cbb517d8f0ef98e2561d64 (patch) | |
tree | 7bb3f64824627ef179d5f341266a664fd0b69011 /Numerical_Methods_by_E_Balaguruswamy/CH12/EX12.6/Ex12_6.R | |
parent | cbb2770fb2f88246175add29623103a56ba338b8 (diff) | |
parent | b3f3a8ecd454359a2e992161844f2fb599f8238a (diff) | |
download | R_TBC_Uploads-master.tar.gz R_TBC_Uploads-master.tar.bz2 R_TBC_Uploads-master.zip |
Added R TBC
Diffstat (limited to 'Numerical_Methods_by_E_Balaguruswamy/CH12/EX12.6/Ex12_6.R')
-rw-r--r-- | Numerical_Methods_by_E_Balaguruswamy/CH12/EX12.6/Ex12_6.R | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Numerical_Methods_by_E_Balaguruswamy/CH12/EX12.6/Ex12_6.R b/Numerical_Methods_by_E_Balaguruswamy/CH12/EX12.6/Ex12_6.R new file mode 100644 index 00000000..c2fa7c5e --- /dev/null +++ b/Numerical_Methods_by_E_Balaguruswamy/CH12/EX12.6/Ex12_6.R @@ -0,0 +1,20 @@ +# Example 6 Chapter 12 Page no.: 387
+#Boole's five point Formula
+
+#Given function
+f <- function(x){
+ sqrt(sin(x))
+}
+
+a1 <- 0
+b1 <- pi/2
+h1 <- (b1-a1)/4 #Since there are 5 sampling points the value of n is 4
+
+# Boole's function
+
+Bl <- function(a,b,h){
+ return(((2*h)/45)*((7*f(a))+(7*f(b))+(32*f(a+h))+(12*f(a+(2*h)))+(32*f(a+(3*h)))))
+}
+
+BL1 <- Bl(a1,b1,h1)
+cat("The Boole integrant value of sqrt(sin(x)) between 0 and pi/2 is", signif(BL1, digits = 6))
\ No newline at end of file |