diff options
author | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
commit | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch) | |
tree | dbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /797/CH1 | |
parent | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff) | |
download | Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2 Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip |
initial commit / add all books
Diffstat (limited to '797/CH1')
-rw-r--r-- | 797/CH1/EX1.2e/1_02_example.sci | 4 | ||||
-rw-r--r-- | 797/CH1/EX1.2s/1_02_solution.sce | 9 | ||||
-rw-r--r-- | 797/CH1/EX1.3e/1_03_example.sci | 3 | ||||
-rw-r--r-- | 797/CH1/EX1.3s/1_03_solution.sce | 7 | ||||
-rw-r--r-- | 797/CH1/EX1.4e/1_04_example.sci | 4 | ||||
-rw-r--r-- | 797/CH1/EX1.4s/1_04_solution.sce | 9 | ||||
-rw-r--r-- | 797/CH1/EX1.5e/1_05_example.sci | 3 | ||||
-rw-r--r-- | 797/CH1/EX1.5s/1_05_solution.sce | 15 | ||||
-rw-r--r-- | 797/CH1/EX1.6e/1_06_example.sci | 4 | ||||
-rw-r--r-- | 797/CH1/EX1.6s/1_06_solution.sce | 9 |
10 files changed, 67 insertions, 0 deletions
diff --git a/797/CH1/EX1.2e/1_02_example.sci b/797/CH1/EX1.2e/1_02_example.sci new file mode 100644 index 000000000..2e086186d --- /dev/null +++ b/797/CH1/EX1.2e/1_02_example.sci @@ -0,0 +1,4 @@ +//Example 1-02 Electric Power Generation by a Wind Turbine +unit_cost = 0.09 // unit cost of electric power [$/kWh] +turbine_power = 30 // rating of turbing [kW] +t=2200 // turbine operation time per year [hr]
\ No newline at end of file diff --git a/797/CH1/EX1.2s/1_02_solution.sce b/797/CH1/EX1.2s/1_02_solution.sce new file mode 100644 index 000000000..3f4efd0f2 --- /dev/null +++ b/797/CH1/EX1.2s/1_02_solution.sce @@ -0,0 +1,9 @@ +//Solution 1-01 +WD=get_absolute_file_path('1_02_solution.sce'); +datafile=WD+filesep()+'1_02_example.sci'; +clc; +exec(datafile) +totE = turbine_power * t; //total energy generated by turbine in one yeear [kWh] +money_saved = totE * unit_cost; //money saved per year [$] +printf("The amount of electric power generated by wind turbine is %1.2f kW", totE) +printf("\nMoney saved by turbine per year: \$%1.2f", money_saved); diff --git a/797/CH1/EX1.3e/1_03_example.sci b/797/CH1/EX1.3e/1_03_example.sci new file mode 100644 index 000000000..bd899e573 --- /dev/null +++ b/797/CH1/EX1.3e/1_03_example.sci @@ -0,0 +1,3 @@ +//Example 1-03 Obtaining Formulas from Unit Considerations +rho = 850 //density of oil [kg/m^3] +V = 2 //volume of oil [m^3]
\ No newline at end of file diff --git a/797/CH1/EX1.3s/1_03_solution.sce b/797/CH1/EX1.3s/1_03_solution.sce new file mode 100644 index 000000000..2a93b3fe5 --- /dev/null +++ b/797/CH1/EX1.3s/1_03_solution.sce @@ -0,0 +1,7 @@ +//Solution 1-03 +WD=get_absolute_file_path('1_03_solution.sce'); +datafile=WD+filesep()+'1_03_example.sci'; +clc; +exec(datafile) +m = rho * V; //mass volume relation +printf("\n Mass of oil: %1.2f kg", m); diff --git a/797/CH1/EX1.4e/1_04_example.sci b/797/CH1/EX1.4e/1_04_example.sci new file mode 100644 index 000000000..f8181c64e --- /dev/null +++ b/797/CH1/EX1.4e/1_04_example.sci @@ -0,0 +1,4 @@ +//Example 1-04 The Weight of One Pound-Mass +m = 1.00 //mass [lbm] +g = 32.174 //gravitational acceleration [ft/s^2] +lbf = 32.174 //as 1 lbf = 32.174 lbm.ft / s^2 diff --git a/797/CH1/EX1.4s/1_04_solution.sce b/797/CH1/EX1.4s/1_04_solution.sce new file mode 100644 index 000000000..015704c9c --- /dev/null +++ b/797/CH1/EX1.4s/1_04_solution.sce @@ -0,0 +1,9 @@ +//Solution 1-04 +WD=get_absolute_file_path('1_04_solution.sce'); +datafile=WD+filesep()+'1_04_example.sci'; +clc; +exec(datafile) +W = m * g; //Newton's second law +W = W / lbf; //application of conversion factor +//result +printf("Weight of one pond mass = %1.2f lbf", W); diff --git a/797/CH1/EX1.5e/1_05_example.sci b/797/CH1/EX1.5e/1_05_example.sci new file mode 100644 index 000000000..7b8bce8cb --- /dev/null +++ b/797/CH1/EX1.5e/1_05_example.sci @@ -0,0 +1,3 @@ +//Example 1-5 Solving a System of Equations +difference = 4 //sum of two numbers +sum_squares_minus_sum = 20 //sum of squares minus sum
\ No newline at end of file diff --git a/797/CH1/EX1.5s/1_05_solution.sce b/797/CH1/EX1.5s/1_05_solution.sce new file mode 100644 index 000000000..e7952338e --- /dev/null +++ b/797/CH1/EX1.5s/1_05_solution.sce @@ -0,0 +1,15 @@ +//Solution 1-5 +WD=get_absolute_file_path('1_05_solution.sce'); +datafile=WD+filesep()+'1_05_example.sci'; +clc; +exec(datafile) +function [Z] =equations(X) + x = X(1); + y = X(2); + Z(1) = x - y - difference; + Z(2) = x**2 + y**2 - x -y - sum_squares_minus_sum; +endfunction + +[X, v, info] = fsolve([1,1], equations); +printf("x = %f\n", X(1)); +printf("y = %f\n", X(2));
\ No newline at end of file diff --git a/797/CH1/EX1.6e/1_06_example.sci b/797/CH1/EX1.6e/1_06_example.sci new file mode 100644 index 000000000..e1fb383e5 --- /dev/null +++ b/797/CH1/EX1.6e/1_06_example.sci @@ -0,0 +1,4 @@ +//Example 1-06 Significant Digits and Volume Flow Rate +V = 1.1 //volume of water collected [gal] +deltat = 45.62 //time interval [s] +gal_cubicm = 3.785 * 10**-3 //conversion factor [gal] to [m^3] diff --git a/797/CH1/EX1.6s/1_06_solution.sce b/797/CH1/EX1.6s/1_06_solution.sce new file mode 100644 index 000000000..61bb3db58 --- /dev/null +++ b/797/CH1/EX1.6s/1_06_solution.sce @@ -0,0 +1,9 @@ +//Solution 1-06 +WD=get_absolute_file_path('1_06_solution.sce'); +datafile=WD+filesep()+'1_06_example.sci'; +clc; +exec(datafile) +Vdot = V / deltat; //volume flow rate [gal/s] +Vdot = Vdot * gal_cubicm * 60; //volume flow rate [m^3/min] +//result +printf("Volume flow rate of water = %1.1e m\^3/min", Vdot); |