From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 858/CH7/EX7.12/example_12.sce | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 858/CH7/EX7.12/example_12.sce (limited to '858/CH7/EX7.12') diff --git a/858/CH7/EX7.12/example_12.sce b/858/CH7/EX7.12/example_12.sce new file mode 100755 index 000000000..1cc918120 --- /dev/null +++ b/858/CH7/EX7.12/example_12.sce @@ -0,0 +1,21 @@ +clc +clear +printf("example 7.11 page number 316\n\n") + +//to find the initial conc of A and B +Cp = 0.02; +Cq = 0.02; +K = 4*10^-2; +Cb = 0.05; +Cb_i = Cb+Cp; +a = (Cp*Cq)/(K*Cb); +funcprot(0) +function[f] = F(x,a) + f = x-0.02-a; +endfunction + +//initial guess +x = 10; +y = fsolve(x,F); +printf("conc of A= %f mol/l",y) +printf("\n\nconc of B= %f mol/l",Cb_i) -- cgit