cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Translate the entire conversation x

siosolve block for functions

DC_11916766
12-Amethyst

siosolve block for functions

Saludos comunidad, tengo un problema con la solución a través de un bloque solucionado para determinar los diferentes valores detallados.DC_11916766_0-1758248874077.png(PTC Mathcad Prime 10.0.0.0)

 

  • El problema que tengo es que el resultado para cada fila de la matriz g es el mismo, y no debería ser así, específicamente  
  • Gracias por su atención
5 REPLIES 5

(i) ¡Cuatro ecuaciones y una restricción para encontrar siete variables no funcionan!
(ii) ¿Mx, My, Ps deben estar en las ecuaciones del bloque de resolución para usarse como entrada en el bloque de resolución paramatizado?
(iii) ¿Las funciones Q1, QQ1, Q2 y QQ2 calculan vectores y devuelven el último elemento calculado del vector, que se equipara a valores individuales?
Si desea generar el vector, indique valores de retorno específicos.
(i) Four equations and a constraint to find seven variables does not work!

(ii) Mx,My,Ps must be in the solve block equations to be used as input to paramatized solve block?
(iii) functions Q1,QQ1,Q2, & QQ2 calculate vectors and return the last thing calculated which is the last element calculated of the vector, and are equated to single values?
Put in specific return values if your intention is to output the vector.

Werner_E
25-Diamond I
(To:DC_11916766)

Puhhh!

As you only have four equations but look for seven variables, you sure have to investigate further and find three more equations.

 

Your Q1 and Q2 function seem to be completely identical apart from using different names for the input and local variables. You have to understand that the formal argument names may, but must not be of the same name as the variables you later use for calling the function. And the local variable used to hold the result of your function bust not have the same name as the function!

Because you want you solve block be dependent on three values Mx, My and Ps, these values must be arguments of the functions used in the solve block.

Its not necessary to define qn.min and qnmax in the solve block. They already were defined a the top of the sheet.

 

Generally I would advise to set up the solve block and the functions used therein to utilize just scalar values. Forget that later you want to feed them with vectors.

This means that you solve block should be set up and tested(!) to work with single scalar values for Mx, My and Ps. This also means that your function Q1 etc. should not treat Max etc. as vectors.

Once the solve block works OK you can call it with the vectors you provided for MX, My and Ps and create a table in the exact way you did.
Its also would be possible to call the solve block function vectorized but this would create a nasty nested matrix, so your approach for creating a table is preferable.

 

I tried to streamline your four functions Q1, Q2, QQ1 and QQ2 and ended up with just two functions Qmin and Qmax. But I am absolutely not sure if I correctly understood what you were trying to achieve, so you will have to thoughtfully check them!!

 

 So far I get a result from the solve block, but the values are far off compared to the table of desired values you posted.

Werner_E_0-1758292472389.png

You also can see how Prime deals with the fact that you provide just four equations but want it to solve for seven variables. This basically means that we have an infinite number of solutions for each input triple MX,My,Ps. And we could chose three values at random and then solve for the other four.

Prime seems to do just that and often does not change some guess values but rather returns them unchanged.

 

BTW, I changed your guesses for alpha, Qmin and Qmax. You have a constraint for alpha that  it should be a value between 1 and 1.5, so why do you provide a guess of 0.5?

And the values for Qmax and Qmin you expect are in the magnitude of 10-12 tonnef/m^2, so I changed your guess of 1 to 10.

Using your original guesses Prime would not find a solution for some values of Mx,My,Ps.

 

But you sure will have to work on your solve block equations anyway, finding additional equations so to make the solutions unique.

 

Find attached a Prime 10 files with my modifications. Hope it helps! But be aware that you will check especially my functions Qmin and Qmax thoroughly if they really do what you intended!

 

 

Werner_E
25-Diamond I
(To:Werner_E)

I had a second look at your original Q-functions and I now think (while I still  can't be sure about it) that your A1>B1 etc. lines may simply had been kind of comments and the multiplication with alpha maybe should be done in any case.

Modifying my functions Qmin and Qmax accordingly gives us results which lie more in the magnitudes of the solutions you expect.

Werner_E_0-1758305882407.png

Of course the main problem remains - using less equations than variables to solve for.

 

Dear Werner_E, sorry to bother you again. I’m uploading the worksheet with the details of what I actually want to develop, including the conditions. Many thanks for your help.

DC_11916766_0-1758382500969.png

DC_11916766_1-1758382518502.png

 

 

Werner_E
25-Diamond I
(To:DC_11916766)

Main problem still remains that you have just four equations but solve for seven variables.

Primes solve block tries to find correct solutions and it looks like it succeeded in your first solve block

Concerning the second solve block I used try..onerror as shown before to see which set of input values make the solve block fail.

As you can see there seems to be no input triple for which a solution exists.

Werner_E_0-1758384135050.png

Reason seems to be that your various q, Q functions are NOT using the values Mx,My and Ps you feed into the "solutions" function but always the values for these variables which you have defined somewhere above the definition of these functions.

As shown in my answer above you must add Mx, My and Ps as arguments to your functions.

Once you add these arguments the solve block works but you won't be happy with the solutions either

Werner_E_0-1758385547489.png

 

I can't help with setting up the correct equations for the solve block because I have no experience in your field of work.

Announcements

Top Tags