Difference between revisions of "Examples"

From ZCubes Wiki
Jump to navigation Jump to search
 
(102 intermediate revisions by the same user not shown)
Line 1: Line 1:
<div style="font-size:24px">'''Engineering Examples of Java and z3 Programs'''</div><br/>
+
<div style="font-size:24px">'''Engineering Examples in z3'''</div><br/>
 
==DESCRIPTION==
 
==DESCRIPTION==
 
*Basic Engineering examples in z3.<br>
 
*Basic Engineering examples in z3.<br>
 
*z3 codes with z3 notations are shown below.<br>
 
*z3 codes with z3 notations are shown below.<br>
*Reflecting different domains like Engineering, Statistics, Medicine, etc.
 
*Set of cases that are progressively complex on units are used to show the user how it goes from simple to complex cases.<br>
 
*Testing how we can make better solutions to the standard problems compared to other software, due to the presence of units.<br><br>
 
  
==Examples==
+
==Engineering Examples==
 
'''ExampleS1: Chemical Engineering<br>'''
 
'''ExampleS1: Chemical Engineering<br>'''
*An exhaust pipe is 75mm diameter and it is cooled by surrounding it witha water jacket. The exhaust gas enters at 350C and the water enters at 10C. The surface heat transfer coefficients for the gas and water are 300 and 1500 W/m2K respectively. The wall is thin so the temperature drop due to conduction is negligible. The gasses have a mean specific heat capacity Cp of 1130 J/kgK and they must be cooled to 100C. The specific heat capacity of the water is 4190 J/kgK. The flow rate of the gas and water is 200 and 1400 kg/h respectively. Calculate the required length of pipe for parellel flow and contra flow.
+
'''LengthParallelContraFlow'''<br>
 
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3code1a <span style="color:blue;"> z3 code: Normal Calculation without using Function]</span><br>
 
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3code1b <span style="color:blue;"> z3 code: Using Function]</span><br>
'''z3 code: Normal Calculation without using Function'''<br>
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3code1c <span style="color:blue;"> z3 code: Multi-calculation Using Function(variable diameter)]</span><br>
<source lang="cpp">
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3code1d <span style="color:blue;"> z3 code: USING EXAMPLE1 function SOLUTION IN EXAMPLE2 function]</span><br><br>
/*Overall Heat transfer coefficient
 
U = 1/((1/hg)+(1/hw)+(x/k))
 
U = 1</>((1</>hg)+(1</>hw))*/
 
 
 
x = 0  //wall very thin
 
hg = 300(W/m2.degK)
 
hw = 1500(W/m2.degK)
 
cpg = 1130(J/kg.degK)
 
cpw = 4190(J/kg.degK)
 
mg = 200(kg/hr)
 
mw = 1400(kg/hr)
 
D = 75mm
 
tg1 = 350degC<>degK
 
tg2 = 100degC<>degK
 
tw1 = 10degC<>degK
 
 
 
U = 1</>((1</>hg)<+>(1</>hw))
 
delt = tg1<->tg2
 
φ = mg<*>cpg<*>delt
 
tw2 = tw1<+>(φ</>(mw<*>cpw))
 
 
 
 
 
//Parallel flow
 
delti = tg1<->tw1
 
delt0 = tg2<->tw2
 
A = φ<*>(log(delt0</>delti))</>(U<*>(delt0<->delti))
 
L = A</>(π<*>D)
 
//answer:1.48m
 
 
 
 
 
//Contra Flow
 
delti = tg1<->tw2
 
delt0 = tg2<->tw1
 
A = φ<*>(log(delt0</>delti))</>(U<*>(delt0<->delti))
 
L = A</>(π<*>D)
 
//answer:1.44m</source>
 
 
 
 
 
 
 
'''z3 code: Using Function'''<br>
 
<source lang="cpp">
 
function Example1(hg,hw,cpg,cpw,mg,mw)
 
