Soal A

From ccitonlinewiki
Revision as of 22:23, 28 October 2019 by Dikaauliady (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Video Penjelasan : https://youtu.be/KyyqYn2C-JY

import numpy as np import math

  1. 1. input massa

m1 = eval(input('massa kotak 1 adalah '))

m2 = eval(input('massa kotak 2 adalah '))

m3 = eval(input('massa kotak 3 adalah '))

m4 = eval(input('massa kotak 4 adalah '))


  1. 2. input nilai percepatan dan sudut

a = eval(input('percepatan sebesar '))

alfa = eval(input('besar sudutnya adalah ')) sinteta = round( math.sin(math.radians(alfa)),2)

g = 9.8

  1. 2. definisi matriks

x1 = x2 = x3 = (g*sinteta) - a

x4 = g + a

A = np.array ([[m1,0,0,0], [m1,m2,0,0], [m1,m2,m3,0], [0,0,0,m4]], float) x = np.array ([x1,x2,x3,x4], float)

n = len(A)

print ('matriks A :', '\n', A) print ('matriks x :', '\n',x)

  1. 3. Nilai Tegangan

T=np.dot(A,x) print ('matrix T', T)