1
// Copyright (C) 2005 Anders Logg.
2
// Licensed under the GNU LGPL Version 2.1.
5
// Last changed: 2005-12-19
11
using namespace dolfin;
13
void ces(unsigned int m, unsigned int n, unsigned int alpha, unsigned int beta)
15
// Seed random number generator so we get the same system every time
18
PolynomialIntegerCES ec(m, n, true);
22
for (unsigned int i = 0; i < m; i++)
29
int main(int argc, const char* argv[])
31
// Parse command line arguments
34
message("Usage: dolfin-ode-homotopy-ces m n alpha beta");
36
message("m - number of traders");
37
message("n - number of goods");
38
message("alpha - 1/scaling factor");
39
message("beta - scaled exponents");
42
const unsigned int m = static_cast<unsigned int>(atoi(argv[1]));
43
const unsigned int n = static_cast<unsigned int>(atoi(argv[2]));
44
const unsigned int a = static_cast<unsigned int>(atoi(argv[3]));
45
const unsigned int b = static_cast<unsigned int>(atoi(argv[4]));
47
dolfin_set("ODE method", "cg");
48
dolfin_set("ODE order", 1);
49
dolfin_set("ODE tolerance", 1e-3);
50
dolfin_set("ODE discrete tolerance", 1e-10);
51
dolfin_set("ODE initial time step", 0.001);
52
//dolfin_set("ODE linear solver", "direct");
53
dolfin_set("ODE adaptive samples", false);
54
dolfin_set("homotopy monitoring", false);
55
dolfin_set("homotopy divergence tolerance", 10.0);
56
dolfin_set("homotopy randomize", false);
57
dolfin_set("homotopy maximum size", 100);
58
dolfin_set("homotopy maximum degree", 5);