ArticleslgStudy

computer science

Parametric programming

Parametric programming is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Parametric programming rather than just read about it. In short: Parametric programming is a type of mathematical optimization, where the optimization problem is solved as a function of one or multiple parameters. Developed in parallel to sensitivity analysis, its earliest mention can be found in a thesis from 1952.

Key takeaways

  • Parametric programming belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Parametric programming to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Parametric programming from memory before moving on to harder problems.

Reference excerpt

Parametric programming is a type of mathematical optimization, where the optimization problem is solved as a function of one or multiple parameters. Developed in parallel to sensitivity analysis, its earliest mention can be found in a thesis from 1952. Since then, there have been considerable developments for the cases of multiple parameters, presence of integer variables as well as nonlinearities.

Notation In general, the following optimization problem is considered

J ∗ ( θ ) = min x ∈ R n f ( x , θ ) subject to g ( x , θ ) ≤ 0. θ ∈ Θ ⊂ R m {\displaystyle {\begin{aligned}J^{*}(\theta )=&\min _{x\in \mathbb {R} ^{n}}f(x,\theta )\\&{\text{subject to }}g(x,\theta )\leq 0.\\&\theta \in \Theta \subset \mathbb {R} ^{m}\end{aligned}}}

where x {\displaystyle x} is the optimization variable, θ {\displaystyle \theta } are the parameters, f ( x , θ ) {\displaystyle f(x,\theta )} is the objective function and g ( x , θ ) {\displaystyle g(x,\theta )} denote the constraints. J ∗ {\displaystyle J^{*}} denotes a function whose output is the optimal value of the objective function f {\displaystyle f} . The set Θ {\displaystyle \Theta } is generally referred to as parameter space. The optimal value (i.e. result of solving the optimization problem) is obtained by evaluating the function with an argument θ {\displaystyle \theta } .

Classification Depending on the nature of f ( x , θ ) {\displaystyle f(x,\theta )} and g ( x , θ ) {\displaystyle g(x,\theta )} and whether the optimization problem features integer variables, parametric programming problems are classified into different sub-classes:

If more than one parameter is present, i.e. m > 1 {\displaystyle m>1} , then it is often referred to as multiparametric programming problem If integer variables are present, then the problem is referred to as (multi)parametric mixed-integer programming problem If constraints are affine, then additional classifications depending to nature of the objective function in (multi)parametric (mixed-integer) linear, quadratic and nonlinear programming problems is performed. Note that this generally assumes the constraints to be affine.

Applications

In control theory generally and in process industries The connection between parametric programming and model predictive control for process manufacturing, established in 2000, has contributed to an increased interest in the topic. Parametric programming supplies the idea that optimization problems can be parametrized as functions that can be evaluated (similar to a lookup table). This in turns allows the optimization algorithms in optimal controllers to be implemented as pre-computed (off-line) mathematical functions, which may in some cases be simpler and faster to evaluate than solving a full optimization problem on-line. This also opens up the possibility of creating optimal controllers on chips (MPC on chip). However, the off-line parametrization of optimal solutions runs into the curse of dimensionality as the number of possible solutions grows with the dimensionality and number of constraints in the problem.

In CNC programming Parametric programming in the context of CNC (computer numerical control) is defining part-cutting cycles in terms of variables with reassignable values rather than via hardcoded/hardwired instances. An archetypically simple example is writing a G-code program to machine a family of washers: there is often no need to write 15 programs for 15 members of the family with various hole diameters, outer diameters, thicknesses, and materials, when it is practical instead to write 1 program that calls various variables and reads their current values from a table of assignments. The program then instructs the machine slides and spindles to move to various positions at various velocities, accordingly, addressing not only the sizes of the part (i.e., OD, ID, thickness) but also even the speeds and feeds needed for any given material (e.g., low-carbon steel, high-carbon steel; stainless steel of whichever grade; bronze, brass, or aluminum of whichever grade; polymer of whichever type). Custom Macros are often used in such programming.

References

Worked examples

Example 1 — a first encounter with Parametric programming

Start with the simplest possible case. Write down what Parametric programming claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Parametric programming before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Parametric programming ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Parametric programming

In research
Parametric programming appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Parametric programming in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Parametric programming is common in secondary-school and first-year university syllabi. It links to neighbouring topics Optimization algorithms and methods, so understanding it makes those chapters shorter.
In everyday life
Look for Parametric programming outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Parametric programming in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Parametric programming means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Parametric programming out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Parametric programming in simple terms?

Parametric programming is a type of mathematical optimization, where the optimization problem is solved as a function of one or multiple parameters. Developed in parallel to sensitivity analysis, its earliest mention can be found in a thesis from 1952.

Why does Parametric programming matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Parametric programming?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Parametric programming.

Tags

  • Optimization algorithms and methods

Keep exploring