Difference between revisions of "AZ"

From ccitonlinewiki
Jump to: navigation, search
m (UTS No.1)
m (Anggitoz moved page Muhammad Anggito Zhafranny to AZ: hide personal information)
 
(8 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
 
== Profile ==
 
== Profile ==
 
[[File:Anggitoz ava.JPG|thumb|200px|Profile Pics]]
 
Nama: ''MUHAMMAD ANGGITO ZHAFRANNY''
 
<Br> NPM : ''1706027761''
 
<Br>
 
<Br> For further information about the creator/user, [http://air.eng.ui.ac.id/index.php?title=User:Anggitoz Click Here]
 
  
  
Line 74: Line 68:
  
 
''The Iterative Method'' is a mathematical way of solving a problem which generates a sequence of approximations. This method is applicable for both linear and nonlinear problems with large number of variables.
 
''The Iterative Method'' is a mathematical way of solving a problem which generates a sequence of approximations. This method is applicable for both linear and nonlinear problems with large number of variables.
 
----
 
  
 
[[File:29244.png]]
 
[[File:29244.png]]
Line 91: Line 83:
  
 
Bisa kita bandingkan dan simpulkan bahwa 0/0 tidak konsisten atau undefined/
 
Bisa kita bandingkan dan simpulkan bahwa 0/0 tidak konsisten atau undefined/
 
----
 
  
 
'''New Terms'''
 
'''New Terms'''
Line 135: Line 125:
 
       '| failed to calculate: ' + str(i) + ' times' )
 
       '| failed to calculate: ' + str(i) + ' times' )
 
</div>
 
</div>
 +
 +
----
  
 
===3rd Session===
 
===3rd Session===
Line 140: Line 132:
 
Missed 3rd Session
 
Missed 3rd Session
  
 +
----
  
 
===4th Session===
 
===4th Session===
Line 149: Line 142:
 
'''Systems of Linear Algebraic Equations'''
 
'''Systems of Linear Algebraic Equations'''
  
'''Pr / Hiburan'''
+
'''Pr / Hiburan II'''
  
 
[[File:PR_sesi_4.jpg]]
 
[[File:PR_sesi_4.jpg]]
Line 200: Line 193:
 
[[File:13124141431.png|500px]]
 
[[File:13124141431.png|500px]]
  
 +
----
  
 
===5th Session===
 
===5th Session===
Line 208: Line 202:
  
 
'''
 
'''
 +
 +
----
  
 
===6th Session===
 
===6th Session===
Line 216: Line 212:
  
 
'''Runge-Kutta Method'''
 
'''Runge-Kutta Method'''
 +
 +
----
  
 
===7th Session - QUIZ===
 
===7th Session - QUIZ===
Line 254: Line 252:
 
====QUIZ 02====
 
====QUIZ 02====
  
Menggunakan modul printSoln dan run_kut4
+
Menggunakan modul printSoln dan '''run_kut4'''
  
 
<div border-style: inset;">
 
<div border-style: inset;">
'''run_kut4'''
+
import numpy as np
import numpy as np
+
def integrate(F,x,y,xStop,h):
def integrate(F,x,y,xStop,h):
 
 
 
 
     def run_kut4(F,x,y,xStop,h):
 
     def run_kut4(F,x,y,xStop,h):
 
         K0 = h*F(x,y)
 
         K0 = h*F(x,y)
Line 267: Line 263:
 
         K3 = h*F(x+h,y+K2)
 
         K3 = h*F(x+h,y+K2)
 
         return (K0+2*K1+2*K2+K3)/6
 
         return (K0+2*K1+2*K2+K3)/6
    X = []
+
X = []
    Y = []
+
Y = []
 +
X.append(x)
 +
Y.append(y)
 +
while x < xStop:
 +
    h = min(h,xStop - x)
 +
    y = y + run_kut4(F,x,y,xStop,h)
 +
    x = x+h
 
     X.append(x)
 
     X.append(x)
 
     Y.append(y)
 
     Y.append(y)
    while x < xStop:
 
        h = min(h,xStop - x)
 
        y = y + run_kut4(F,x,y,xStop,h)
 
        x = x+h
 
        X.append(x)
 
        Y.append(y)
 
 
     return np.array(X),np.array(Y)
 
     return np.array(X),np.array(Y)
  
Line 286: Line 282:
 
  from run_kut4 import *
 
  from run_kut4 import *
 
  from printSoln import *
 
  from printSoln import *
  from math import exp
