Case Study
Case Study
CASE STUDY ES 84
M.J.P ASTURIAS
CHAPTER IV
TABLE OF CONTENTS
1 3
Conclusion. 22
CHAPTER 1
1
BACKGROUND
INTRODUCTION
An electric generator is a device that converts mechanical energy to electrical energy. A generator forces electric charge (usually carried by electrons) to flow through an external electrical circuit. It is based on the principle of production of dynamically (or motionally) induced emf (Electromotive Force). Whenever a conductor cuts magnetic flux, dynamically induced emf is produced in it according to Faraday's Laws of Electromagnetic Induction. Figure 1.1 NRC Image of Modern Steam Driven Turbine Generator [1]
A shunt generator is a method of generating electricity in which field winding and armature winding are connected in parallel, and in which the armature supplies both the load current and the field current. In a shunt generator, the armature coils and the shunt field coils are connected in parallel.
RA
IA ISH RSH
IL
VL
Rsh = shunt field winding resistance (ohm) VL = terminal voltage or load voltage (volt) IA = armature current (ampere) If = shunt field current (ampere)
EA
Figure 1.2 Equivalent circuit on a shunt motor Where: EA = generated emf in the armature (volt) RA = armature equivalent resistance (ohm)
IL = load current (ampere) Pg = power developed or generated in the armature (watt) PL = power delivered to the load (watt)
CHAPTER 1
2
Applying Kirchoffs Voltage and Current Laws to our circuit analysis, we obtain several equations:
BACKGROUND
requires different mathematical methods and in order to obtain it, rearranging the sets of equations is done so as to arrive to what is asked in the problem.
Analytical Solution
Starting with (3),
(6)
Then inserting (6) to (5),
(7)
Finally, (6) and (7) to (4),
Simplifying yields,
CHAPTER 1
3
Simplifying yields,
BACKGROUND
(8)
Substituting the values to (8), f(VL) = f(VL) = f(VL) = By quadratic formula,
; or
VL12 =
= 56607.05216
VL1 =
= 237.9223658
= =
= 167.659031
VL2 = 167.659031
Using VL1, Therefore, VL = 237.9223658 Volts
CHAPTER II
4
Referring to Appendix A are the figures of the flowchart of the programs being constructed for each methods of obtaining root of an equation, it follows a subroutine procedure. The program contains a main
The continuous function on the given interval [XL, XU ] and f(XL) f(XU) < 0 states that the bisection converges to a root of the function and the true error is halved in each step and the method converges linearly if f (XL) and f(XU) will have different signs. This method gives only a range where the root exists and not the estimation where is the roots location. The smallest bracket is where the root can be found. Its true error of n steps can be solved by the equation;
2.1
2.1
2.2
The root Xr is from the graphical representation of joining the function f(Xl) and f(XU) by a straight line and which the point that intersects the line and the axis is the improve root.
CHAPTER II
5
The value of the root replaces f(Xl) and f(Xl) with the same sign as f(Xr) the two point (Xl) and (Xu) . The root Xr is from the graphical representation of joining the function f(Xr) and f(Xu)by a straight line and which the point that intersects the line and the axis is the improve root. The value of the root replaces f(Xl)and f(Xu)with the same sign as f (Xr)so that the root is always at the interval of the two point Xl and Xu . The termination of the computation will be the same as the bisection method and same as the algorithm, but the equaso that the root is always at the interval of
Open Method It composed of different methods that are based on the formulas that requires only a single starting value of x or two starting values that do not necessarily bracket the root. It may
diverge or converges as the computation progresses. Simple Fixed Point Method It is also called the One-point iteration or the successive substitution method. It rearranges the function f(x)=0 to x=g(x) It can be obtained by adding both sides a x of the equation or by simply doing algebraic manipulation. The guess roots Xi can be used to estimate as Xi+1 and can be expressed as Xi+1=g
Modified False Position Method It is the remedy of being one-sided of the false position method. It divides the
function value that was stuck. The algorithm implements the strategies on how the counters are used to determine the root when the one is bound stays fixed for the two iterations and through this, the function value is bound halved. It is more than the bisection and the false position method for setting the stopping criterion as 1.01% since it gives only 12 iterations compare with the 14 and 25 of the bisection and false position method.
Newton Raphson Method The widely used for finding the root for approximations to the zeroes of a real valued function. It converges quickly for the iterations which are near on the desired root. It also detects and overcomes the convergences failure.
CHAPTER II
6
This method starts with an initial guess which is close to the true root, the given function is approximated by its tangent line then computes the x-intercept of this tangent line. This x-intercept will be the
Modified Secant Position Method This method uses an alternative approach which involves the fractional perturbation of the independent variable to estimate the f(x) instead of using the two arbitrary values. The formula for the iteration is given by 2.6
2.4 Bairstows Method The termination of the NewtonIt is a method that finds complex roots of a polynomial of a quadratic formula and can be used for solving the root all
Raphson method is the same as for computing the other methods. The convergence depends on the accuracy of the initial guess root and the nature of the problem. Secant Method It is an open method which assumes a function that can be approximately linear in the region of interest. The formula for the needs two initial estimates of x but the f(x) is not required to change the signs between the two estimates and is given by this equation, 2.5
The two values can sometimes lie on the same root and sometimes this can cause the divergence. The convergence of this method is that the root is within the bracketing which is the reason that it was compared with the false position method.
CHAPTER III
7
Bisection Method
SOURCE CODE
These are the source code of the program that was used to solve the unknown root. Java Jframe was chosen and implemented to make the program more user friendly and easy to use.
Bisection Method double xl,xu,xr,i=0,xrold=0,test,fxl,fxr,ea,es=0.00000001; String gumasa1= "", gumasa2, gumasa = ""; if (jRadioButton1.isSelected()){ xl = Double.parseDouble(jTextField1.getText()); xu = Double.parseDouble(jTextField2.getText()); do{ i=i+1; xr = (xl+xu)/2; ea = Math.abs((xr-xrold)/xr)*100; String XL, XU, I, XR, EA; I = String.valueOf( i + "\t" ); XL = String.valueOf(xl + "\t" );
XU = String.valueOf( xu + "\t" );
XR = String.valueOf( xr+ "\t" ); EA = String.valueOf( ea + "\t" ); if(i==1){ EA = String.valueOf( "------"); gumasa1 = I + XL + XU + XR + EA + "\n"; } else{ gumasa = gumasa + I + XL + XU + XR + EA + "\n"; } gumasa2 = gumasa1+gumasa ;
CHAPTER III
8
if (jRadioButton2.isSelected()){ xl = Double.parseDouble(jTextField1.getText()); xu = Double.parseDouble(jTextField2.getText()); double fxu;
SOURCE CODE
False Position Method
do{ i=i+1;
fxl = 0.02085069444*xl*xl*xl*xl -1766.4*xl*xl + 33177600; fxu = 0.02085069444*xu*xu*xu*xu -1766.4*xu*xu + 33177600; xr = xu - (fxu)*(xl-xu)/(fxl-fxu); ea = Math.abs((xr-xrold)/xr)*100; String XL, XU, I, XR, EA; I = String.valueOf( i + "\t" ); XL = String.valueOf(xl + "\t" ); XU = String.valueOf( xu + "\t" ); XR = String.valueOf( xr+ "\t" ); EA = String.valueOf( ea + "\t" );
if(i==1){
EA = String.valueOf( "------"); gumasa1 = I + XL + XU + XR + EA + "\n"; } else{ gumasa = gumasa + I + XL + XU + XR + EA + "\n"; } gumasa2 = gumasa1+gumasa ; fxr = 0.02085069444*xr*xr*xr*xr -1766.4*xr*xr + 33177600; test = fxl*fxr; if(test<0){xu=xr;}
if(test>0){xl=xr;}
xrold=xr; } while(ea>es); String root = String.valueOf(xr); jTextField3.setText(root); jTextArea1.setText(gumasa2); }
CHAPTER III
9
Source Code
Fixed Point Iteration Method
if(jRadioButton3.isSelected()){
xl = Double.parseDouble(jTextField1.getText());
EA = String.valueOf( ea + "\t" );
gumasa2 = gumasa1+gumasa ;
CHAPTER III
10
if ( jRadioButton4.isSelected()){
Source Code
Newton Raphson Method
xr = Double.parseDouble(jTextField1.getText());
do{i=i+1;
xrold=xr;
xr = xrold-(0.02085069444*xrold*xrold*xrold*xrold -1766.4*xrold*xrold + 33177600)/ (4*0.02085069444*xrold*xrold*xrold -2*1766.4*xrold); ea=Math.abs((xr-xrold)/xr)*100; String XL,I, EA;
if(i==1){
EA = String.valueOf( "------"); gumasa1 = I + XL + EA + "\n"; } else{ gumasa = gumasa + I + XL + EA + "\n"; }
gumasa2 = gumasa1+gumasa ;
}while(ea>es);
CHAPTER III
11
if(jRadioButton5.isSelected()){ double fx1, fx0, xt=237.9223659; double x0 = Double.parseDouble(jTextField1.getText());
Source Code
Secant Method
double x1 = Double.parseDouble(jTextField2.getText());
do{i=i+1;
fx1=0.02085069444*x1*x1*x1*x1 -1766.4*x1*x1 + 33177600; fx0=0.02085069444*x0*x0*x0*x0 -1766.4*x0*x0 + 33177600; xr=x1 - (fx1*(x0-x1))/(fx0-fx1);
ea=Math.abs((xr-xt)/xr)*100;
String XL, XU, I, XR, EA; I = String.valueOf( i + "\t" ); XL = String.valueOf(x0 + "\t" ); XU = String.valueOf( x1 + "\t" ); XR = String.valueOf( xr+ "\t" ); EA = String.valueOf( ea + "\t" ); if(i==1){ EA = String.valueOf( "------"); gumasa1 = I + XL + XU + XR + EA + "\n"; } else{ gumasa = gumasa + I + XL + XU + XR + EA + "\n";
CHAPTER III
12
if (jRadioButton6.isSelected()){ double double double do{ double fx0,fx1,fx2,h0,h1,pert0,pert1,a,b,c,rad,den; x0 = Double.parseDouble(jTextField1.getText()); x1 = Double.parseDouble(jTextField2.getText()); x2 = Double.parseDouble(jTextField4.getText());
Source Code
Mullers Method
if(Math.abs(b+rad)>Math.abs(b-rad)){
den=b+rad;} else{den=b-rad;} xr=x2 - 2*c/den; ea=Math.abs((xr-x2)/xr)*100; String XL, XU, I, XR, EA; I = String.valueOf( i + "\t" ); XL = String.valueOf(x1 + "\t" ); XU = String.valueOf( x2 + "\t" ); XR = String.valueOf( xr+ "\t" ); EA = String.valueOf( ea + "\t" );
jTextArea1.setText(gumasa2);}
CHAPTER III
13
if (jRadioButton7.isSelected()){
Source Code
Bairstows Method
gumasa = gumasa + I + XL + XU + XR + EA + "\n"; i=i+1; }while(ear>es && eas>es); disc = r*r + 4*s;
if(disc>0){
r1=(r + Math.sqrt(disc))/2;
r = g; s = g;
}else{ r1=r/2; r2=r1; i1=Math.sqrt(Math.abs(disc))/2; i2=-i1;} xr=r1; String root = String.valueOf(xr); jTextField3.setText(root); jTextArea1.setText(gumasa); }
b1=r*b2 + s*b3;
b0= 33177600 + r*b1 + s*b2; c4=b4; c3=b3 + r*c4; c2=b2 + r*c3 + s*c4; c1=b1 + r*c2 + s*c3; det=c2*c2 - c3*c1; dr=(-b1*c2 + b0*c3)/det; ds=(-c2*b0 + b1*c1)/det; ear=Math.abs(dr/r)*100;
eas=Math.abs(ds/s)*100;
r=r+dr; s=s+ds;
String XL, XU, I, XR, EA; I = String.valueOf( i + "\t" ); XL = String.valueOf(r + "\t" ); XU = String.valueOf( s + "\t" ); XR = String.valueOf( ear+ "\t" ); EA = String.valueOf( eas + "\t" );
CHAPTER III
14
private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel4; private javax.swing.JPanel jPanel5; private javax.swing.JRadioButton jRadioButton1; private javax.swing.JRadioButton jRadioButton2; private javax.swing.JRadioButton jRadioButton3;
Source Code
Java Jframe Components Used
CHAPTER IV
15
RESULTS
CHAPTER IV
16
RESULTS
CHAPTER IV
17
RESULTS
CHAPTER IV
18
TABLE OF RESULTS
CHAPTER IV
19
TABLE OF RESULTS
The following are the tabular presentation of the results obtained after employing the different methods for solving the function (8). Iteration 1 is equal to Xr = 237.92236589360982, where the condition a < s was satisfied after 31 iterations such that a = 9.785992282792908E-9, which is less than the inputted stopping s =0.00000001. The limits used in solving the problem are 200 and 250, the lower and upper limits respectively.
Xr 225
Ea ---
2
3 4 5 6 7 8 9 10 11 12
237.5
243.75 240.625 239.0625 238.28125 237.890625 238.0859375 237.98828125 237.939453125 237.9150390625 237.92724609375
5.263157895
2.564102564 1.298701299 0.653594771 0.327868852 0.164203612 0.082034454 0.041034058 0.020521239 0.010261673 0.005130573
Iterat ion 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Xr 224.67536444828656 234.89347895440497 237.318847516671 237.8057078164819 237.89995110002397 237.9180640649125 237.92154046339786 237.9222075074168 237.9223354919107 237.9223600478178 237.9223647592592 237.92236566322387 237.92236583666377 237.922365869941 237.92236587632573
Ea --4.35010565 1.02198733 0.20473028 0.03961467 0.00761311 0.00146115 2.80362E-4 5.37925E-5 1.03209E-5 1.98024E-6 3.79941E-7 7.28976E-8 1.39865E-8 2.6835E-9
13
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
237.921142578125
237.9241943359375 237.92266845703125 237.92190551757812 237.9222869873047 237.92247772216797 237.92238235473633 237.9223346710205 237.92235851287842 237.92237043380737 237.9223644733429 237.92236745357513 237.92236596345901 237.92236521840096 237.92236559092999 237.9223657771945 237.92236587032676 237.9223659168929 237.92236589360982
0.002565352
0.00128266 6.41E-04 3.21E-04 1.60E-04 8.02E-05 4.01E-05 2.00E-05 1.00E-05 5.01E-06 2.51E-06 1.25E-06 6.26E-07 3.13E-07 1.57E-07 7.83E-08 3.91E-08 1.96E-08 9.79E-09
Table 1. Result of Bisection M ethod Table 1 shows the obtained results for solving the roots of (8) using the Bisection Method. As shown, the root was obtained after 31 iterations and
CHAPTER IV
20
Iteration 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 x ea 205.9042 -----211.4872 216.5222 220.8848 224.543 227.5311 229.922 231.8045 233.2685 234.3964 235.2591 235.9154 236.4126 236.7881 237.0711 237.2839 237.4438 237.5638 237.6538 237.7213 237.7718 237.8097 237.838 237.8592 237.8751 237.887 237.8959 237.9026 237.9075 237.9113 237.9141 237.9162 237.9177 237.9189 237.9198 237.9204 237.9209 237.9213
TABLE OF RESULTS
2.639904 2.325369 1.97506 1.629182 1.313277 1.039856 0.812111 0.62762 0.481188 0.366702 0.278186 0.210315 0.158594 0.119361 0.089704 0.067342 0.050514 0.037867 0.028374 0.021254 0.015916 0.011916 0.008921 0.006677 0.004998 0.00374 0.002799 0.002095 0.001568 0.001173 8.78E-04 6.57E-04 4.92E-04 3.68E-04 2.75E-04 2.06E-04 1.54E-04
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
237.9216 237.9218 237.9219 237.922 237.9221 237.9222 237.9222 237.9223 237.9223 237.9223 237.9223 237.9223 237.9223 237.9223 237.9224 237.9224 237.9224 237.9224 237.9224 237.9224 237.9224 237.9224 237.9224 237.9224 237.9224 237.9224 237.9224 237.9224 237.9224 237.9224 237.9224 237.9224 237.9224 237.9224
1.15E-04 8.63E-05 6.46E-05 4.83E-05 3.62E-05 2.71E-05 2.02E-05 1.52E-05 1.13E-05 8.48E-06 6.35E-06 4.75E-06 3.55E-06 2.66E-06 1.99E-06 1.49E-06 1.11E-06 8.34E-07 6.24E-07 4.67E-07 3.49E-07 2.61E-07 1.96E-07 1.46E-07 1.10E-07 8.20E-08 6.13E-08 4.59E-08 3.43E-08 2.57E-08 1.92E-08 1.44E-08 1.08E-08 8.06E-09
Table 3 shows the obtained results for solving the roots of the function (8) using
CHAPTER IV
21
the table, a root of Xr = 237.9223659479856 is obtained after 66 iterations, where the condition a < s is satisfied, where a = 9.917300419164622E9and s = 0.00000001. The initial guess used is 250.
TABLE OF RESULTS
iteration 1 2 3 4 5 6
Iteration x0 x1 xr 1 300 239.6691 237.8158 0 250 300 239.6691 2 239.6691 237.8158 237.9232 3 237.8158 237.9232 237.9224 4 237.9232 237.9224 237.9224
Table 6. Results for M ullers M ethod The table above shows the results obtained after computing for the root of the function (8) by employing Mullers Method. As shown above, the root, Xr = 237.9223658778416, was obtained in the 5th iteration where the computed approximate error Ea=0.0 satisfies the terminating condition a<s where s = 0.00000001.
Table 4. Results for N ew ton Raphson M ethod Table 4 shows the obtained results for solving the function (8) using the Newton-Raphson Method. with a From relative the table, a root error of of Xr a = =
i 1 2 3 4 5 6 7
i 1 2 3 4 5 6 7 8 9
Table 5. Results for Secant M ethod Table 5 shows the results after computing for the root of the function (8) using Secant Method where the root was found out to be equal to Xr=237.92236587784157. This root was obtained in the 6th iteration where the relative approximate error is equal a= than the 5.904732995302025E-9 which is less required stopping condition
CHAPTER V
22
CONCLUSION
The Mullers Method gives the least approximate true error over other methods in finding the root of equation (8). Equation (8) is much more approximately equal to zero when the root obtained using the same method is substituted. In addition, these methods give a lesser relative approximation error, though a and t for this technique has a considerable difference compared to the other methods. The Newton Raphson and Secant Methods displayed significant results as the root for (8) were
obtained with almost least number of iterations and approximate error which means that the root finding is fast and mostly accurate. While on the other hand, the Bisection and Fixed -Point Iteration Methods holds the most number of iterations which means the approximate error converges slowly to the desired stopping criterion or shall we say the process of root finding takes longer time than the previous methods. Based on experiences and readings, the performance of each method is not the same in every function. There are some cases that in a certain function, one method performs better than the other but in another or different sets of functions, it performs poorly. But the thing is, with the help of these numerical methods, one can obtain the root(s) of a function by just inputting the values of the function.