summaryrefslogtreecommitdiff
path: root/Numerical_Methods_by_E_Balaguruswamy/CH12/EX12.6/Ex12_6.R
diff options
context:
space:
mode:
authorPrashant S2019-10-04 12:27:32 +0530
committerGitHub2019-10-04 12:27:32 +0530
commitac2986488a9731cff5cbb517d8f0ef98e2561d64 (patch)
tree7bb3f64824627ef179d5f341266a664fd0b69011 /Numerical_Methods_by_E_Balaguruswamy/CH12/EX12.6/Ex12_6.R
parentcbb2770fb2f88246175add29623103a56ba338b8 (diff)
parentb3f3a8ecd454359a2e992161844f2fb599f8238a (diff)
downloadR_TBC_Uploads-master.tar.gz
R_TBC_Uploads-master.tar.bz2
R_TBC_Uploads-master.zip
Merge pull request #1 from prashantsinalkar/masterHEADmaster
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.R20
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