{
 
   
 
/*Overall Heat transfer coefficient
 
U = 1/((1/hg)+(1/hw)+(x/k))
 
U = 1</>((1</>hg)+(1</>hw))*/
 
 
 
x = 0  //wall very thin
 
var D = 75mm
 
var tg1 = 350degC<>degK
 
var tg2 = 100degC<>degK
 
var tw1 = 10degC<>degK
 
 
 
var U = 1</>((1</>hg)<+>(1</>hw))
 
var delt = tg1<->tg2
 
var φ = mg<*>cpg<*>delt
 
var tw2 = tw1<+>(φ</>(mw<*>cpw))
 
 
 
 
 
//Parallel flow
 
var delti = tg1<->tw1
 
var delt0 = tg2<->tw2
 
var A1 = φ<*>(log(delt0</>delti))</>(U<*>(delt0<->delti))
 
var LParallel = A1</>(π<*>D)
 
//answer:1.48m
 
 
 
 
 
//Contra Flow
 
delti = tg1<->tw2
 
delt0 = tg2<->tw1
 
var A2 = φ<*>(log(delt0</>delti))</>(U<*>(delt0<->delti))
 
var LContra = A2</>(π<*>D)
 
//answer:1.44m
 
 
return [LParallel,LContra]
 
           
 
}
 
           
 
           
 
hg = 300(W/m2.degK)
 
hw = 1500(W/m2.degK)
 
cpg = 1130(J/kg.degK)
 
cpw = 4190(J/kg.degK)
 
mg = 200(kg/hr)
 
mw = 1400(kg/hr)
 
 
 
 
 
Example1(hg,hw,cpg,cpw,mg,mw)</source>
 
 
 
 
 
 
 
'''z3 code: USING EXAMPLE1 function SOLUTION IN EXAMPLE2 function'''<br>
 
<source lang="cpp">
 
function Example1(hg,hw)
 
{
 
   
 
/*Overall Heat transfer coefficient
 
U = 1/((1/hg)+(1/hw)+(x/k))
 
U = 1</>((1</>hg)+(1</>hw))*/
 
 
 
x = 0  //wall very thin
 
var U = 1</>((1</>hg)<+>(1</>hw))
 
                       
 
return [U]
 
 
 
}
 
 
hg = 300(W/m2.degK)
 
hw = 1500(W/m2.degK)
 
 
 
Example1(hg,hw)</source>
 
 
 
<source lang="cpp">
 
function Example2(tw1,mg,mw,cpg,cpw)
 
{
 
 
 
var tg1 = 350degC<>degK
 
var tg2 = 100degC<>degK
 
var delt = tg1<->tg2
 
 
 
var φ = mg<*>cpg<*>delt
 
var tw2 = tw1<+>(φ</>(mw<*>cpw))
 
 
 
 
 
//Parallel flow
 
var delti = tg1<->tw1
 
var delt0 = tg2<->tw2
 
var A1 = φ<*>(log(delt0</>delti))</>(Example1(hg,hw)<*>(delt0<->delti))
 
var LParallel = A1</>(π<*>D)
 
//answer:1.48m
 
 
 
 
 
//Contra Flow
 
delti = tg1<->tw2
 
delt0 = tg2<->tw1
 
var A2 = φ<*>(log(delt0</>delti))</>(Example1(hg,hw)<*>(delt0<->delti))
 
var LContra = A2</>(π<*>D)
 
//answer:1.44m
 
 
 
 
return [LParallel,LContra]
 
                 
 
}
 
                 
 
 
 
cpg = 1130(J/kg.degK)
 
cpw = 4190(J/kg.degK)
 
mg = 200(kg/hr)
 
mw = 1400(kg/hr)
 
tw1 = 10degC<>degK               
 
                 
 
                 
 
Example2(tw1,mg,mw,cpg,cpw)</source>
 
 
 
 
 
 
 
  
 
'''ExampleS2: Civil Engineering<br>'''
 
'''ExampleS2: Civil Engineering<br>'''
A steel pipe 5 ft (1.5 m) in diameter and 3/5 in. (9.53 mm) thick sustains a fluid pressure of
+
'''HoopStress'''<br>
180 lb/sq.in. (1241.1 kPa). Determine the hoop stress, the longitudinal stress, and the increase
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3code2a <span style="color:blue;"> z3 code: Using Function]</span><br>
in diameter of this pipe. Use 0.25 for Poisson’s ratio.
 
 
 
 
 
