Giter Site home page Giter Site logo

opt-sim-py's Introduction

Opt-Sim-Py

Repositório para a disciplina de otimização e simulação.

Nota: Trabalhos e 2 projetos (em grupo)

O problema escolhe a linguagem, não vocês - Peretta

Calculo Numérico

Como o computador faz cálculos?

Untitled

Mantissa → Coeficiente do 2 é negativo (primeiro bit é 2⁻¹ até 2⁻²³)

Expoente → Coeficiente do 2 é positivo (primeiro bit é 2⁸ até 2⁰)

Épsilon de Máquina

Untitled

Derivada Numérica

import numpy as np
import matplotlib.pyplot as plt

def dfdt(f,t):
	h = 2**-36
	return(f(t+h) - f(t-h))/(2*h)

t = np.linspace(0,2*np*pi, 100)
fun = lambda t : np.sin(t)
plt.plot(t,fun(t), 'b', label='seno')
plt.plot(t,dfdt(fun,t)), 'b', label='cosseno')
plt.legend()
plt.show()

Trabalho 01 - First Exercise

first derivative dfdt(f,t) = (f(t+h) - f(t-h))/(2*h) Untitled

second derivative d²/dt² f(t) = d/dt(d/dt f(t))

d/dt sin = cos

Untitled


Trabalho 02 - Second Exercise

  • Least squares problem Untitled
  • Linear solving of systems
  • Polynomial Interpolation Untitled

Trabalho 03 - Third Exercise

  • LP Problem of optimization

Results:

Number_of_employees_that_work_on_monday = 8.0
Number_of_employees_that_work_on_tuesday = 0.0
Number_of_employees_that_work_on_wednesday = 3.0
Number_of_employees_that_work_on_thursday = 5.0
Number_of_employees_that_work_on_friday = 2.0
Number_of_employees_that_work_on_saturday = 3.0
Number_of_employees_that_work_on_sunday = 2.0
Total Number of Employees =  23.0

Diferenças Finitas

Aleatoriedade

Box-muller Exercise

Untitled

Monte Carlo

Gambler's Ruin

Untitled Se o jogador tem menos de 50% de chance de ganhar, ele não deve apostar.

Markov Chain

Uma forma de usar estados não-determinísticos para conseguir probabilidades de mudanças com base em dados históricos. É uma simulação estocástica, então, é necessário simular várias vezes e fazer uma média do valor de interesse.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.