solve_emr: Solve the model

Description Usage Arguments Value Examples

View source: R/solve_emr.R

Description

Solve the model

Usage

1
solve_emr(model, start = NULL, method = "BB", ...)

Arguments

model

a named list with params, variables and equations.

start

a vector with start values for undefined variables. If NULL, the currente value will be used.

method

the solver to be used: BB or nleqslv

...

the other arguments to be passed into the solver control argument.

Value

Returns data and information about the model and its solution

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(emr)

sa_model <- simple_armington(
v0 = c(60, 30, 10),
eps = c(1, 10, 10),
eta = -1,
sigma = 4,
regions = c("dom", "sub", "nsub")
)

# tau is the power tariff change
# Increase the tariff in 10 percent for the sub region
sa_model$params$tau$value['sub'] <- 1.1

sol <- solve_emr(sa_model)

sol$variables

paulofelipe/emr documentation built on July 23, 2021, 7:31 p.m.