'''z3 code: Using Function'''<br>
 
<source lang="cpp">
 
function civil1(p,D,t){
 
   
 
var E = 30e+6(lb/sqin)//for steel
 
var v = 0.25
 
 
 
/*hoop stress
 
s = pD/2t
 
longitudinal stress
 
s'= pD/4t
 
increase in cyl diameter
 
delD = D(s-vs')/E */
 
 
 
var s = p<*>D</>(2<*>t)
 
var sdash = p<*>D</>(4<*>t)
 
var delD = D<*>(s<->v<*>sdash)</>E
 
 
 
return [s,sdash,delD<>inch]
 
 
 
}
 
 
 
p = 180(lb/sqin)
 
D = 5(ft)
 
t = (3/8)<>(inch)
 
 
 
civil1(p,D,t)</source>
 
 
 
 
 
  
  
 
'''ExampleS3: Civil Engineering<br>'''
 
'''ExampleS3: Civil Engineering<br>'''
A 1/2-in. (12.7-mm) diameter Copperweld bar consists of a steel core 3/8 in. (9.53 mm) indiameter and a copper skin 1/16 in. (1.6 mm) thick. What is the elongation of a 1-ft (0.3-m) length of this bar, and what is the internal force between the steel and copper arising from a temperature rise of 80°F (44.4°C)? Use the following values for thermal expansion coefficients: cs = 6.5*106 and cc = 9.0*106 , where the subscripts s and c refer to steel and copper, respectively. Also, Ec = 15*106 lb/sq.in. (1.03*108 kPa).
+
'''InternalForce'''<br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3code3a <span style="color:blue;"> z3 code: Normal Calculation without using Function]</span><br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3code3b <span style="color:blue;"> z3 code: Using Function]</span><br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3code3c <span style="color:blue;"> z3 code: USING EXAMPLE1 function SOLUTION IN EXAMPLE2 function]</span><br>
  
'''z3 code: Normal Calculation without using Function'''<br>
 
<source lang="cpp">
 
dc = 12.7(mm)
 
ds = (3/8)<>(inch)
 
dcs = (1/16)<>(inch)
 
Es = 30e+6(lbf/in2)
 
Ec = 1.03e+11(Pa)
 
cs = 6.5e-6(diffF-1)
 
cc = 9e-6(diffF-1)
 
L = 1(ft)
 
delT = 44.4(diffC)
 
  
 +
'''ExampleS4: Civil Engineering<br>'''
 +
'''NotchDesign'''<br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3code4a <span style="color:blue;"> z3 code: Using Function]</span><br>
  
//cross-sectional area
 
A = π<*>(dc)^2</>4
 
As = π<*>(ds)^2</>4
 
Ac = A<->As
 
   
 
  
//coeff of expansion
+
'''ExampleS5: Engineering Economics<br>'''
//c = ((As<*>Es<*>cs)<+>(Ac<*>Ec<*>cc))</>(As<*>Es<+>Ac<*>Ec)
+
'''RateOfEarnings'''<br>
a = (As<*>Es<*>cs)
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3code5a <span style="color:blue;"> z3 code: Using Function]</span><br>
b = (Ac<*>Ec<*>cc)<>(lbf.diffF-1)
 
d = (As<*>Es<+>Ac<*>Ec)
 
c = (a<+>b)</>d
 
  
  
//thermal expansion
+
'''ExampleS6: Fluid Mechanics<br>'''
delL = c<*>L<*>delT
+
'''BernoullisPressure'''<br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3code6a <span style="color:blue;"> z3 code: Using Function]</span><br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3code6b <span style="color:blue;"> z3 code: Multi-calculation Using Function(variable diameter)]</span><br>
  
//expansion w.o restraint
 
delLc = cc<*>L<*>delT
 
delLcs = delLc<->delL
 
delLs= cs<*>L<*>delT
 
