![]() |
Solver - Minimize an absolute value
I am trying to minimize the absolute value difference between two numbers.
The challenge is that solver sees -45 as a better anwer than -1; I'm trying to hit zero if at all possible. When I use the "abs" function my solver spits out the "@@# does not conform to a linear model". Assume linear model is a requirement in my application. Any ideas? |
Solver - Minimize an absolute value
Absolute value is not linear. If you can picture the graph in your head, it
is V-shaped. That sharp corner is very non-linear and I am sure that is what gives the solver headaches. One way you could try to get around this: try to minimize the square of the difference. I don't know if solver handles that any better but it is worth a try. -- - K Dales "D. Stacy" wrote: I am trying to minimize the absolute value difference between two numbers. The challenge is that solver sees -45 as a better anwer than -1; I'm trying to hit zero if at all possible. When I use the "abs" function my solver spits out the "@@# does not conform to a linear model". Assume linear model is a requirement in my application. Any ideas? |
Solver - Minimize an absolute value
No Luck!
"K Dales" wrote: Absolute value is not linear. If you can picture the graph in your head, it is V-shaped. That sharp corner is very non-linear and I am sure that is what gives the solver headaches. One way you could try to get around this: try to minimize the square of the difference. I don't know if solver handles that any better but it is worth a try. -- - K Dales "D. Stacy" wrote: I am trying to minimize the absolute value difference between two numbers. The challenge is that solver sees -45 as a better anwer than -1; I'm trying to hit zero if at all possible. When I use the "abs" function my solver spits out the "@@# does not conform to a linear model". Assume linear model is a requirement in my application. Any ideas? |
Solver - Minimize an absolute value
If use of a linear model is a requirement it would seem like a HW
assignment. Maybe if you share more details about what you are trying to do someone might be able to suggest an alternative model that is indeed linear. -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article , . says... I am trying to minimize the absolute value difference between two numbers. The challenge is that solver sees -45 as a better anwer than -1; I'm trying to hit zero if at all possible. When I use the "abs" function my solver spits out the "@@# does not conform to a linear model". Assume linear model is a requirement in my application. Any ideas? |
All times are GMT +1. The time now is 12:08 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com