# Maximize the area?

Discussion in 'Math' started by Chalma, Jul 16, 2014.

1. ### Chalma Thread Starter Member

May 19, 2013
54
2
Greetings,

Its been ages since I've done any real math and it's come to haunt me. I was going to make an LED matrix lets say for one character I'd have 5x7 or 8x8 (or whatever), this will be matrix in a 10x2 (for words). The problem I'm having is I can't for the life of me recall how to put this into a formula to quickly determine the spacing. For example, maybe I want them all 3cm apart, that is no problem takes a bit of time but I can come up with an answer, but what if I wanted the maximum allotment to be in a 100cm x 200cm or maybe I might be given the stipulation of having them only be from 0-0.5" apart. IIRC from school I think this was called maximizing the area, if you can point me out to what I should be looking for I'd greatly appreciate it. I also need it to be proportional, since these are to display text I don't want them to come out uneven or wonky. I started with something Like:

X = number of LEDs in the matrix for x direction
WL = width of the LED
S = spacing between LED's
Xmat = # of matrixes in the X direction
Xmax = maximum X lenghth
Smat = spacing between matrix 'characters'

X(WL+S) * Xmat + Smat = Xmax
I believe this works for only ONE direction though, I'd like to plug this in for Y leds but also have a ratio so that letters aren't too skewed, this is where I get lost.

I don't expect this to be solved but maybe even talking me through it a different way might help or a link to some free math with the concept (I'm not afraid to read and relearn). Thanks.

2. ### wayneh Expert

Sep 9, 2010
13,621
4,416
I don't see how this is a math problem as opposed to an art problem. I mean, most of your variables are arbitrary and must be set by you as a specification.

I'd break this down in terms of a list of constraints. For instance if you know you need to fit 10 characters into a length L, then each character must not exceed L/10 in width. You want a minimum number of LEDs per character, and so on and on. You can then decide how much above the minimums you want. If 20 LEDs is a minimum, maybe 24 would be better. That sort of thing

The mathematical optimization you might be remembering is:
1) Express the thing you want to optimize (the dependent variable, Y) in terms of the independent variables (X).
2) Take the derivative of Y with respect to X, and
3) set it to zero to solve for the value of X that maximizes or minimizes Y.
4) You have to take the 2nd derivative to determine which it is.

This can be repeated for multiple Xs, while holding the other Xs constant. The results are only valid at those values. A "global" optimization is tougher on paper but easy with a computer and a spreadsheet.

Chalma likes this.
3. ### Chalma Thread Starter Member

May 19, 2013
54
2
I found a solution just this morning. It's too embarrassing to admit and list, but I'd be happy to share if anyone ever has this problem.

4. ### MrAl Distinguished Member

Jun 17, 2014
3,741
791
Hi,

I too was a bit puzzled over what you were actually trying to do here. It sounded like you were deciding everything beforehand, then asking about some optimization when really at that point all you would do is add everything up.

Going from one dimension to two means we'd be using partial derivatives, but i am not clear on what you are really doing.

So if you could post the solution you found i think that would clear things up for everybody.

5. ### Chalma Thread Starter Member

May 19, 2013
54
2
using Gimp (alternative to photoshop) I create a grid and put dots on the grid lines, I copy and paste this (remembering my assigned values) and resize to whatever I need. The only fallacy is it's not super accurate, but for what I need it to do it works fine by me. I know it's a funny way of doing it but I have to do this character matrix and the people I work with LOVE (maybe make a habit) of changing things on the fly. I just wanted to be prepared if our project suddenly goes from 3 feet to 2 feet to 2.3 feet in a matter of days.

6. ### wayneh Expert

Sep 9, 2010
13,621
4,416
You should look into vector drawing programs, such as InkScape or Intaglio (Mac only). They can do things like automatically draw an array of items when you tell it how many duplicates and how far apart they are. Poof, done. And then it's trivial to change the spacing. You can also draw the dimensions and have them auto-update as you make changes.

Chalma likes this.