delLsc = delL<->delLs
 
  
//restraining force
+
==Examples of Java and z3 Programs==
P1 = Ac<*>Ec<*>delLcs</>L
+
'''ExampleR1: Check if number is Odd/Even'''<br>
P2 = As<*>Es<*>delLsc</>L</source>
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes1a <span style="color:blue;"> Java code]</span><br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes1b <span style="color:blue;"> z3 code]</span>
  
 +
'''ExampleR2: Sum of a given Array'''<br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes2a <span style="color:blue;"> Java code]</span><br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes2b <span style="color:blue;"> z3 code]</span>
  
 +
'''ExampleR3: Linear Search'''<br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes3a <span style="color:blue;"> Java code]</span><br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes3b <span style="color:blue;"> z3 code]</span><br>
  
'''z3 code: Using Function'''<br>
+
'''ExampleR4: Floyd's Triangle'''<br>
<source lang="cpp">
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes4a <span style="color:blue;"> Java code]</span><br>
function civil2(dc,ds,dcs,L){
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes4b <span style="color:blue;"> z3 code]</span><br>
 
var Es = 30e+6(lbf/in2)
 
var Ec = 1.03e+11(Pa)
 
var cs = 6.5e-6(diffF-1)
 
var cc = 9e-6(diffF-1)
 
var delT = 44.4(diffC)
 
  
 +
'''ExampleR5: Reverse Number'''<br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes5a <span style="color:blue;"> Java code]</span><br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes5b <span style="color:blue;"> z3 code]</span><br>
  
//cross-sectional area
+
'''ExampleR6: Calculate the Factorial of a number'''<br>
var A = π<*>(dc)^2</>4
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes6a <span style="color:blue;"> Java code]</span><br>
var As = π<*>(ds)^2</>4
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes6b <span style="color:blue;"> z3 code]</span><br>
var Ac = A<->As
 
   
 
  
//coeff of expansion
+
'''ExampleR7: Area of Rectangle'''<br>
//c = ((As<*>Es<*>cs)<+>(Ac<*>Ec<*>cc))</>(As<*>Es<+>Ac<*>Ec)
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes7a <span style="color:blue;"> Java code]</span><br>
var a = (As<*>Es<*>cs)
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes7b <span style="color:blue;"> z3 code]</span><br>
var b = (Ac<*>Ec<*>cc)<>(lbf.diffF-1)
 
var d = (As<*>Es<+>Ac<*>Ec)
 
var c = (a<+>b)</>d
 
  
 +
'''ExampleR8: Display Prime Numbers'''<br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes8a <span style="color:blue;"> Java code]</span><br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes8b <span style="color:blue;"> z3 code]</span><br>
  
//thermal expansion
+
'''ExampleR9: Ascending Order'''<br>
var delL = c<*>L<*>delT
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes9a <span style="color:blue;"> Java code]</span><br>
 
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes9b <span style="color:blue;"> z3 code]</span><br>
//expansion w.o restraint
 
var delLc = cc<*>L<*>delT
 
var delLcs = delLc<->delL
 
var delLs= cs<*>L<*>delT
 
var delLsc = delL<->delLs
 
 
 
//restraining force
 
var P1 = Ac<*>Ec<*>delLcs</>L
 
var P2 = As<*>Es<*>delLsc</>L
 
 
 
 
 
return[P1,P2]
 
 
 
}
 
 
 
dc = 12.7(mm)
 
ds = (3/8)<>(inch)
 
dcs = (1/16)<>(inch)
 
L = 1(ft)
 
 
 
 
 
civil2(dc,ds,dcs,L)</source>
 
 
 
 
 
 
 
 
 
'''z3 code: USING EXAMPLE1 function SOLUTION IN EXAMPLE2 function'''<br>
 
<source lang="cpp">
 
function civil2(dc,ds,dcs){
 
 
 
var Es = 30e+6(lbf/in2)
 
var Ec = 1.03e+11(Pa)
 
var cs = 6.5e-6(diffF-1)
 
var cc = 9e-6(diffF-1)
 
 
 
//cross-sectional area
 
var A = π<*>(dc)^2</>4
 
var As = π<*>(ds)^2</>4
 
var Ac = A<->As
 
 
 
//coeff of expansion
 
//c = ((As<*>Es<*>cs)<+>(Ac<*>Ec<*>cc))</>(As<*>Es<+>Ac<*>Ec)
 
var a = (As<*>Es<*>cs)
 
var b = (Ac<*>Ec<*>cc)<>(lbf.diffF-1)
 
var d = (As<*>Es<+>Ac<*>Ec)
 
var c = (a<+>b)</>d
 
   
 
return[As,Ac,c]
 
 
 
}
 
 
 
 
 
