Difference between revisions of "Examples"

From ZCubes Wiki
Jump to navigation Jump to search
 
(115 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>
*Set of cases progressively complex on units to show the user how it goes from simple to complex cases.<br>
 
*Reflecting different domains like engineering, statistics, medicine, etc.
 
*Testing how we can make better solutions to the standard problems other software gives due to 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>
 +
<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>
 +
<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>
  
 +
'''ExampleS2: Civil Engineering<br>'''
 +
'''HoopStress'''<br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3code2a <span style="color:blue;"> z3 code: Using Function]</span><br>
  
'''z3 code: Normal Calculation without using Function'''<br>
 
<source lang="cpp">
 
//Overall Heat transfer coefficient
 
//U = 1/((1/hg)+(1/hw)+(x/k))
 
x = 0  //wall very thin
 
//U = 1</>((1</>hg)+(1</>hw))
 
  
hg = 300(W/m2.degK)
+
'''ExampleS3: Civil Engineering<br>'''
hw = 1500(W/m2.degK)
+
'''InternalForce'''<br>
cpg = 1130(J/kg.degK)
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3code3a <span style="color:blue;"> z3 code: Normal Calculation without using Function]</span><br>
cpw = 4190(J/kg.degK)
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3code3b <span style="color:blue;"> z3 code: Using Function]</span><br>
mg = 200(kg/hr)
+
<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>
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))
 
  
 +
'''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>
  
//Parallel flow
 
delti = tg1<->tw1
 
delt0 = tg2<->tw2
 
A = φ<*>(log(delt0</>delti))</>(U<*>(delt0<->delti))
 
L = A</>(π<*>D)
 
//answer:1.48m
 
  
 +
'''ExampleS5: Engineering Economics<br>'''
 +
'''RateOfEarnings'''<br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3code5a <span style="color:blue;"> z3 code: Using Function]</span><br>
  
//Contra Flow
+
 
delti = tg1<->tw2
+
'''ExampleS6: Fluid Mechanics<br>'''
delt0 = tg2<->tw1
+
'''BernoullisPressure'''<br>
A = φ<*>(log(delt0</>delti))</>(U<*>(delt0<->delti))
+
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples1#z3code6a <span style="color:blue;"> z3 code: Using Function]</span><br>
L = A</><*>D)
+
<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>
//answer:1.44m</source>
+
 
 +
 
 +
==Examples of Java and z3 Programs==
 +
'''ExampleR1: Check if number is Odd/Even'''<br>
 +
<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>
 +
 
 +
'''ExampleR4: Floyd's Triangle'''<br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes4a <span style="color:blue;"> Java code]</span><br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes4b <span style="color:blue;"> z3 code]</span><br>
 +
 
 +
'''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>
 +
 
 +
'''ExampleR6: Calculate the Factorial of a number'''<br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes6a <span style="color:blue;"> Java code]</span><br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes6b <span style="color:blue;"> z3 code]</span><br>
 +
 
 +
'''ExampleR7: Area of Rectangle'''<br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes7a <span style="color:blue;"> Java code]</span><br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes7b <span style="color:blue;"> z3 code]</span><br>
 +
 
 +
'''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>
 +
 
 +
'''ExampleR9: Ascending Order'''<br>
 +
<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>
 +
 
 +
'''ExampleR10: Inputting Matrix and Calculating it's Inverse'''<br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes10a <span style="color:blue;"> Java code]</span><br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes10b <span style="color:blue;"> z3 code]</span><br>
 +
 
 +
'''ExampleR11: Inputting 2 Matrices and Calculating Sum,Difference and Product'''<br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes11a <span style="color:blue;"> Java code]</span><br>
 +
<span class="plainlinks">[http://wiki.zcubes.com/Manuals/calci/Examples#z3codes11b <span style="color:blue;"> z3 code]</span><br><br>
 +
 
 +
==Unit Conversion Examples==
 +
'''ExampleP1: FrictionFactor'''<br>
 +
<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>
 +
 
 +
'''ExampleP2: ReynoldsNumber'''<br>
 +
<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>
 +
 
 +
'''ExampleP3: FouriersLaw'''<br>
 +
<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>
 +
 
 +
'''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>
 +
 
 +
'''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