Ask Your Question

Automated optimum solution [closed]

asked 2012-06-17 21:02:29 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

(THIS MIGHT BE CONFUSING. YOU CAN JUST JUMP TO MODELING) Aoa. I am a student of civil engineering and i am attempting to make a spreadsheet to help me design structural members but i am at the best a novice at programming. So any help is appreciated. Say i need a total steel area "A" and the steel available is as 0.11, 0.2, 0.31, 0.44,0.6, 0.79, 1, 1.27, 1.56, 2.25 and 5 squared inches. Moreover if i use a single type of steel bar, i can take either even or odd number of bars but if i use multiple bars, i can have an odd number of only type of bars, the rest must be even. Odd bars are not a necessity, i can have even number of all types of bars.

MODELING: A' = aX + bY using two types of bars. X or Y = [0.11, 0.2, 0.31, 0.44, 0.6, 0.79, 1, 1.27, 1.56, 2.25, 5]. a = [0,2,4,6,....,(A/0.11 rounded up to nearest multiple of 2)]. b = [0,1,2,3,4,....,(A/0.11 rounded up to nearest whole number)]. A is the area required and A' is what i get. I want a very small difference. For simplicity a = [0,2,4] and b = [0,1,2,3].

So what i need is the 10 out of the ~1500 possibilities that give me the least value of |A-A'|. Positive / negative does not matter. I know this is a lot to ask and really appreciate your consideration and help.

edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant by bencomp
close date 2014-07-06 17:36:48.869155


This is quite an interesting spreadsheet problem that I cannot solve. On a more general note though, it sounds like you need someone to do your homework, which is a bit out of scope for a Q&A.

bencomp gravatar imagebencomp ( 2014-07-06 17:36:02 +0200 )edit

2 Answers

Sort by » oldest newest most voted

answered 2013-03-06 10:02:33 +0200

qubit gravatar image

Hi @Ishaq,

Have you found a solution to your problem?

It sounds like this is a complicated problem that might be best addressed by someone with a background in engineering. Unfortunately I can't sort the Ask site users by degree, but sometimes I wish that I could :-)

edit flag offensive delete link more

answered 2013-03-06 14:04:32 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

@Ishaq - if I understand your problem correctly you have 2 parameters and 4 variables (a, b, x, y) which vary in a certain range. Even if the number of possible values are limited, the number of possible combination is rather big.

I assume that a spreadsheet cannot handle this as you have only 3 dimensions (rows, columns and sheets or 1 sheet with a column or row)

I feel you need to create a macro with 3 - 4 loops covering dynamically the range of your parameters and variables. The macro needs to identify the combination you are looking for. A flowchart could possible help you to identify the macro structure you need.

Once you work on a macro and run into programming problems, place a question here. There are quite some macro experts around.

edit flag offensive delete link more


what-if operations in Calc can handle only 2 variables, the same as in Excel.

ROSt52 gravatar imageROSt52 ( 2013-03-06 14:26:08 +0200 )edit

Question Tools

1 follower


Asked: 2012-06-17 21:02:29 +0200

Seen: 111 times

Last updated: Mar 06 '13