dc = 12.7(mm)
 
ds = (3/8)<>(inch)
 
dcs = (1/16)<>(inch)
 
 
 
civil2(dc,ds,dcs)</source>
 
 
 
<source lang="cpp">
 
function civil3(L,delT){
 
 
 
var Es = 30e+6(lbf/in2)
 
var Ec = 1.03e+11(Pa)
 
var cs = 6.5e-6(diffF-1)
 
var cc = 9e-6(diffF-1)
 
 
 
//thermal expansion
 
var delL = civil2(dc,ds,dcs)[2]<*>L<*>delT
 
 
 
//expansion w.o restraint
 
var delLc = cc<*>L<*>delT
 
var delLcs = delLc<->delL
 
var delLs= cs<*>L<*>delT
 
var delLsc = delL<->delLs
 
 
 
//restraining force
 
var P1 = civil2(dc,ds,dcs)[1]<*>Ec<*>delLcs</>L
 
var P2 = civil2(dc,ds,dcs)[0]<*>Es<*>delLsc</>L
 
 
 
return [P1,P2]
 
 
 
}
 
 
 
 
 
L = 1(ft)
 
delT = 44.4(diffC)
 
 
 
 
 
civil3(L,delT)</source>
 
 
 
 
 
 
 
 
 
'''ExampleS4: Civil Engineering<br>'''
 
M1 is a 4x4, F = 5500 lb (24,464 N), and Phi = 30°. The allowable compressive
 
stresses are P = 1200 lb/sq.in. (8274 kPa) and Q = 390 lb/sq.in. (2689.1 kPa). The
 
projection of M1 into M2 is restricted to a vertical distance of 2.5 in. (63.5 mm).
 
  
'''z3 code: Normal Calculation without using Function'''<br>
+
'''ExampleR10: Inputting Matrix and Calculating it's Inverse'''<br>
<source lang="cpp">
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes10a <span style="color:blue;"> Java code]</span><br>
function civil4(){
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes10b <span style="color:blue;"> z3 code]</span><br>
  
var b = 3.625(inch)   
+
'''ExampleR11: Inputting 2 Matrices and Calculating Sum,Difference and Product'''<br>
var φ = 30(deg)
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes11a <span style="color:blue;"> Java code]</span><br>
var P = 1200(lbf/sqin)
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes11b <span style="color:blue;"> z3 code]</span><br><br>
var Q = 2689.1e+3(Pa)
 
var F = 24464(N)
 
var A = 13.1(sqin)
 
  
//lengths
+
==Unit Conversion Examples==
var AB = b</>DSIN(φ)
+
'''ExampleP1: FrictionFactor'''<br>
var AC = (b<*>DSIN(φ/2))</>DSIN(φ)
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3codep1 <span style="color:blue;"> z3 code: Solution with SI units<br> Solution with SI and Imperial units<br> Solution with imperial units<br>]</span><br>
var BC = (b<*>DCOS(φ/2))</>DSIN(φ)
 
  
//stresses f1 and f2
+
'''ExampleP2: ReynoldsNumber'''<br>
var f1 = (F<*>DSIN(φ))</>(A<*>DTAN(φ/2))
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3codep2 <span style="color:blue;"> z3 code: Solution with SI units<br> Solution with SI and Imperial units<br> Solution with imperial units<br>]</span><br>
var f2 = (F<*>DSIN(φ)<*>DTAN(φ/2))</>(A)
 
  
//allowable stresses
+
'''ExampleP3: FouriersLaw'''<br>
var N1 = P<*>Q</>((P<*>(DSIN(φ/2))^2)<+>Q<*>(DCOS(φ/2))^2)
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3codep3 <span style="color:blue;"> z3 code: Solution with SI units<br> Solution with SI and Imperial units<br> Solution with imperial units<br>]</span><br>
var N2 = P<*>Q</>((P<*>(DCOS(φ/2))^2)<+>Q<*>(DSIN(φ/2))^2)
 
   
 
  
return[AC;BC;f1<>(lbf/sqin);f2<>(lbf/sqin);N1<>Pa;N2<>Pa]
+
'''ExampleP4: MaximumHeight'''<br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3codep4 <span style="color:blue;"> z3 code: Solution with SI units<br> Solution with SI and Imperial units<br> Solution with imperial units<br>]</span><br>
  
}
+
'''ExampleP5: DopplerEffect'''<br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3codep5 <span style="color:blue;"> z3 code: Solution with SI units<br> Solution with SI and Imperial units<br> Solution with imperial units<br>]</span><br>
  
 +