+
  from math import exp<Br>
 
 
 
  x = 0.03
 
  x = 0.03
 
  def F(x,y):
 
  def F(x,y):
 
     F = np.zeros(1)
 
     F = np.zeros(1)
 
     F[0] = ((31/32)*exp(-4))+((1/4)*x**2)-(1/8)*x+(1/32)
 
     F[0] = ((31/32)*exp(-4))+((1/4)*x**2)-(1/8)*x+(1/32)
     return F
+
     return F<Br>
 
+
  x    = 0.0            <span style="color:#ff0000"># Start of integration</span>
  x    = 0.0            # Start of integration
+
  xStop = 0.03           <span style="color:#ff0000"># End of integration</span>
  xStop = 0.03             # End of integration
+
  y    = np.array([1])  <span style="color:#ff0000"># Initial values of {y}</span>
  y    = np.array([1])  # Initial values of {y}
+
  h    = 0.01           <span style="color:#ff0000"># Step size</span>
  h    = 0.01             # Step size
+
  freq  = 1               <span style="color:#ff0000"># Printout frequency</span><Br>
  freq  = 1             # Printout frequency
+
  print(y)<Br>
 
 
  print(y)
 
 
 
 
  X,Y = integrate(F,x,y,xStop,h)
 
  X,Y = integrate(F,x,y,xStop,h)
 
  printSoln(X,Y,freq)
 
  printSoln(X,Y,freq)
Line 307: Line 299:
 
</div>
 
</div>
  
=== UTS ===
+
----
 +
 
 +
=== Ujian Tengah Semester ===
  
 
==== UTS No.1 ====
 
==== UTS No.1 ====
Line 327: Line 321:
 
<div border-style: inset;">
 
<div border-style: inset;">
 
  import math
 
  import math
  import numpy as np
+
  import numpy as np<Br>
<Br>
 
 
  <span style="color:#ff0000"># Define Matrices </span>
 
  <span style="color:#ff0000"># Define Matrices </span>
 
  A = np.array([[1., 0., 0.],
 
  A = np.array([[1., 0., 0.],
 
             [-1., 1., 0.],
 
             [-1., 1., 0.],
 
             [0., -1., 1.]], float)
 
             [0., -1., 1.]], float)
  B = np.array([6, 5, 4], float)
+
  B = np.array([6, 5, 4], float)<Br>
<Br>
+
  n = len(A)<Br>
  n = len(A)
 
<Br>
 
 
  <span style="color:#800080">print</span>('Matriks A adalah:')
 
  <span style="color:#800080">print</span>('Matriks A adalah:')
 
  <span style="color:#800080">print</span>(A,'\n')
 
  <span style="color:#800080">print</span>(A,'\n')
 
  <span style="color:#800080">print</span>('Matriks A memiliki ', n , ' baris','\n')
 
  <span style="color:#800080">print</span>('Matriks A memiliki ', n , ' baris','\n')
 
  <span style="color:#800080">print</span>('Matriks B adalah:')
 
  <span style="color:#800080">print</span>('Matriks B adalah:')
  <span style="color:#800080">print</span>(B,'\n')
+
  <span style="color:#800080">print</span>(B,'\n')<Br>
<Br>
 
 
  <span style="color:#ff0000"># Gauss Elimination </span>
 
  <span style="color:#ff0000"># Gauss Elimination </span>
 
  for k in range(0,n-1):
 
  for k in range(0,n-1):
Line 349: Line 339:
 
             lam = A[i,k]/A[k,k]  
 
             lam = A[i,k]/A[k,k]  
 
             A[i,k:n] = A[i,k:n]-(A[k,k:n]*lam)
 
             A[i,k:n] = A[i,k:n]-(A[k,k:n]*lam)
             B[i] = B[i]-(B[k]*lam)
+
             B[i] = B[i]-(B[k]*lam)<Br>
<Br>
+
  <span style="color:#800080">print</span>('matrix A:', '\n', A, '\n')<Br>
  <span style="color:#800080">print</span>('matrix A:', '\n', A, '\n')
 
<Br>
 
 
  <span style="color:#ff0000"># Back Substitution </span>
 
  <span style="color:#ff0000"># Back Substitution </span>
 
  <span style="color:#800080">print</span>('Nilai Tegangan masing-masing adalah:')
 
  <span style="color:#800080">print</span>('Nilai Tegangan masing-masing adalah:')
Line 360: Line 348:
 
     <span style="color:#800080">print</span>('T',m+1,'=', x[m])
 
     <span style="color:#800080">print</span>('T',m+1,'=', x[m])
 
