Ignore:
Timestamp:
09/28/15 20:45:46 (8 months ago)
Author:
mmckerns
Message:

add simplify to simplify equations for a single variable on the LHS;
use simplify in many examples where symbolic equations are given;
add comparator function, to determine the comparator ('<=', '=', etc);
add test_simplify to test_symbolic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mystic/examples2/eq10.py

    r817 r831  
    4141from mystic.symbolic import generate_penalty, generate_conditions 
    4242pf = generate_penalty(generate_conditions(equations)) 
    43 #from mystic.constraints import as_constraint, discrete 
    44 #cf = as_constraint(pf) 
     43from mystic.symbolic import generate_constraint, generate_solvers, solve 
     44cf = generate_constraint(generate_solvers(solve(equations))) 
    4545 
    4646from numpy import round as npround 
     
    5353 
    5454   #result = diffev2(objective, x0=bounds, bounds=bounds, penalty=pf, npop=20, gtol=50, disp=True, full_output=True) 
    55     result = diffev2(objective, x0=bounds, bounds=bounds, penalty=pf, constraints=npround, npop=40, gtol=50, disp=True, full_output=True) 
     55   #result = diffev2(objective, x0=bounds, bounds=bounds, penalty=pf, constraints=npround, npop=40, gtol=50, disp=True, full_output=True) 
     56    result = diffev2(objective, x0=bounds, bounds=bounds, constraints=cf, npop=4, gtol=1, disp=True, full_output=True) 
    5657 
    5758    print result[0] 
Note: See TracChangeset for help on using the changeset viewer.