batchload("m_solver_core.mac");

load(to_poly_solve)$

/* example 1 */
nd:4;
circuit:create_circuitA(nd);
xc:makelist(C, length(circuit)-1);
solve_multiplier(circuit, nd, xc, a, F, IL);

/* example 2 */
nd:4;
circuit:create_circuitA(nd);
xc:makelist(C, length(circuit)-1);
xc[1]:4*C;
solve_multiplier(circuit, nd, xc, a, F, IL);

/* example 3 */
nd:4;
circuit:create_circuitA(nd);
xc:makelist(C, length(circuit)-1);
[Uout, h, uc]:solve_multiplier(circuit, nd, xc, a, F, IL)$
subst_parallel([C=10e-6, a=100, F=50, IL=0.001], Uout);

/* example 4 */
nd:4;
circuit:create_circuitA(nd);
xc:makelist(C, length(circuit)-1);
[Uout, h, uc]:solve_multiplier(circuit, nd, xc, a, F, IL)$
subst_parallel([C=10e-6, a=100, F=50, IL=0.001], [Uout, h]);

/* example 5 */
nd:6;
circuit:matrix(
    [6, 8],
    [4, 2],
    [6, 2],
    [3, 1],
    [5, 3],
    [5, 1],
    [7, 5],
    [7, 1],
    [8, 1]);
xc:makelist(C, length(circuit)-1);
[Uout, h, uc]:solve_multiplier(circuit, nd, xc, a, F, IL)$
Uout; h;

/* example 6 */
nd:3;
circuit:matrix(
    [2, 5],
    [3, 1],
    [4, 5],
    [5, 6],
    [1, 6]);
xc:makelist(C, length(circuit)-1);
[Uout, h, uc]:solve_multiplier(circuit, nd, xc, a, F, IL);