Mathematical Modeling with LPL : Explain and run a Model
Problem Statement
Modeling Description
||
Back to MatMod
model exercise3 "A Simple Modeling Example"; variable a "my age today"; b "my father's age today"; c "my age in ten years"; d "my father's age in ten years"; constraint A: c = a+10 "in ten year my age will be c"; B: d = b+10 "in ten years my father's age will be d"; C: a = b/3 "my age today is a third of my father's age"; D: d = 2*c "in ten years my father will be two times other than I"; solve; Write('My age is %d\n', a); Write('My father\'s age is %d\n', b); Write('My age in ten years is %d\n', c); Write('My father\'s age in ten years is %d\n', d); end
Problem Statement
Modeling Description
Back to model
The solution is as follows:
The LOG-File output of LPL is as follows: