working on it ...

Filters

Explore Public Snippets

Sort by

Found 6 snippets

    public by Marko555 modified Sep 13, 2017  105  0  2  0

    test123

    // Enter here the actual content of the snippet.						<!DOCTYPE HTML>
    <html>
    
    <head>
        <title>Ensighten Test Site</title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <meta name="description" content="" />
        <meta name="keywords" content="" />
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width,minimum-scale=1">
        <!--<script type="text/javascript" src="js/Bootstrap.js"></script>-->
        <!--<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
        <script src="js/skel.min.js"></script>
        <script src="js/skel-panels.min.js"></script>
        <script src="js/init.js"></script>-->
        
            <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Tangerine">
            <link rel="stylesheet" href="css/style.css" />
            <link rel="stylesheetz" href="css/style-desktop.css" />
       
        <link rel="canonical" href="/ensighten-luka-test.eu.pn/left-sidebar.html">
       <script type="text/javascript" src="//nexus.ensighten.com/ens-devtech/luka/Bootstrap.js"></script>
       <script async src="https://cdn.ampproject.org/v0.js"></script> 
       <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
       <meta name="amp-google-client-id-api" content="googleanalytics">
    </head>
    
    <body class="homepage">
    
    
        
    
    <!-- <div id="fbAds"></div>
    <figure></figure> -->
    
        <!-- Header -->    
    
        <div id="header">
            <div id="nav-wrapper">
                <!-- Nav -->
                <nav id="nav">
                
                    <ul>
                        <li class="active"><a href="index.html?adxcel_clickid=34re4">Homepage</a></li>
                        <li><a href="left-sidebar.html" id="button">Left Sidebar</a></li>
                        <li><a href="right-sidebar.html">Right Sidebar</a></li>
                        <li><a href="no-sidebar.html">No Sidebar</a></li>
                    </ul>
                </nav>
            </div>
            <div class="container">
                <!-- Logo -->
                <div id="logo">
                    <h1>&lt;&#8226;&gt;</h1>
                    <span class="tag">SandBox</span>
                </div>
            </div>
        </div>
        <!-- Featured -->
        <div id="featured">
            <div class="container">
                <header>
                    <h2>Welcome to SandBox test site</h2>
                
                </header>
               
                <p>This site is used by DevApps team for testing and presentation purpose.</p>
                <hr />
                <div class="row">
                    <div id="test">
                    </div>
                    <section class="4u">
                        <h3>Maecenas luctus lectus</h3>
                        <p>Curabitur sit amet nulla. Nam in massa. Sed vel tellus. Curabitur sem urna, consequat vel, suscipit in, mattis placerat, nulla. Sed ac leo.</p>
                        <a href="#" class="button button-style1">Read More</a>
                    </section>
                    <section class="4u">
                        <h3>Maecenas luctus lectus</h3>
                        <p>Donec ornare neque ac sem. Mauris aliquet. Aliquam sem leo, vulputate sed, convallis at, ultricies quis, justo. Donec magna.</p>
                        <a href="#" class="button button-style1">Read More</a>
                    </section>
                    <section class="4u">
                        <h3>Maecenas luctus lectus</h3>
                        <p>Curabitur sit amet nulla. Nam in massa. Sed vel tellus. Curabitur sem urna, consequat vel, suscipit in, mattis placerat, nulla. Sed ac leo.</p>
                        <a href="#" class="button button-style1">Read More</a>
                    </section>
                </div>
            </div>
        </div>
        <!-- Main -->
        <div id="main">
            <div id="content" class="container">
                <div class="row">
                    <section class="6u">
                        <header>
                            <h2>Mauris vulputate dolor</h2>
                        </header>
                        <p>In posuere eleifend odio. Quisque semper augue mattis wisi. Maecenas ligula. Pellentesque viverra vulputate enim. Aliquam erat volutpat. Donec leo, vivamus fermentum nibh in augue praesent a lacus at urna congue rutrum.</p>
                    </section>
                    <section class="6u">
                        <header>
                            <h2>Mauris vulputate dolor</h2>
                        </header>
                        <p>In posuere eleifend odio. Quisque semper augue mattis wisi. Maecenas ligula. Pellentesque viverra vulputate enim. Aliquam erat volutpat. Donec leo, vivamus fermentum nibh in augue praesent a lacus at urna congue rutrum.</p>
                    </section>
                </div>
                <div class="row">
                    <section class="6u">
                        <header>
                            <h2>Mauris vulputate dolor</h2>
                        </header>
                        <p>In posuere eleifend odio. Quisque semper augue mattis wisi. Maecenas ligula. Pellentesque viverra vulputate enim. Aliquam erat volutpat. Donec leo, vivamus fermentum nibh in augue praesent a lacus at urna congue rutrum.</p>
                    </section>
                    <section class="6u">
                        <header>
                            <h2>Mauris vulputate dolor</h2>
                        </header>
                        <p>In posuere eleifend odio. Quisque semper augue mattis wisi. Maecenas ligula. Pellentesque viverra vulputate enim. Aliquam erat volutpat. Donec leo, vivamus fermentum nibh in augue praesent a lacus at urna congue rutrum.</p>
                    </section>
                </div>
            </div>
        </div>
        <!-- Tweet -->
        <div id="tweet">
            <div class="container">
                <section>
                    <blockquote>&ldquo;In posuere eleifend odio. Quisque semper augue mattis wisi. Maecenas ligula. Pellentesque viverra vulputate enim. Aliquam erat volutpat.&rdquo;</blockquote>
                </section>
            </div>
        </div>
        <!-- Footer -->
        <div id="footer">
            <div class="container">
                <section>
                    <header>
                        <h2>Maecenas ligula</h2>
                        <span class="byline">Integer sit amet pede vel arcu aliquet pretium</span>
                    </header>
                </section>
            </div>
        </div>
        <!-- Copyright -->
        <div id="copyright">
            <div class="container">
                Design: <a href="http://templated.co">TEMPLATED</a> Images: <a href="http://unsplash.com">Unsplash</a> (<a href="http://unsplash.com/cc0">CC0</a>)
            </div>
        </div>
       
    </body>
    
    </html>
    						

    external by stepan-a modified Apr 3, 2017  5  0  1  0

    Dynare, on the fly declaration of symbol types

    Dynare, on the fly declaration of symbol types: example1_model_block_declared_vars.mod
    // Declaration of some endogenous variables.
    var c;
    
    /*
    ** REMARKS 
    ** 
    ** Some declarations for the endogenous variables are missing. They are declared below in  
    ** the model block
    **
    */
    
    // Declaration of some of the parameters.
    parameters beta, rho, theta, psi, tau;
    
    rho   = 0.95;
    tau   = 0.025;
    beta  = 0.99;
    psi   = 0;
    theta = 2.95;
    phi   = 0.1;
    
    /*
    ** REMARKS 
    ** 
    ** Same remark, some parameters are defined in the below in the model block (alpha and delta). These 
    ** variables must be calibrated after the model block (ie after the calibration).
    ** 
    ** We do not declare the exogenous variables in the preamble. The innovations are decalred in the model
    ** block below.
    **
    */
    
    model;
    c*theta*h|e^(1+psi)=(1-alpha)*y;
    k = beta*(((exp(b)*c)/(exp(b(+1))*c(+1)))
        *(exp(b(+1))*alpha|p*y(+1)+(1-delta)*k));
    y|e = exp(a)*(k(-1)^alpha)*(h^(1-alpha));
    k|e = exp(b)*(y-c)+(1-delta|p)*k(-1);
    a|e = rho*a(-1) + e|x;
    b|e = rho*b(-1) + u|x;
    end;
    
    /*
    ** REMARKS
    ** 
    ** On the fly declaration works as follows:
    **
    **  - A symbol followed by |e implicitely declares an endogenous variable.
    **  - A symbol followed by |x implicitely declares an exogenous variable.
    **  - A symbol followed by |p implicitely declares a parameter.
    **
    ** A parameter declared on the fly has to be calibrated after its declaration, ie after the model
    ** block. If the user tries to give a value to a parameter before its declaration, then Dynare 
    ** interpret the calibration as a matlab statement, because he doesn't know that the symbol is a
    ** parameter.
    **
    ** By default an undeclared symbol is interpreted as an exogenous variable. Consequently, if the user
    ** removes an equation where an endogenous variable is declared, the status of the variable changes. 
    ** For instance, if one comments the last equation, the law of motion of b, symbol b becomes an
    ** exogenous variable (whose value is zero by default). 
    */
    
    alpha = 0.36;
    delta = 0.025;
    
    initval;
    y = 1.08068253095672;
    c = 0.80359242014163;
    h = 0.29175631001732;
    k = 11.08360443260358;
    a = 0;
    b = 0;
    e = 0;
    u = 0;
    end;
    
    shocks;
    var e; stderr 0.009;
    var u; stderr 0.009;
    var e, u = phi*0.009*0.009;
    end;
    
    stoch_simul;
    
    

    external by Fcmam5 modified Nov 26, 2016  47  0  1  0

    AMPL and CPLEX example model for (https://www.youtube.com/watch?v=Mr5Kz2JLC8o)

    AMPL and CPLEX example model for (https://www.youtube.com/watch?v=Mr5Kz2JLC8o): test.mod
    var x1 >= 0;
    var x2 >= 0;
    maximize fct: 6*x1 + 4*x2;
    
    subject to test1: 3*x1 + 9*x2 <=81;
    subject to test2: 4 * x1 + 5 * x2 <= 55;
    subject to test3: 2 * x1 + x2 <= 20;
    
    

    external by Andrew Powell modified Oct 6, 2016  297  0  3  0

    Solves the Multicommodity Flow Problem for Concurrent Flow.

    Solves the Multicommodity Flow Problem for Concurrent Flow.: gmpl_mcfp_cl.mod
    # Multicommodity Flow Problem for Directed Networks, 
    ## Optimized for Concurrent Flow
    set V;                      # Vertex Set
    set E, within V cross V;    # Edge Set
    set K;                      # Commodity Set
    param s {K}, symbolic in V; # Source Vertex of Commodity
    param t {K}, symbolic in V; # Sink Vertex of Commodity
    param d {K}, >= 0;          # Demand of Commodity
    param c, >= 0;				# Capacity of Edge
    var f {K,E}, >= 0;			# Flow of Commodity on Edge
    
    # Conservation / Demand Constraint. 
    # The net flow of a vertex should equal 
    ## zero, if the vertex is not a source or
    ## a sink.
    # If the vertex is a source, the net flow
    ## of the vertex should equal the positive
    ## demand of the source's commodity.
    # If the vertex is a sink, the net flow
    ## of the vertex should equal the negative
    ## demand of the sink's commodity.
    s.t. conserve_ct { k in K, v in V } :
    	( sum { w in V : (v,w) in E } f[k,v,w] ) -
        ( sum { w in V : (w,v) in E } f[k,w,v] ) =
        	if ( v!=s[k] and v!=t[k] ) then 0
            else if ( v=s[k] ) then d[k]
            else if ( v=t[k] ) then -d[k];
    
    # Capacity Constraint.
    # The total flow over an edge should
    ## be less than or equal to the edge's
    ## capacity. 
    s.t. capacity_ct { (v,w) in E } :
    	( sum { k in K } f[k,v,w] ) <= c;
        
    # Optimization Objective.
    # Let the percent of demand z_ equal 
    ## the total flow of a commodity over 
    ## the commodity's demand. The objective 
    ## is to maximize the smallest z_.
    var z, >= 0;
    s.t. conc_ct { k in K } :
    	( sum { v in V : (s[k],v) in E } f[k,s[k],v] ) /
        d[k] - z >= 0;
    maximize obj : z;
    
    data;
    
    # As an example, let's define a ring
    ## network topology as a directed graph.
    set V := A B C;
    set E := 
    	A B
        B C
        C A;
    
    # Capacity of each edge.
    param c := 1;
    
    # Finally, let's define
    ## the commodities.
    param : K : s t d :=
    	k0 A C 0.5
        k1 B A 0.5;
    
    
    

    external by Nikhil Damodaran modified Oct 3, 2016  35  0  1  0

    baseline_v1: An open Economy DSGE model

    baseline_v1: An open Economy DSGE model: baseline_v1.mod
    % ----- --------------------------------------------------------------
    % Model Attempt 1
    % ----- --------------------------------------------------------------
    % Solving the model without calculating the steady state! Closing large open economy models
     
    % ----- --------------------------------------------------------------
    % Endogenous Variables
    % ----- --------------------------------------------------------------
    var 	nubeta  nun  nuc    nui  nup  tauyd  taun  tauk  taud  taum  gd  gm  g  pid  pi  pidopt  psigma  f  gpr  x  c  cd  cm  n  w  r  k  i  yd  lambda2  mc  lambda1  ydn
            nubetas nuns nucs   nuis nups tauyds tauns tauks tauds taums gds gms gs pids pis pidopts psigmas fs gprs xs cs cds cms ns ws rs ks is yds lambda2s mcs lambda1s ydns
            num     icu  ygapcu picu tau  ycu    ycun
    ; 
     
     
    % ----- --------------------------------------------------------------
    % Exogenous Variables 
    % ----- --------------------------------------------------------------
    varexo ebeta en ec ei ep etauyd etaun etauk etaud etaum
    	   epsg
    	  ebetas ens ecs eis eps etauyds etauns etauks etauds etaums
    	   epsgs
    	  em
    ; 
     
     
    % ----- --------------------------------------------------------------
    % Parameters 
    % ----- --------------------------------------------------------------
    parameters rhob rhon rhoc rhoi rhop rhotauyd rhotaun rhotauk rhotaud rhotaum eg omg rhog xi mun pidss om muc sigma beta h kappa ej N alpha delta el
    egs omgs oms
    rhom psiygap rhoicu psipi
    ;
     
     
    % ----- --------------------------------------------------------------
    % Parameters Values (Calibrated Parameters)
    % ----- --------------------------------------------------------------
    rhob = 0.9;
    rhob = rhon;
    rhob = rhoc;
    rhob = rhoi;
    rhob = rhop;
    rhob  = rhotauyd;
    rhob  = rhotaun;
    rhob  = rhotauk;
    rhob = rhotaud;
    rhob = rhotaum ;
    el = 1.1;
    eg = el;
    ej = 0.6;
    om = 0.3;
    omg = 0.3;
    rhog = 0.8;
    xi = 0.4;
    mun = 0.023;
    pidss = 0.02;
    muc = 0.001;
    sigma = 0.6;
    beta = 0.9987;
    h = 0.8; 
    kappa = 4.00; % Sims (2016)
    ej = 2; % Doubt
    N = 1/3;
    alpha = 1/3;
    delta = 0.025;
    egs = eg;
    oms = 0.2;
    omgs = oms;
    rhom = 0.7;
    psiygap = 1;
    psipi = 2.5;
    rhoicu = 0.8;
    
    
    
    
    
    % ----- --------------------------------------------------------------
    % Model Block
    % ----- --------------------------------------------------------------
     
     
     
    model;
    % 1st equation
    nubeta *lambda1 = beta* nubeta(+1)*(1+icu)*lambda1(+1) *(1+pi)^(-1);
    % 2nd equation
    x = c - h * c(-1);
    % 3rd equation
    mun * n * nun = lambda1 * w * (1-taun);
    % 4th equation
    lambda1 = (x - muc*nuc)^(-sigma);
    % 5th equation
    lambda1*(1+pi(+1))*nubeta = lambda1s * (1+pis(+1))*nubetas;
    % 6th equation
    lambda1 = (lambda2 * (1-nui*(1- (kappa/2)*((i/i(-1)) - 1))^2 + (nui*i/i(-1))*kappa*((i/i(-1)) - 1))) + (beta * nubeta(+1) * lambda2(+1) * kappa * ((i(+1)/i) - 1)*(i(+1)/i)^2);
    % 7th equation
    lambda2 = beta* (nubeta(+1)/nubeta)*(r(+1)*lambda1(+1)*(1-tauk(+1))+lambda2*(1-delta));
    % 8th equation
    (1+pid)^(1-ej) = ( xi*(1+pidss)^(1-ej) + (1-xi)*(1+pidopt)^(1-ej) );
    % 9th Equation
    tau = ((1+pids)/(1+pid))* tau(-1);
    %10th equation
    (1+pi)^(1-el) = ( (((1-om)*(1+taud)^(1-el)+om*(1+taum)^(1-el)*tau^(1-el)))/(((1-om)*(1+taud(-1))^(1-el)+om*(1+taum(-1))^(1-el)*tau(-1)^(1-el))) ) * (1+pid)^(1-el);
    % 11th Equation
    yd = cd + gd + i + ((1-N)/N)*(cms + gms);
    % 12th equation
    cd = (((1-om)* x)/((1+taud)^(el))) * ((1-om)*(1+taud)^(1-el)+om*(1+taum)^(1-el)*tau^(1-el))^(el/(1-el));
    % 13 th equation
    cm =  (((om)* x)/((1+taum)^(el))) * ((1-om)*(1+taud)^(1-el)+om*(1+taum)^(1-el)*tau^(1-el))^(el/(1-el));
    % 14th equation
    gd = (((1-omg)* g)/((1+taud)^(eg))) * ((1-omg)*(1+taud)^(1-eg)+omg*(1+taum)^(1-eg)*tau^(1-eg))^(eg/(1-eg));
    %15th equation
    gm = (((omg)* g)/((1+taum)^(eg))) * ((1-omg)*(1+taud)^(1-eg)+omg*(1+taum)^(1-eg)*tau^(1-eg))^(eg/(1-eg));
    %16th equation
    k(+1) = i + k*(1-delta) - nui*(1-(kappa/2)*((i/i(-1)) - 1)^2)*i;
    % 17the equation
    psigma = (1-tauyd)^(ej)*((1-xi)*((1+pidopt)/(1+pid))^(-ej) + xi* ((1+pid)/(1+pidss))^(ej)*psigma(-1));
    % 18th equation
    (w*alpha)/(r*(1-alpha)) = (k/n);
    % 19th equation
    mc = (1/nup)*((n/k)^(alpha))*(w/(1-alpha));
    % 20th equation
    f = nubeta*lambda1*(1-tauyd)^(ej)*mc*yd + xi*beta*((1+pid(+1))/(1+pidss))^(ej)*f(+1);
    % 21st equation
    gpr = nubeta*lambda1*(1-tauyd)^(ej)*yd + xi*beta*((1+pid(+1))/(1+pidss))^(ej)*gpr(+1);
    % 22nd euqation
    (1+pidopt) = (ej/(ej-1))*(f/gpr)*(1+pid);
    % 23rd equation
    taud = rhotaud*taud(-1) + etaud;
    % 24th equation
    taum = rhotaum*taum(-1) + etaum;
    % 25th equation
    tauk = rhotauk*tauk(-1) + etauk;
    % 26th equation
    taun = rhotaun*taun(-1)+ etaun;
    % 27th equation
    tauyd = rhotauyd * tauyd(-1) + etauyd;
    %28th equation
    g = rhog * g(-1) + epsg;
    % 29th equation
    icu = max(0, psiygap*(1-rhoicu)*ygapcu + psipi*(1-rhoicu)*picu + rhoicu*icu(-1)+num);
    % 30th equation
    nuc = rhoc*nuc(-1) + ec;
    %31st equation
    nun = rhon*nuc(-1) + en;
    % 32nd equation
    nubeta = rhob*nubeta(-1) + ebeta;
    % 33rd equation
    nui = rhoi*nui(-1) + ei;
    % 34th equation
    nup = rhop*nup(-1) + ep;
    % 35
    num = rhom*num(-1) + em;
    % 36
    nubetas*lambda1s = beta* nubetas(+1)*(1+icu)*lambda1s(+1) *(1+pis)^(-1);
    % 37
    xs = cs - h*cs(-1);
    % 38
    mun * ns * nuns = lambda1s * ws * (1-tauns);
    % 39
    lambda1s = (xs - muc * nucs)^(-sigma);
    % 40
    lambda1s = (lambda2s *(1-nuis*(1- (kappa/2)*((is/is(-1)) - 1))^2 + (nuis*is/is(-1))*kappa*((is/is(-1)) - 1))) + (beta * nubetas(+1) * lambda2s(+1) * kappa * ((is(+1)/is) - 1) * (is(+1)/is)^2);
    % 41 
    lambda2s = beta* (nubetas(+1)/nubetas)*(rs(+1)*lambda1s(+1)*(1-tauks(+1))+lambda2s*(1-delta));
    % 42
    (1+pids)^(1-ej) = ( xi*(1+pidss)^(1-ej) + (1-xi)*(1+pidopts)^(1-ej) );
    % 43
    (1+pis)^(1-el) = ( (((1-oms)*(1+tauds)^(1-el)+oms*(1+taums)^(1-el)*tau^(-1+el)))/(((1-oms)*(1+tauds(-1))^(1-el)+oms*(1+taums(-1))^(1-el)*tau(-1)^(-1+el))) ) * (1+pids)^(1-el);
    % 44
    yds = cds + gds + is + (N/(1-N))*(cm + gm);
    % 45
    cms =  (((oms)* xs)/((1+taums)^(el))) * ((1-oms)*(1+tauds)^(1-el)+oms*(1+taums)^(1-el)*tau^(-1+el))^(el/(1-el));
    % 46
    cds = (((1-oms)* xs)/((1+tauds)^(el))) * ((1-oms)*(1+tauds)^(1-el)+oms*(1+taums)^(1-el)*tau^(-1+el))^(el/(1-el));
    % 47
    gms = (((omgs)* gs)/((1+taums)^(eg))) * ((1-omgs)*(1+tauds)^(1-eg)+omgs*(1+taums)^(1-eg)*tau^(-1+eg))^(eg/(1-eg));
    % 48
    gds = (((1-omgs)* gs)/((1+tauds)^(eg))) * ((1-omgs)*(1+tauds)^(1-eg)+omgs*(1+taums)^(1-eg)*tau^(-1+eg))^(eg/(1-eg));
    % 49
    ks(+1) = is + ks*(1-delta) - nuis*(1-(kappa/2)*((is/is(-1)) - 1)^2)*is;
    % 50
    psigmas = (1-tauyds)^(ej)*((1-xi)*((1+pidopts)/(1+pids))^(-ej) + xi* ((1+pids)/(1+pidss))^(ej)*psigmas(-1));
    % 51
    (ws*alpha)/(rs*(1-alpha)) = (ks/ns);
    % 52
    mcs = (1/nups)*((ns/ks)^(alpha))*(ws/(1-alpha));
    % 53
    fs = nubetas*lambda1s*(1-tauyds)^(ej)*mcs*yds + xi*beta*((1+pids(+1))/(1+pidss))^(ej)*fs(+1);
    % 54
    gprs = nubetas*lambda1s*(1-tauyds)^(ej)*yds + xi*beta*((1+pids(+1))/(1+pidss))^(ej-1)*gprs(+1);
    % 55
    (1+pidopts) = (ej/(ej-1))*(fs/gprs)*(1+pids);
    % 56
    tauds = rhotaud*tauds(-1) + etauds;
    % 57
    taums = rhotaum*taums(-1) + etaums;
    % 58
    tauks = rhotauk*tauks(-1) + etauks;
    % 59
    tauns = rhotaun*tauns(-1)+ etauns;
    % 60
    tauyds = rhotauyd * tauyds(-1) + etauyds;
    % 61
    gs = rhog * gs(-1) + epsgs;
    % 62
    picu = N*pi + (1-N)* pis;
    % 63
    nubetas = rhob*nubetas(-1) + ebetas;
    % 64
    nuns = rhon*nucs(-1) + ens;
    % 65
    nucs = rhoc*nucs(-1) + ecs;
    % 66
    nuis = rhoi*nuis(-1) + eis;
    % 67
    nups = rhop*nups(-1) + eps;
    % 68
    ygapcu = ycu - ycun;
    % 69
    ycun = n * ydn + (1-n) * ydns;
    % 70
    ycu = n * yd + (1-n) * yds;
    % 71
    ydns = 0;
    % 72
    ydn = 0;
    % 73 Equation linking intermediate output and domestic output (used for natural rate purposes)
    nup*(k/n)^(alpha) * n = yd*(1-tauyd)^(ej)*psigma^(-1);
    
    end;
     
    % ----- --------------------------------------------------------------
    % Initial Value ~ Helps Converge to Steady State
    % ----- --------------------------------------------------------------
    initval;
    nubeta = 0;
     nun = 0;
     nuc = 0;
     nui = 0;
     nup = 0;
     tauyd = 0;
     taun = 0;
     tauk = 0;
     taud = 0;
     taum = 0;
     gd = 0;
     gm = 0;
     g = 0;
     pid = 0;
     pi = 0;
     pidopt = 0;
     psigma = 0;
     f = 0;
     gpr = 0;
     x = 0;
     c = 0;
     cd = 0;
     cm = 0;
     n = 0;
     w = 0;
     r = 0;
     k = 0;
     i = 0;
     yd = 0;
     lambda2 = 0;
     mc = 0;
     lambda1 = 0;
    nubetas = 0;
     nuns= 0;
     nucs = 0;
     nuis = 0;
     nups = 0;
     tauyds = 0;
     tauns = 0;
     tauks = 0;
     tauds = 0;
     taums = 0;
     gds = 0;
     gms = 0;
     gs = 0;
     pids = 0;
     pis = 0;
     pidopts = 0;
     psigmas = 0;
     fs = 0;
     gprs = 0;
     xs = 0;
     cs = 0;
     cds = 0;
     cms = 0;
     ns = 0;
     ws = 0;
     rs = 0;
     ks = 0;
     is = 0;
    yds = 0;
    lambda2s = 0;
    mcs = 0;
    lambda1s = 0;
    num = 0;
    icu = 0;
    ygapcu = 0;
    picu = 0;
    tau = 0;
    end;
     
     
     
     
    % ----- --------------------------------------------------------------
    %       Shock Block
    % ----- --------------------------------------------------------------
     
    shocks;
    var epsg;
    stderr 0.009;
    end;
     
    % ---- ------------------------------------------------------------
    %  Steady State Solver, Eigenvalues Checker
    % ---- ------------------------------------------------------------
    resid(1) ;
    steady(solve_algo = 3);
    check;
     
     
    % -------- --------------------------------------------------------
    %  Solution Block
    % -------- --------------------------------------------------------
    %extended_path(periods=100,order=10);
    simul(order = 2, relative_irf, irf=30) yd;
    %write_latex_dynamic_model ; 
    
    
    
    

    external by andres-erbsen modified Nov 13, 2015  150  0  2  0

    Computers Room Humans

    Computers Room Humans: rooming.mod
    # Rooming people into double rooms and single rooms while considering both
    # (lack of) roommate preference and room choice preference. Room preference and
    # roommate preference are required to be independent.
    # Written in GNU MathProg by Andres Erbsen <andreser@mit.edu>
    
    # USAGE: glpsol --math rooming.mod
    # glpsol is a part of GPLK.
    
    set people;
    set rooms;
    
    # Preferences are represented as weights for rooms and potential roommates.
    # Bounds on weights ensure some notion of fairness.
    param matepref{i in people, j in people}, >= 0, <= 1;
    param roompref{i in people, j in rooms}, >= 0, <= 1;
    
    var room_with{i in people, j in people}, binary; # i and j in same (unspecified) room
    var room_in{i in people, j in people, k in rooms}, binary; # i and j are in room k
    # living in a single = living in a double with yourself
    
    var utility{i in people};
    maximize total : sum{i in people} utility[i];
    
    s.t. everybody_assigned{i in people}:
    	sum{j in people} room_with[i,j] = 1;
    s.t. assigned_has_room{i in people, j in people}:
    	room_with[i,j] = sum{k in rooms} room_in[i,j,k];
    s.t. room_cap{k in rooms}:
    	sum{i in people, j in people : i<=j} room_in[i,j,k] <= 1;
    
    s.t. utility_eq{i in people}: utility[i] =
    	sum{j in people}             (matepref[i,j] * room_with[i,j]) +
    	sum{j in people, k in rooms} (roompref[i,k] * room_in[i,j,k]);
    
    s.t. room_with_sym{i in people, j in people : i < j}:
    	room_with[i,j] = room_with[j,i];
    s.t. room_in_sym{i in people, j in people, k in rooms : i < j}:
    	room_in[i,j,k] = room_in[j,i,k];
    
    
    solve;
    
    printf "utilities:\n";
    for {i in people}
    	printf "%s: %f\n", i, utility[i];
    
    for {k in rooms}
    	for {i in people}
    		for {j in people : i<=j}
    			printf "%s",
    				if room_in[i,j,k] then
    					k & ": " & i & ", " & j & "; "
    				else "";
    
    data; # example
    
    
    set people := Jack James Joe;
    set rooms := tunnels shafts roofs;
    
    param matepref :=
    	:	Jack	James	Joe :=
    	Jack	1	0	0
    	James	0	.25	.75
    	Joe	0	.75	.25
    	;
    
    param roompref :=
    	:	tunnels	shafts	roofs	:=
    	Jack	.9	.1	0
    	James	.8	.2	0
    	Joe	.8	.2	0
    	;
    
    end;
    
    
    

    List Complete ( 6 snippets total )

    • Public Snippets
    • Channels Snippets