'''ExampleP6: CircularSegmentArea'''<br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3codep6 <span style="color:blue;"> z3 code: Solution with SI units<br> Solution with SI and Imperial units<br> Solution with imperial units<br>]</span><br>
  
civil4() </source>
+
'''ExampleP7: CoulombsLaw'''<br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3codep7 <span style="color:blue;">  z3 code: Solution with SI units<br> Solution with SI and Imperial units<br> Solution with imperial units<br>]</span><br><br>

Latest revision as of 02:44, 15 February 2018

Engineering Examples in z3


DESCRIPTION

  • Basic Engineering examples in z3.
  • z3 codes with z3 notations are shown below.

Engineering Examples

ExampleS1: Chemical Engineering
LengthParallelContraFlow
z3 code: Normal Calculation without using Function
z3 code: Using Function
z3 code: Multi-calculation Using Function(variable diameter)
z3 code: USING EXAMPLE1 function SOLUTION IN EXAMPLE2 function

ExampleS2: Civil Engineering
HoopStress
z3 code: Using Function


ExampleS3: Civil Engineering
InternalForce
z3 code: Normal Calculation without using Function
z3 code: Using Function
z3 code: USING EXAMPLE1 function SOLUTION IN EXAMPLE2 function


ExampleS4: Civil Engineering
NotchDesign
z3 code: Using Function


ExampleS5: Engineering Economics
RateOfEarnings
z3 code: Using Function


ExampleS6: Fluid Mechanics
BernoullisPressure
z3 code: Using Function
z3 code: Multi-calculation Using Function(variable diameter)


Examples of Java and z3 Programs

ExampleR1: Check if number is Odd/Even
Java code
z3 code

ExampleR2: Sum of a given Array
Java code
z3 code

ExampleR3: Linear Search
Java code
z3 code

ExampleR4: Floyd's Triangle
Java code
z3 code

ExampleR5: Reverse Number
Java code
z3 code

ExampleR6: Calculate the Factorial of a number
Java code
z3 code

ExampleR7: Area of Rectangle
Java code
z3 code

ExampleR8: Display Prime Numbers
Java code
z3 code

ExampleR9: Ascending Order
Java code
z3 code

ExampleR10: Inputting Matrix and Calculating it's Inverse
Java code
z3 code

ExampleR11: Inputting 2 Matrices and Calculating Sum,Difference and Product
Java code
z3 code

Unit Conversion Examples

ExampleP1: FrictionFactor
z3 code: Solution with SI units
Solution with SI and Imperial units
Solution with imperial units

ExampleP2: ReynoldsNumber
z3 code: Solution with SI units
Solution with SI and Imperial units
Solution with imperial units

ExampleP3: FouriersLaw
z3 code: Solution with SI units
Solution with SI and Imperial units
Solution with imperial units

ExampleP4: MaximumHeight
z3 code: Solution with SI units
Solution with SI and Imperial units
Solution with imperial units

ExampleP5: DopplerEffect
z3 code: Solution with SI units
Solution with SI and Imperial units
Solution with imperial units

ExampleP6: CircularSegmentArea
z3 code: Solution with SI units
Solution with SI and Imperial units
Solution with imperial units

ExampleP7: CoulombsLaw
z3 code: Solution with SI units
Solution with SI and Imperial units
Solution with imperial units