Difference between revisions of "UTS Senno"
Ahmadsennop (talk | contribs) |
Ahmadsennop (talk | contribs) |
||
Line 4: | Line 4: | ||
print('massa balok 1') | print('massa balok 1') | ||
+ | |||
a =eval(input()) | a =eval(input()) | ||
+ | |||
print('massa balok 2') | print('massa balok 2') | ||
+ | |||
b =eval(input()) | b =eval(input()) | ||
+ | |||
print('massa balok 3') | print('massa balok 3') | ||
+ | |||
c =eval(input()) | c =eval(input()) | ||
+ | |||
print('massa balok 4') | print('massa balok 4') | ||
+ | |||
d =eval(input()) | d =eval(input()) | ||
Line 15: | Line 22: | ||
alfa=d/(a+b+c) | alfa=d/(a+b+c) | ||
+ | |||
print('maka didapat sinus alfa sebesar',alfa) | print('maka didapat sinus alfa sebesar',alfa) | ||
Line 20: | Line 28: | ||
sudutalfa=math.degrees(math.asin(alfa)) | sudutalfa=math.degrees(math.asin(alfa)) | ||
+ | |||
print('Jadi besar sudut alfa adalah','/n',sudutalfa,'derajat') | print('Jadi besar sudut alfa adalah','/n',sudutalfa,'derajat') | ||
Line 29: | Line 38: | ||
b = 1 | b = 1 | ||
c = 2 | c = 2 | ||
+ | |||
def diff_v (t,v): | def diff_v (t,v): |
Revision as of 20:28, 27 October 2019
Soal A
import math
print('massa balok 1')
a =eval(input())
print('massa balok 2')
b =eval(input())
print('massa balok 3')
c =eval(input())
print('massa balok 4')
d =eval(input())
print( )
alfa=d/(a+b+c)
print('maka didapat sinus alfa sebesar',alfa)
print( )
sudutalfa=math.degrees(math.asin(alfa))
print('Jadi besar sudut alfa adalah','/n',sudutalfa,'derajat')
Soal B
import numpy as np a = 5 b = 1 c = 2
def diff_v (t,v):
fungsi = a - b -c return (fungsi)
v = 0 h = 1 step_size = np.arange (0,20,h)
for t in step_size:
k1 = diff_v (t,v) k2 = diff_v ((t+0.5*h), (v+0.5*k1*h)) k3 = diff_v ((t+0.5*h), (v+0.5*k2*h)) k4 = diff_v ((t+h), (v+k1*h))
v = v + 1/6*(k1+2*k2+2*k3+k4)*h
print ('maka v setelah 20 detik adalah', v)