Difference between revisions of "Algoritma untuk Soal UTS"
Line 1: | Line 1: | ||
− | Soal no 1 | + | Soal no 1 tentang kesetimbangan statis |
− | |||
− | |||
− | |||
from math import * | from math import * | ||
g = 9.81 | g = 9.81 | ||
− | + | m1 = eval(input('Massa benda 1 : ')) | |
− | + | m2 = eval(input('Massa benda 2 : ')) | |
− | m1 = eval(input('Massa benda 1 : ')) | + | m3 = eval(input('Massa benda 3 : ')) |
− | m2 = eval(input('Massa benda 2 : ')) | + | a = eval(input('Sudut miring : ')) |
− | m3 = eval(input('Massa benda 3 : ')) | + | b = cos(a) |
− | a = eval(input('Sudut | + | c = sin(a) |
− | + | d = eval(input('Koefisien gesek : ')) | |
− | + | m4 = -((m1+m2+m3)*c*(1-(d*b))) | |
− | + | print('Maka Massa benda 4 adalah ', m4, ' kg') | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | print(' | ||
− | |||
− | |||
− | |||
− | |||
+ | Soal no 2 tentang kesetimbangan dinamis | ||
from math import * | from math import * | ||
− | g = 9.81 | + | g = 9.81 |
− | p = 1.2 | + | p = 1.2 |
− | + | cd = eval(input('Drag Coefficient : ')) | |
− | + | luas = eval(input('Luas: ')) | |
− | cd = eval(input('Drag Coefficient : ')) | + | v = eval(input('Kecepatan : ')) |
− | luas = eval(input('Luas: ')) | + | m = eval(input('Massa : ')) |
− | v = eval(input('Kecepatan | + | c = eval(input('Koefisien gesekan: ')) |
− | + | a = eval(input('Percepatan : ')) | |
− | + | v1 = eval (input('Kecepatan maksimum : ')) | |
− | + | fa = g*c | |
− | + | fc = (cd*luas*p*v**2)/2*m | |
− | + | f1 = a | |
− | + | dd = f1 - (fc+fa) | |
− | + | t=(v1-v)/dd | |
− | |||
− | dd = | ||
− | |||
− | |||
− | t = (v1-v)/dd | ||
print('Waktu :', t, ' s') | print('Waktu :', t, ' s') |
Revision as of 19:45, 28 October 2019
Soal no 1 tentang kesetimbangan statis
from math import * g = 9.81 m1 = eval(input('Massa benda 1 : ')) m2 = eval(input('Massa benda 2 : ')) m3 = eval(input('Massa benda 3 : ')) a = eval(input('Sudut miring : ')) b = cos(a) c = sin(a) d = eval(input('Koefisien gesek : ')) m4 = -((m1+m2+m3)*c*(1-(d*b))) print('Maka Massa benda 4 adalah ', m4, ' kg')
Soal no 2 tentang kesetimbangan dinamis
from math import * g = 9.81 p = 1.2 cd = eval(input('Drag Coefficient : ')) luas = eval(input('Luas: ')) v = eval(input('Kecepatan : ')) m = eval(input('Massa : ')) c = eval(input('Koefisien gesekan: ')) a = eval(input('Percepatan : ')) v1 = eval (input('Kecepatan maksimum : ')) fa = g*c fc = (cd*luas*p*v**2)/2*m f1 = a dd = f1 - (fc+fa) t=(v1-v)/dd print('Waktu :', t, ' s')