Mostrar código
$VPL
[1] -9723.49
$TIR_aprox
[1] 0.0671
Apresentação de Abertura da Disciplina
2025-08-08
Ver Ementário e demais informações em Site prof. RhOzon
Responder o questionário de perfil em Google Forms (usuário FAE)
“O risco vem de não saber o que você está fazendo.” — (Buffett 1996)
Ao final do curso, você será capaz de:
| Ano | Fluxo (R$) | Observação |
|---|---|---|
| 0 | -100.000 | CAPEX + giro |
| 1 | 30.000 | FC operacional líquido |
| 2 | 35.000 | FC operacional líquido |
| 3 | 40.000 | FC + residual 10.000 |
=VPL(), =NPV(), =TIR(), =XNPV().$VPL
[1] -9723.49
$TIR_aprox
[1] 0.0671
# Fluxos de caixa e taxa mínima de atratividade (TMA)
fc = [-100000, 30000, 35000, 50000] # último inclui residual de 10k
tma = 0.12
def npv(rate, cashflows):
"""Valor Presente Líquido (VPL)."""
return sum(cf / (1 + rate) ** t for t, cf in enumerate(cashflows))
def irr_bisection(cashflows, low=0.0, high=1.0, tol=1e-8, max_iter=100):
"""
TIR aproximada via bissecção (equivalente ao uniroot do R no intervalo [low, high]).
Ajuste o intervalo se necessário (ex.: IRR > 100% ou negativa).
"""
f_low = npv(low, cashflows)
f_high = npv(high, cashflows)
if f_low * f_high > 0:
raise ValueError("NPV tem o mesmo sinal nas extremidades; amplie o intervalo de busca.")
for _ in range(max_iter):
mid = (low + high) / 2.0
f_mid = npv(mid, cashflows)
if abs(f_mid) < tol:
return mid
if f_low * f_mid < 0:
high, f_high = mid, f_mid
else:
low, f_low = mid, f_mid
return (low + high) / 2.0 # retorno após máx. iterações
vpl = npv(tma, fc)
tir = irr_bisection(fc, low=0.0, high=1.0)
resultado = {"VPL": round(vpl, 2), "TIR_aprox": round(tir, 4)}
print(resultado){'TIR_aprox': 0.0671, 'VPL': -9723.49}
“Planos simples e robustos vencem projeções excessivamente precisas.” — (Flyvbjerg 2014)
“Sem dados você é só mais uma pessoa com opinião.” — (Deming 1986)
NÃO PRECISA ENTREGAR ESTA!
Rodrigo Hermont Ozon
\(\Rightarrow\) Agradecimentos à todos os alunos presentes e demais ouvintes:
"Situations emerge in the process of creative destruction in which many firms may have to perish that nevertheless would be able to live on vigorously and usefully if they could weather a particular storm. [... Capitalism requires] the perennial gale of Creative Destruction." Schumpeter, Joseph A. (1994) [1942]. Capitalism, Socialism and Democracy. London: Routledge. pp. 82–83. ISBN 978-0-415-10762-4. Retrieved 23 November 2011.