Skip to main content
April 15, 2014
Solved

Question

  • April 15, 2014
  • 4 replies
  • 4996 views

Hy guys.

I have a problem with an algorithm.

I uploaded it so you can take a look. What changes do I have to make?

The thing is this: I need to find some dimensions so that a the value of N is equal to the volume (V) of the blue geometric form.

N I know. The volume i determined being the triunghiular pyramid minus the two with green.

The formulas I determined are aproximative, but the values must be similar to: S=1.03; t=1.09; p1=260.06; p2;90.11; p4=75.39. Yes, I know there is no p3.

A is the area.

So the question is: how to arrange those formulas so that the algorithm finds S,t,x1,y1,p1,p2,p3 so that N=V?

Thanks.

Best answer by Werner_E

Had a second look at your sheet and of course Richard is right, you hadn't setup any iteration at all, just a bunch of equations.

You had an error in the volume equation - the whole expression has to be multiplied by 1/3, not just the first summand.

The problem is underdetermined. You can freely chose 2 of the variables (within certain ranges) and calculate all the others - e.g. you can make all values dependent on x1 and y1, or on p2 and p4 or, as I have done in the attached sheet, of t and S.

So also the volume is dependent on just those two variables. That means you can freely chose one of the two, lets say t (for the allowed range see the comments in the sheet) and calculate the other (S) so that the object has the demanded volume. You can look at the volume as a surface in 3D:

Vol.png

Mathcad's 3D plot doesn't allow us to suppress unwanted or invalid values, so in the above plot I have set all values corresponding to invalid combinations of t and S to zero. Thas the reason for that scarpe face.

So you can see that your problem has an infinite number of solutions (the red plane represents Volume=N).

You could add an additional constraint (like S=t or anything else) to get a unique solution.

As long as we don't do that we can also plot the solution curve (S over t) in a 2D plot

16.04.png

BTW, what is shown here is the complete solution curve - there is nothing more to the left or to the right of it!

You can also plot the other values, e.g. see p1 here

16.04.png

and as you can see it weill never go up to 260, as you wrote in your initial post - at least not with the values for L, B, Mx etc. you provided.

4 replies

25-Diamond I
April 15, 2014

Setup a formula for the Volume in question which should be equal to N and use a solve block (given ... find()) to get your parameters, You are searching for 5 variables and only have 1 equation (V=N)? Guess there will be a lot of solutions!

April 15, 2014

All the values have a formula depending on the other coefficients. The N=V is a condition.

I just need to arrange them in the algorithm so it may run.

19-Tanzanite
April 15, 2014

What is N, and how is it related to the other parameters?

April 15, 2014

Well, it is actually a force. It is used to determine p1 and from there p1 is used to determine p2 and p4.

And N must be equal to the volume determined by the formula from the application.

I need to arrange the formulas in the algorithm so the programme can run. I tried some things but I get that a variable is undefined or other things like that.

25-Diamond I
April 15, 2014

First from your writing I get the impression you want to implement an iteration. So you should use "while" instead of "if". You comparison fails because no values for S,t,p1,etc have been initially specified.

I changed that (you may chose to provide the inital values inside the program as you did with x1 and x2) but your program returns negative values for all p. I have streamlined your routine a bit and added a modified one where you can follow the iterations steps which should make it easier to find the error.

I also have the impression that in your iteration you mix old an new values. The volume is calculated by using the new values for x,y, and the p's, but the old values for S and t. Is this on purpose?

15.04.png

Werner_E25-Diamond IAnswer
25-Diamond I
April 16, 2014

Had a second look at your sheet and of course Richard is right, you hadn't setup any iteration at all, just a bunch of equations.

You had an error in the volume equation - the whole expression has to be multiplied by 1/3, not just the first summand.

The problem is underdetermined. You can freely chose 2 of the variables (within certain ranges) and calculate all the others - e.g. you can make all values dependent on x1 and y1, or on p2 and p4 or, as I have done in the attached sheet, of t and S.

So also the volume is dependent on just those two variables. That means you can freely chose one of the two, lets say t (for the allowed range see the comments in the sheet) and calculate the other (S) so that the object has the demanded volume. You can look at the volume as a surface in 3D:

Vol.png

Mathcad's 3D plot doesn't allow us to suppress unwanted or invalid values, so in the above plot I have set all values corresponding to invalid combinations of t and S to zero. Thas the reason for that scarpe face.

So you can see that your problem has an infinite number of solutions (the red plane represents Volume=N).

You could add an additional constraint (like S=t or anything else) to get a unique solution.

As long as we don't do that we can also plot the solution curve (S over t) in a 2D plot

16.04.png

BTW, what is shown here is the complete solution curve - there is nothing more to the left or to the right of it!

You can also plot the other values, e.g. see p1 here

16.04.png

and as you can see it weill never go up to 260, as you wrote in your initial post - at least not with the values for L, B, Mx etc. you provided.

April 16, 2014

I managed to solve it.

Thank you for all your help. Werner, you really tried to solve the problem.

I will choose your answer as correct if it helps you with points.

25-Diamond I
April 16, 2014

John Air wrote:

I managed to solve it.

So you arrived at the values you mentioned in your first post? How? Guess you must have to add at least one additional equation to make it unique.

I will choose your answer as correct if it helps you with points.

Thanks, but I don't believe that many posters here really care for those points. There is nothing we could turn them in anyway 😉