</div>
 
</div>
 +
 +
----
  
 
==== UTS No.2 ====
 
==== UTS No.2 ====
Line 371: Line 361:
 
</gallery>
 
</gallery>
  
''Youtube''
+
'''Youtube'''
  
 
<youtube width="200" height="100">xxxxxxxxx</youtube>
 
<youtube width="200" height="100">xxxxxxxxx</youtube>
  
''Kodingan''
+
'''Kodingan'''
  
 
<div border-style: inset;">
 
<div border-style: inset;">
  
 
</div>
 
</div>
 +
 +
----
 +
 +
==== Refleksi Diri ====
 +
 +
Video ini adalah kegiatan merangkum hal yang saya dapat selama setengah semester belajar Metode Numerik bersama Dr. Ahmad Indra
 +
 +
<youtube width="200" height="100">https://youtu.be/_mDlvhNTi7s</youtube>
  
 
== Fluid Mechanics ==
 
== Fluid Mechanics ==

Latest revision as of 20:17, 5 October 2024

Left  THIS IS FINE This Page isn't Completed Yet the deadline is near. Help.


Profile

Core Python

Numpy, SciPy, and Matplotlib

 (work) C:\DEV>python -m pip install numpy
 (work) C:\DEV>python -m pip install scipy
 (work) C:\DEV>python -m pip install matplotlib

'Numpy' is the core library for scientific computing in Python. It provides a high-performance multidimensional array object, and tools for working with these arrays. If you are already familiar with MATLAB, you might find this tutorial useful to get started with Numpy. Numpy provides a high-performance multidimensional array and basic tools to compute with and manipulate these arrays. 'SciPy' builds on this, and provides a large number of functions that operate on numpy arrays and are useful for different types of scientific and engineering applications.

'Matplotlib' is a plotting library. In this section give a brief introduction to the matplotlib.pyplot module, which provides a plotting system similar to that of MATLAB.

Then click enter and appeared to be like this:

Installing numpy scipy and matplotlib.jpg

Python Tutorial

Link Click Here and click https://en.wikibooks.org/wiki/Python_Programming/Basic_Math also from here learnpython.org

Numerical Methods

This section serves as my study journal of Numerical Methods through my Fifth Semester at DTM UI.

1st Session

Lecturer : Dr. Ahmad Indra and Dr. Ir. Engkos Kosasih

Date : 02 September 2019

Introduction

Class is being held at Class GK201. A Computer Laboratory. The class was supposed being held by Mr. Achmad Riadi and Dr. Ir. Engkos A. Kosasih yet suprising moments happen when Dr. Ahmad Indra Siswantara or Pak DAI appearing instead. Pak Engkos appeared after a half hour.

At the beginning, Pak DAI told us the essence of praying before studying, the meaning of our purpose of studying and also the difference of us, engineers and accountant at viewing measurement tolerance before and then we continue to introduction of Numerical Methods. An accountant and economist would see measurement down to every detail like how they counting country's debt down to double digit cent while we engineers are so tolerant at measurements as long as it does not create trouble or mishaps at designed machine or system.

According to Pak Engkos, Numerical Method is simply how to using algorythim and equation we learn from prior subject we learn (ex. Engineering Mathematics) and how to communicate or speak language of computer in order to achieve the results of process a large equation that might be impossible to calculated by human minds alone. Any equations that can be completed with numerics can also be attained by exact way but not vice versa. Human might can calculate first or second order, but in higher order we need to use engineering computation to attain results efficiently and quicker. It's is not something we can calculated with paper in higher order, said Pak Engkos.

Tools of Numerical Methods: Python, C++, Java, etc. Any computation language is eligible to use said Pak DAI and seems picking using python as tools.

2nd Session

Lecturer : Dr. Ahmad Indra Siswantara

Date : 09 September 2019

Iterative Method

There is no term of Common Sense, rather any sense or mind is right and the wrong ones is our intrigue, temptation, and sort off...
- Pak DAI

The Iterative Method is a mathematical way of solving a problem which generates a sequence of approximations. This method is applicable for both linear and nonlinear problems with large number of variables.

29244.png

mengapa hasilnya 2 tidak 0/0?

Angka bulat itu tidak ada.

TL;DR

  • 0/0 tidak konsisten karena jika persamaan ini dihadapkan dengan beberapa kasus atau argumen maka bisa didapatkan berbeda hasil, padahal jika dalam eksakta, aturannya adalah hasil persamaan tidak bisa diubah, pasti atau bisa disamakan dengan absolut.

