Jump to: navigation, search

The included keyword can be used within METHODs to turn on and off relations in your model. For example,

MODEL mymodel;
    f, Re, eD IS_A factor;
    lam_expr: f = 64 / Re;
    turb_expr: 1/sqrt(f) = -1.8*(6.9/Re + (eD/3.7)^1.11);
METHOD set_turbulent;
    turb_expr.included := TRUE;
    lam_expr.included := FALSE;
END set_turbulent;
METHOD set_laminar;
    turb_expr.included := FALSE;
    lam_expr.included := TRUE;
END set_laminar;
END mymodel;

The above model hasn't been carefully tested, it's just been written to demonstrate the syntax that allows manually switching relations on and off. This can be very handy when trying to solve difficult models; the model can be configured in a simple form to get variable values close to the true solution, then the model switched to more accurate form for final, accurate, solution.