[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)

1. 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])
```

SCREENSHOT HASIL

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)

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)