ada beberapa aturan yang kita tahu dari persamaan dengan 0 dan bilangan bulat:

  • Jika (a/0)=infinit, jika a=0 maka 0/0=infinit
  • Jika (0/b)=0, jika b=0 maka 0/0=0
  • Jika (c/c)=1, jika c=0 maka 0/0=1

Bisa kita bandingkan dan simpulkan bahwa 0/0 tidak konsisten atau undefined/

New Terms

  • Perhitungan komputasi undefined/tidak konsisten/error cannot appeared on computer.
  • Discrete >< Continous
> Discrete can only take certain values. Not Decimal.
> Continous can take any value (within a range).
  • Algoritma is an arrangement of instructions to solve problems.
  • Flowchart a diagram that uses a set of standard graphic symbols to represent the sequence of coded instructions fed into a computer, enabling it to perform specified logical and arithmetical operations.
  • Program consists of compiled code that can run directly from the computer's operating system.

PR / Hiburan I

Cari x di persamaan berikut menggunakan peranti lunak Python
80092.png

Results
def f(x): 
   return 8*x**3 + 2*x**2 + x - 1
def fprime(x):
   return 24*x**2 + 4*x +1

ep = 0.001
gu = -10 i = 0
print('8*x**3 + 2*x**2 + x - 1')
print('Results by Python 3.7')
while abs(f(gu)) >= ep: gu = gu - (f(gu)/fprime(gu)) i += 1 print(' ' + str(i) + ' ' + str(round(gu,7)))
print('The root approach is ' + str(round(gu,2)) + '| failed to calculate: ' + str(i) + ' times' )

3rd Session

Missed 3rd Session


4th Session

Lecturer : Dr. Ahmad Indra and assistant Edo

Date : 23 September 2019

Systems of Linear Algebraic Equations

Pr / Hiburan II

PR sesi 4.jpg

Convert to array/matrix equation in order to eliminate it using Gaussian Elimination. Thus its equation and matrix are:

 6x1 - 4x2 = 50
-2x1 - x3 + 4x4 = 50
-7x2 + 3x3 + 4x4 = 0
 4x1 - 4x3 = 0

Therefore resulting this in matrix

[[ 6. -4.  0. 0.]
 [-2.  0. -1. 4.]
 [ 0. -7.  3. 4.]
 [ 4.  0. -4. 0.]]

Then define those matrix in python.

import numpy as np

A = np.array([[6, -4, 0, 0], [-2, 0 ,-1, 4], [0, -7, 3, 4], [ 4, 0, -4, 0]], float) B = np.array([50, 50, 0, 0], float)
n = len(A)

Use Gaussian 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)

Back Subtitution

x = np.zeros(n,float)
for m in range(n-1,-1,-1):
    x[m]=(B[m]-np.dot(A[m,m+1:n],x[m+1:n]))/A[m,m]

Results

13124141431.png


5th Session

Lecturer : Dr. Ahmad Indra

Date : 30 September 2019


6th Session

Lecturer : Dr. Ahmad Indra

Date : 7 Oktober 2019

Runge-Kutta Method


7th Session - QUIZ

QUIZ 01

import numpy as np
A=np.array([[1., 2., 0., -2., 0.],
           [0., 1., 0., 2., -1.],
           [0., 0., 2., 1., 2.],
           [0., 0., 0., -1., 1.],
           [0., 1., -1., 1., -1.]], float)
B=np.array([1, 1, -4, -2, -1], float)

n = len(A)
print('Matriks A adalah:') print(A,'\n') print('Matriks A memiliki ', n , ' baris','\n') print('Matriks B adalah:') print(B,'\n') 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) print('Nilai x masing-masing adalah:') x = np.zeros(n,float) for m in range(n-1,-1,-1): x[m]=(B[m]-np.dot(A[m,m+1:n],x[m+1:n]))/A[m,m] print('C',m+1,'=', x[m])

Quiz01 no 1.jpg

QUIZ 02

Menggunakan modul printSoln dan run_kut4

import numpy as np
def integrate(F,x,y,xStop,h):
   def run_kut4(F,x,y,xStop,h):
       K0 = h*F(x,y)
       K1 = h*F(x+h/2, y+K0/2)
       K2 = h*F(x+h/2, y+K1/2)
       K3 = h*F(x+h,y+K2)
       return (K0+2*K1+2*K2+K3)/6
