Difference between revisions of "Nadhif Rizki Priambodo"
(→UTS Nadhif rizki p) |
(→UTS Nadhif rizki p) |
||
Line 58: | Line 58: | ||
== UTS Nadhif rizki p == | == UTS Nadhif rizki p == | ||
+ | |||
+ | [nomor 1] | ||
1. tuliskan print("Mencari input nilai m1?") | 1. tuliskan print("Mencari input nilai m1?") |
Revision as of 15:12, 21 October 2019
[Nama : Nadhif rizki priambodo]
[Semester : 5]
[Npm : 1706026140]
Mengikuti lomba kompetisi mobil hemat energi dan shell eco marathon tahun 2018-2020
HASIL QUIZ
coding
No.1
print ("QUIZ nadhif rizki p - 1706026140") A = np.array([[1, 2, 0, -2, 0], [0, 1, 0, 2, -1], [0, 1, -1, 1, -1], [0, 0, 0, -1, 1], [0, 0, 2, 1, 2]], float) B=np.array([-4, 1, -1, -2, 1],float)
n=len(A)
- menggunakan gauss elimination
for k in range (0,n-1):
for i in range (k+1, n): if A[i,k] ! = 0 lam= A[i,k]/A[k,k] A[i,k:n]= A[i,k:n]-(A[k,k:n]*lam) B[i]=B[i]-(B[k]*lam)
print ("matrix A:", "\n", A)
x=np.zeros( n,float) for m in range ( n-1, -1, -1)P:
x[m]=(B[m]-np.dot(A[m, m+1:n], x[m+1:n]))/A[m,m] print ('nilai x', m+1, '=', x[m])
NO.2
import numpy as np from run_kut4 import * from printSoln import * from math import exp
x = 0.03 def F(x,y):
F = np.zeros(1) F[0] = ((31/32)*exp(-4))+((1/4)*x**2)-(1/8)*x+(1/32) return F
x = 0.0 xStop = 0.03 y = np.array([160]) h = 0.01 freq = 1
print(y)
X,Y = integrate(F,x,y,xStop,h) printSoln(X,Y,freq) input("\nPress return to exit")
UTS Nadhif rizki p
[nomor 1]
1. tuliskan print("Mencari input nilai m1?")
a= eval (input())
2. tuliskan print("mencari input nilai m2?")
b=eval (input())
3. tuliskan print("mencari input nilai m3?")
c=eval (input())
4. tuliskan print ("mencari input nilai m4?")
d=eval (input())
alfa= d/(a+b+c) 5. print ("jadi sin alfa sama dengan ", alfa)
6. sudut alfa = math.asin(alfa)
7.sudutalfa2=math.degrees(sudutalfa)
print('jadi nilai sudut alfa adalah',sudutalfa2)