## Main.MathematicalModeling History

June 21, 2020, at 04:43 AM by 136.36.211.159 -
Deleted lines 14-32:

----

(:html:)
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'apmonitor'; // required: replace example with your forum shortname

/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
})();
</script>
(:htmlend:)
January 14, 2013, at 06:56 PM by 128.187.97.21 -
Deleted lines 14-45:

----

!!!! Modeling Exercise

Modeling often constitutes most of an optimization project. There is some art in the way a programmer poses the model in a way that allows solvers to efficiently find a solution. Below are some tips and an exercise on ways to rearrange the model equations for improved convergence.

[[Attach:twobar_rearrangement.pdf | Worksheet with Modeling Exercises]]

* [[https://apmonitor.com/online/view_pass.php?f=twobar_v1.apm | Solve Initial Version]]
* [[https://apmonitor.com/online/view_pass.php?f=twobar_v2.apm | Solve with SQRT removed]]
* [[https://apmonitor.com/online/view_pass.php?f=twobar_v3.apm | Solve with added constraints and no SQRT]]
* [[https://apmonitor.com/online/view_pass.php?f=twobar_v4.apm | Solve with added constraints and explicit definition of some variables]]

# Rearrange to equation in residual form to:
## Avoid divide by zero
## Minimize use of functions like sqrt, log, exp, etc.
## Have continuous first and second derivatives
## Fit the equation into a linear or quadratic form
# Bounds
## Include variable bounds to exclude infeasible solutions
## Variable bounds to avoid regions of strong nonlinearity
## Caution: watch for infeasible solutions
# Scaling:
## Scale absolute value of variables to 1e-3 to 1e3
## Scale absolute value of equation residuals to 1e-3 to 1e3
## Better that 1st derivative values are closer to 1.0
# Good initial conditions:
## Starting near a solution can improve convergence
## Try multiple initial conditions to verify global solution (non-convex problems)
## Explicitly calculate intermediate values
# Check iteration summary for improved convergence
January 14, 2013, at 06:43 PM by 128.187.97.21 -
* [[https://apmonitor.com/online/view_pass.php?f=twobar_v1.apm | Solve Initial Version]]
* [[https://apmonitor.com/online/view_pass.php?f=twobar_v2.apm | Solve with SQRT removed]]
* [[https://apmonitor.com/online/view_pass.php?f=twobar_v3.apm | Solve with added constraints and no SQRT]]
* [[https://apmonitor.com/online/view_pass.php?f=twobar_v4.apm | Solve with added constraints and explicit definition of some variables]]

Deleted lines 46-50:

* [[https://apmonitor.com/online/view_pass.php?f=twobar_v1.apm | Solve Initial Version]]
* [[https://apmonitor.com/online/view_pass.php?f=twobar_v2.apm | Solve with SQRT removed]]
* [[https://apmonitor.com/online/view_pass.php?f=twobar_v3.apm | Solve with added constraints and no SQRT]]
* [[https://apmonitor.com/online/view_pass.php?f=twobar_v4.apm | Solve with added constraints and explicit definition of some variables]]
January 14, 2013, at 06:42 PM by 128.187.97.21 -
Changed line 22 from:
Attach:twobar_rearrangement.pdf
to:
[[Attach:twobar_rearrangement.pdf | Worksheet with Modeling Exercises]]
January 14, 2013, at 06:40 PM by 128.187.97.21 -

* [[https://apmonitor.com/online/view_pass.php?f=twobar_v1.apm | Solve Initial Version]]
* [[https://apmonitor.com/online/view_pass.php?f=twobar_v2.apm | Solve with SQRT removed]]
* [[https://apmonitor.com/online/view_pass.php?f=twobar_v3.apm | Solve with added constraints and no SQRT]]
* [[https://apmonitor.com/online/view_pass.php?f=twobar_v4.apm | Solve with added constraints and explicit definition of some variables]]
January 14, 2013, at 06:09 PM by 128.187.97.21 -

----

!!!! Modeling Exercise

Modeling often constitutes most of an optimization project. There is some art in the way a programmer poses the model in a way that allows solvers to efficiently find a solution. Below are some tips and an exercise on ways to rearrange the model equations for improved convergence.

Attach:twobar_rearrangement.pdf

# Rearrange to equation in residual form to:
## Avoid divide by zero
## Minimize use of functions like sqrt, log, exp, etc.
## Have continuous first and second derivatives
## Fit the equation into a linear or quadratic form
# Bounds
## Include variable bounds to exclude infeasible solutions
## Variable bounds to avoid regions of strong nonlinearity
## Caution: watch for infeasible solutions
# Scaling:
## Scale absolute value of variables to 1e-3 to 1e3
## Scale absolute value of equation residuals to 1e-3 to 1e3
## Better that 1st derivative values are closer to 1.0
# Good initial conditions:
## Starting near a solution can improve convergence
## Try multiple initial conditions to verify global solution (non-convex problems)
## Explicitly calculate intermediate values
# Check iteration summary for improved convergence
January 11, 2013, at 02:23 PM by 69.169.188.188 -

----

(:html:)
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'apmonitor'; // required: replace example with your forum shortname

/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
})();
</script>
(:htmlend:)
January 02, 2013, at 10:24 PM by 69.169.188.188 -
Changed line 7 from:
* Introduction
to:
!!! Introduction
Changed line 9 from:
* Physical Models vs. Experimental Models
to:
!!! Physical Models vs. Experimental Models
Changed line 11 from:
** Physical Models
to:
!!!! Physical Models
Changed line 13 from:
** Experimental Models
to:
!!!! Experimental Models
January 02, 2013, at 10:23 PM by 69.169.188.188 -
Changed line 7 from:
# Introduction
to:
* Introduction
Changed line 9 from:
# Physical Models vs. Experimental Models
to:
* Physical Models vs. Experimental Models
Changed line 11 from:
## Physical Models
to:
** Physical Models
Changed line 13 from:
## Experimental Models
to:
** Experimental Models
December 22, 2012, at 04:28 PM by 69.169.188.188 -
Changed line 1 from:
(:title Mathematical Modeling for Optimization:)
to:
(:title Mathematical Modeling for Engineering Design:)
December 22, 2012, at 03:58 PM by 69.169.188.188 -
(:title Mathematical Modeling for Optimization:)
(:keywords mathematical modeling, nonlinear, optimization, engineering optimization, interior point, active set, differential, algebraic, modeling language, university course:)
(:description Mathematical modeling is necessary to apply optimization techniques in engineering:)

[[Attach:chap2_modeling.pdf | Chapter 2: Mathematical Modeling]]

# Introduction
As was discussed in the previous chapter, in order to apply optimization methods we must have a model to optimize. As we also mentioned, obtaining a good model of the design problem is the most important step in optimization. In this chapter we discuss some modeling concepts that can help you develop models which can successfully be optimized. We also discuss the formulation of objectives and constraints for some special situations. We look at how graphics can help us understand the nature of the design space and the model. We end with an example optimization of a heat pump.
# Physical Models vs. Experimental Models
Two types of models are often used with optimization methods: physical models and experimental models. Physical models are based on the underlying physical principles that govern the problem. Experimental models are based on models of experimental data. Some models contain both physical and experimental elements. We will discuss both types of models briefly.
## Physical Models
Physical models can be either analytical or numerical in nature. For example, the Two-bar truss is an analytical, physical model. The equations are based on modeling the physical phenomena of stress, buckling stress and deflection. The equations are all closed form, analytical expressions. If we used numerical methods, such as the finite element method, to solve for the solution to the model, we would have a numerical, physical model.
## Experimental Models
Experimental models are based on experimental data. A functional relationship for the data is proposed and fit to the data. If the fit is good, the model is retained; if not, a new relationship is used. For example if we wish to find the friction factor for a pipe, we could refer to the Moody chart, or use expressions based on a curve fit of the data.