X = []
Y = []
X.append(x)
Y.append(y)
while x < xStop:
   h = min(h,xStop - x)
   y = y + run_kut4(F,x,y,xStop,h)
   x = x+h
   X.append(x)
   Y.append(y)
   return np.array(X),np.array(Y)

Quiz no.2

#!/usr/bin/python
## example7_5
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 # Start of integration xStop = 0.03 # End of integration y = np.array([1]) # Initial values of {y} h = 0.01 # Step size freq = 1 # Printout frequency
print(y)
X,Y = integrate(F,x,y,xStop,h) printSoln(X,Y,freq) input("\nPress return to exit")

Ujian Tengah Semester

UTS No.1

Hasil Pengerjaan, Click to enlarge

Youtube

Kodingan

import math
import numpy as np
# Define Matrices A = np.array([[1., 0., 0.], [-1., 1., 0.], [0., -1., 1.]], float) B = np.array([6, 5, 4], float)
n = len(A)
print('Matriks A adalah:') print(A,'\n') print('Matriks A memiliki ', n , ' baris','\n') print('Matriks B adalah:') print(B,'\n')
# 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, '\n')
# Back Substitution print('Nilai Tegangan masing-masing adalah:') x = np.zeros(n,float) for m in range(n-1,-1,-1): x[m]=(B[m]-np.dot(A[m,m+1:n],x[m+1:n]))/A[m,m] print('T',m+1,'=', x[m])

UTS No.2

Hasil Pengerjaan, Click to enlarge

Youtube

Kodingan


Refleksi Diri

Video ini adalah kegiatan merangkum hal yang saya dapat selama setengah semester belajar Metode Numerik bersama Dr. Ahmad Indra

Fluid Mechanics

Here lies my case studies that examine a set of problems from textbook Fundamentals of Fluid Mechanics by Munson; Young; Okiishi; and Huebsch. I upload it in form of my handwriting on folio paper, youtube videos and text. Mainly text in Indonesian, i supposed. Mainly created as Mr. DAI instructed it to us as homework. Hope this helps your studies; Tschuss

Chapter 8: Viscous Flowin Pipes

Summary & Study Case on Folio Click to enlarge.

Chapter ini membahas tentang karakteristik aliran didalam pipa. Perpindahan energi terjadi akibat terjadi perubahan pressure atau tekanan seiring perpindahan dari titik A ke titik B.

Youtube


Chapter 9: Flow Over Immersed Bodies

Summary & Study Case on Folio Click to enlarge.

Chapter ini membahas tentang karakteristik aliran luar yang melewati benda terendam. Contoh terdekatnya adalah Ikan yang berenang didalam air. Aliran luar juga sering disebut aerodinamika. Ilmu ini diaplikasikan dalam mendesain transportasi pesawat terbang, mobil, maupun kapal selam dengan memperhatikan gaya fluida (Lift-Drag) dan Lapisan Batas suatu aliran akibat benda yang terendam.

Youtube


Chapter 10: Open-Channel Flow

Summary & Study Case on Folio Click to enlarge.

Berbeda dengan Bab 8, Bab 10 ini melibatkan aliran-aliran yang mengalir dalam kanal dan pipa yang tidak terisi sepenuhnya. Contoh aslinya adalah sungai yang berada disekeliling kita, tetapi itu masih tergolong rumit karena memerlukan pengukuran geometri dari sungai tersebut. Perbedaan signifikan antara bab 8 dan bab 10 terletak pada perubahan tekanan sebagai penggeraknya. Open-Channel Flow tidak memiliki perubahan tekanan sebagai penggerak melainkan kemiringan atau gradien dasar kanal sebagai penggerak.

Important Equation

Left


Youtube


Chapter 11: Compressible Flow

Summary & Study Case on Folio Click to enlarge.

Membahas tentang aliran mampu-mampat yang pada dasarnya jika menyertakan persamaan kontinuitas massa, maka densitas juga ikut berubah seiring perpindahannya melewati duct konvergen-divergen atau sebaliknya. Mempelajari karakteristik aliran jika memasuki duct, dalam arti laju dll.

Youtube


References

Fluid Mechanics

  1. MUNSON, B. R., YOUNG, D. F., & OKIISHI, T. H. (2006). FUNDAMENTALS OF FLUID MECHANICS. Hoboken, NJ, J. Wiley & Sons.

Numerical Method

  1. KIUSALAAS, J. (2013). NUMERICAL METHODS IN ENGINEERING WITH PYTHON. Tribeca, NY, Cambridge University Press