summaryrefslogtreecommitdiff
path: root/Numerical_Methods_by_E_Balaguruswamy/CH13/EX13.7/Ex13_7.R
diff options
context:
space:
mode:
Diffstat (limited to 'Numerical_Methods_by_E_Balaguruswamy/CH13/EX13.7/Ex13_7.R')
-rw-r--r--Numerical_Methods_by_E_Balaguruswamy/CH13/EX13.7/Ex13_7.R21
1 files changed, 21 insertions, 0 deletions
diff --git a/Numerical_Methods_by_E_Balaguruswamy/CH13/EX13.7/Ex13_7.R b/Numerical_Methods_by_E_Balaguruswamy/CH13/EX13.7/Ex13_7.R
new file mode 100644
index 00000000..f5a9d53e
--- /dev/null
+++ b/Numerical_Methods_by_E_Balaguruswamy/CH13/EX13.7/Ex13_7.R
@@ -0,0 +1,21 @@
+# Example 7 Chapter 13 Page no.: 433
+# Polygon Method
+
+#for the solution
+cat("Polygon Method")
+h <- 0.25
+x = 1
+y = 2
+cat("h=",h)
+cat("x=",x)
+cat("y=",y)
+
+#Creating algorithm and displaying
+for (i in 1:3) {
+
+ cat("y(",x,")= ",signif(y,3),"\n")
+ f1 <- (2 * y / x)
+ f2 <- (2 * (y + ( h * f1 / 2 ) ) / (x + ( h / 2 ) ))
+ x <- x + h
+ y <- y + (h * f2)
+}