Difference between revisions of "Pembahasan 3A"

From ccitonlinewiki
Jump to: navigation, search
(Created page with "'''Cara 1''' from numpy import linalg import numpy as np import math #penginputan data. dengan asumsi tidak ada gesekan dan sistem seimbang (percepatan=0) m1 = int(input("Ma...")
 
 
Line 38: Line 38:
 
print ("hasil sina adalah :")
 
print ("hasil sina adalah :")
 
print (sina)
 
print (sina)
[[File:n1a|500px|thumb|center]]
+
[[File:n1a.png|500px|thumb|center]]
[[File:n1b|500px|thumb|center]]
+
[[File:n1b.png|500px|thumb|center]]
  
  
Line 63: Line 63:
 
print("Sin theta = ", sina,"")
 
print("Sin theta = ", sina,"")
  
[[File:n1c2|500px|thumb|center]]
+
[[File:n1c2.png|500px|thumb|center]]

Latest revision as of 00:17, 30 October 2019

Cara 1

from numpy import linalg 

import numpy as np import math

  1. penginputan data. dengan asumsi tidak ada gesekan dan sistem seimbang (percepatan=0)

m1 = int(input("Massa Benda 1 ? ")) m2 = int(input("Massa Benda 2 ? ")) m3 = int(input("Massa Benda 3 ? ")) p1 = int(input("sudut a ? ")) sina= math.sin(math.radians (p1)) print (sina) g = float(input("Gravitasi ? ")) print ("hasil sina adalah :") a= np.array ([[1,0,0] ,[1,1,0], [2,1,1]]) b= np.array ([[m1*sina*g],[(2*m1+m2)*sina*g],[((2*(2*m1+m2))+m3)*sina*g]]) c= np.array ([[1,0,0,m1*sina*g] ,[1,1,0,(2*m1+m2)*sina*g], [2,1,1,((2*(2*m1+m2))+m3)*sina*g]])

print ('persamaan matrix A adalah :') print (a) print ('persamaan matrix B adalah :') print (b) print ('persamaan matrix-nya adalah:') print (c) matx = a cons = b

  1. proses Gauss-Jordan

persamaan = linalg.solve (matx,cons) x1l = float(persamaan[0]) x2l = float(persamaan[1]) x3l = float(persamaan[2]) g= (x1l, x2l, x3l) print ("hasil X adalah :") print (g) print (" maka hasil T1, T2, T3 adalah") print (x1l) print (x2l) print (x3l) print ("hasil sina adalah :") print (sina)

N1a.png
N1b.png


Cara 2

import math

  1. penginputan data massa dan gravitasi

m1 = int(input("Massa Benda 1 ? ")) m2 = int(input("Massa Benda 2 ? ")) m3 = int(input("Massa Benda 3 ? ")) g = float(input("Gravitasi ? "))

  1. penghitungan sudut

p1 = int(input("sudut a ? ")) sina= math.sin(math.radians (p1)) print (sina)

  1. perhitungan Tegangan tali

T1 = m1*sina*g T2 = m2*sina*g + T1 T3 = m3*sina*g + T2 print("T1", T1) print("T2",T2) print("T3", T3) print("Sin theta = ", sina,"")

N1c2.png