Difference between revisions of "Tugas Baru"

From ccitonlinewiki
Jump to: navigation, search
(Created page with "from math import * m = eval(input("Massa bomb : ")) g = 9.81 cd = eval(input("koef gesek udara: ")) v0 = 0 t0 = 0 dt = 1 w = g fd = cd/m error = 100 hat = [] def dv...")
 
 
Line 55: Line 55:
  
 
credits : Eric Delbert
 
credits : Eric Delbert
 +
 +
 +
berikut adalah turunan rumus dari permasalahan diatas:
 +
 +
[[File:Turunanrumus.jpg]]
 +
 +
[[File:Turunanrumus2.jpg]]
 +
 +
[[File:Turunanrumus3.jpg]]

Latest revision as of 15:06, 6 November 2019

from math import *

m = eval(input("Massa bomb : "))

g = 9.81

cd = eval(input("koef gesek udara: "))

v0 = 0

t0 = 0

dt = 1

w = g

fd = cd/m

error = 100

hat = []

def dvdt(w,fd):

   return w-(fd*(v0)**(1.5))

while error > 0.005:

   k1 = dvdt(t0, v0)
   k2 = dvdt(t0 + 0.5*dt, v0 + 0.5 * dt *k1)
   k3 = dvdt(t0 + 0.5*dt, v0 + 0.5 * dt *k2)
   k4 = dvdt(t0 + dt, v0 + dt * k3)
   v1 = v0 +(1.0/6.0)*(k1 + k2 * 2 + k3*2 + k4)
   t0 = t0 + dt
   error = ((v1-v0)/v1)*100
   v0 = v1
   hat.append(v1)

waktu = len(hat)

print ("tmaks: ", waktu +1)

print("Vt: ", v1)



credits : Eric Delbert


berikut adalah turunan rumus dari permasalahan diatas:

File:Turunanrumus.jpg

File:Turunanrumus2.jpg

File:Turunanrumus3.jpg