Difference between revisions of "Take Home Video"

From ccitonlinewiki
Jump to: navigation, search
(CODING SOAL A)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
==VIDEO MUHASABAH==
 +
 +
[[File:MUHASABAH_ALES_DANIEL.mp4|500px]]
 +
 
==CODING SOAL A==
 
==CODING SOAL A==
  
Line 14: Line 18:
  
 
u = eval(input("Koefisien gesekan = "))
 
u = eval(input("Koefisien gesekan = "))
 +
 +
a = eval(input('Percepatan= '))
  
 
alpha = eval(input("Sudut yang diketahui = ")) #ubah derajat menjadi radian
 
alpha = eval(input("Sudut yang diketahui = ")) #ubah derajat menjadi radian
Line 21: Line 27:
 
w = cos(alpha)
 
w = cos(alpha)
  
A = np.array([[1, 0, 0], [-1, 1, 0], [0, -1, 1]], dtype='float')
+
A = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]], dtype='float')
  
b = np.array([(m1*g*(v-(u*w)), m2*g*(v-(u*w)), m3*g*(v-(u*w)))])
+
b = np.array([(m1*g*(v-(u*w))-(m1*a), m2*g*(v-(u*w))-(m2*a), m3*g*(v-(u*w)))])
  
 
n = len(b)             
 
n = len(b)             
Line 36: Line 42:
 
   b[k] = (b[k] - np.dot(A[k,k+1:n],b[k+1:n]))/A[k,k]
 
   b[k] = (b[k] - np.dot(A[k,k+1:n],b[k+1:n]))/A[k,k]
 
print(list(b[k]))
 
print(list(b[k]))
 +
 +
'''VIDEO SOAL A'''
 +
 +
[[File:CODING_A_ALESDANIEL.mp4|500px]]
 +
 +
 +
==CODING SOAL B==
 +
 +
from math import *
 +
 +
from sympy import *
 +
 +
g = 9.8
 +
 +
rho = 1.2
 +
 +
area = 1.5
 +
 +
cd = eval(input('Koefisien hambat udara= '))
 +
 +
u = eval(input('Koefisien hambat gesekan= '))
 +
 +
m = eval(input('Massa kendaraan= '))
 +
 +
a = eval(input('Percepatan yang diinginkan= '))
 +
 +
v2 = eval(input('Kecepatan Akhir yang diinginkan= '))
 +
 +
v1 = 0
 +
 +
for v1 in range (0,v2):
 +
    fdrag = ((cd*area*rho*(v2**2))/2)
 +
    fz = (fdrag+(u*m*g))/m
 +
    atot = a-fz
 +
 +
t = v2/atot
 +
 +
s = v1*t+(0.5*atot*t**2)
 +
 +
print('Dengan kecepatan akhir', v2, 'm/s,', '\n','maka waktu yang ditempuh adalah', t, 's', '\n','dengan jarak', s, 'm')
 +
 +
'''VIDEO SOAL B'''
 +
 +
[[File:CODING_B_ALESDANIEL.mp4|500px]]

Latest revision as of 22:18, 29 October 2019

VIDEO MUHASABAH

CODING SOAL A

import numpy as np

from math import *

g = 9.81

m1 = eval(input("Massa benda 1= "))

m2 = eval(input("Massa benda 2= "))

m3 = eval(input("Massa benda 3= "))

u = eval(input("Koefisien gesekan = "))

a = eval(input('Percepatan= '))

alpha = eval(input("Sudut yang diketahui = ")) #ubah derajat menjadi radian

v = sin(alpha)

w = cos(alpha)

A = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]], dtype='float')

b = np.array([(m1*g*(v-(u*w))-(m1*a), m2*g*(v-(u*w))-(m2*a), m3*g*(v-(u*w)))])

n = len(b) for k in range(0,n-1):

 for i in range (k+1,n):
   if a[i,k] != 0.0:
     lam = a[i,k]/a[k,k]
     a[i,k+1:n] = a[i,k+1:n]-lam*a[k,k+1:n]
     b[i] = b[i] - lam*b[k]

for k in range(n-1,-1,-1):

 b[k] = (b[k] - np.dot(A[k,k+1:n],b[k+1:n]))/A[k,k]

print(list(b[k]))

VIDEO SOAL A


CODING SOAL B

from math import *

from sympy import *

g = 9.8

rho = 1.2

area = 1.5

cd = eval(input('Koefisien hambat udara= '))

u = eval(input('Koefisien hambat gesekan= '))

m = eval(input('Massa kendaraan= '))

a = eval(input('Percepatan yang diinginkan= '))

v2 = eval(input('Kecepatan Akhir yang diinginkan= '))

v1 = 0

for v1 in range (0,v2):

   fdrag = ((cd*area*rho*(v2**2))/2)
   fz = (fdrag+(u*m*g))/m
   atot = a-fz

t = v2/atot

s = v1*t+(0.5*atot*t**2)

print('Dengan kecepatan akhir', v2, 'm/s,', '\n','maka waktu yang ditempuh adalah', t, 's', '\n','dengan jarak', s, 'm')

VIDEO SOAL B