numerical methods lab report
Post on 23-Feb-2018
240 Views
Preview:
TRANSCRIPT
7/24/2019 Numerical Methods Lab Report
http://slidepdf.com/reader/full/numerical-methods-lab-report 1/7
Problem:
The 80 lb ball is supported from the horizontal ring using three springs each having an
unstretched length of 1.5 ft and stiffness of k = 50 lbft. !etermine the distance " from
the ring to point # for e$uilibrium.
#nal%tical &olution:
&ince the three springs are e$uidistant 'ith each other( the tensions of the three springsthen are e$ual.
"et " = stretched length
1.5
" h )*% = 0
+ F ( h L )=W
'here , = "-15
3 (50)( L−15)√ L2−(15)2
L=80
15 ( L−15 )√ L2−(15 )2
2a=8
7/24/2019 Numerical Methods Lab Report
http://slidepdf.com/reader/full/numerical-methods-lab-report 2/7
225 ( L2
−3 L+2.25 ) ( L2
−2.25 )=64 L2
5 L4−675 L
3−64 L2+1518.75 L−1139 .0625=0
" = . ft
/umerical &olution:
5 L4−675 L
3−64 L2+1518.75 L−1139 .0625=0
teration /umber 1
,u: 1 ,l: + ,r: a: 100.002
teration /umber
,u: ,l: + ,r: .5 a: 0.002
teration /umber +
,u: ,l: .5 ,r: .5 a: 11.112
teration /umber 3
,u: ,l: .5 ,r: .15 a: 5.882
teration /umber 5
,u: .15 ,l: .5 ,r: .1845 a: .82
teration /umber
,u: .1845 ,l: .5 ,r: .188 a: 1.312
teration /umber 4
,u: .188 ,l: .5 ,r: .+33 a: 0.402
7/24/2019 Numerical Methods Lab Report
http://slidepdf.com/reader/full/numerical-methods-lab-report 3/7
teration /umber 8
,u: .188 ,l: .+33 ,r: . a: 0.+52
teration /umber 6
,u: .188 ,l: . ,r: .4 a: 0.182
teration /umber 10
,u: .4 ,l: . ,r: .3 a: 0.062
teration /umber 11
,u: .4 ,l: .3 ,r: .+ a: 0.032
&ource 7ode:
package bisection
import static 9ava.lang.ath.
import static 9ava.lang.ath.abs
import static 9ava.lang.ath.po'
import 9ava.math.;oundingode
import 9ava.te,t.!ecimal*ormat
import 9ava.util.&canner
<< <
< author #,l ;o% 7abatana
<
public class >&7T?/ @
7/24/2019 Numerical Methods Lab Report
http://slidepdf.com/reader/full/numerical-methods-lab-report 4/7
static &canner in = ne' &cannerA&%stem.inB
public static void mainA&tringCD argsB @ double ,r = 0( ,rEold = 0( func
!ecimal formatter
!ecimal*ormat d = ne' !ecimal*ormatAFGG.GGGGFB
d.set;oundingodeA;oundingode.H#"*EIPB
&%stem.out.printlnAF>&7T?/ TH?! JnFB
&%stem.out.printAFThe *unction is fA,B = 5"K3-45"K+-3"KL1518.45"-
11+6.05 Jn JnFB &%stem.out.printAFnter number of terations: FB
int z = in.ne,tntAB
&%stem.out.printAFnter ,l and ,u: FB
double ,u = in.ne,t!oubleAB
double ,l = in.ne,t!oubleAB
&%stem.out.printlnAFFB
for Aint i = 1 i M= z iLLB@
&%stem.out.printAFteration /umber F L i LFJnFB
,rEold = ,r
,r = A,uL,lB
func = A5<po'A,r( 3BB-A45<po'A,r(+BB-A3<po'A,r(BBLA1518.45<,rB-11+6.05
&%stem.out.printAF,u: FL d.formatA,uBB
&%stem.out.printAF ,l: F L d.formatA,lBB
7/24/2019 Numerical Methods Lab Report
http://slidepdf.com/reader/full/numerical-methods-lab-report 5/7
if Afunc N= 0B @
,l = ,r
O else @
,u = ,r O
double # = absAA,r-,rEoldB,rB<100
&%stem.out.printAF ,r: F L d.formatA,rB L F a: FB
&%stem.out.printfAF2.fF(#B
&%stem.out.printAF2FB
&%stem.out.printlnAFJnFB O
O
O
&creenshot:
7/24/2019 Numerical Methods Lab Report
http://slidepdf.com/reader/full/numerical-methods-lab-report 6/7
top related