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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

PLS HELP! Error with the arrays at system of equations dealing with matrix.

epickakarot
4-Participant

PLS HELP! Error with the arrays at system of equations dealing with matrix.

Hello everyone!

I´m trying to solve a system of equations with vectors and the solver tell me that there is an error in the array... I put captures so you can see what im doing.

Thanks to everyone!

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:epickakarot)

I am surprised that you got a solution because when I tried I got the error message that no solution was found. Maybe I inadvertently changed an equation when I edited the file.

 

Anyway, the result you get in your variable solucion is a nested vector. A vector with six elements, each of which is a 12x1 matrix, a 12 element vector. By default Prime does not expand them when displaying but you can change that in the ribbon menu for array and tables.

You can also access a single result vector using vector indices.

So solucion[2= should show you the vector T.ico.

 

A better way probably is not to assign the result of the reply of the solve block to a single variable "Solucion" but to a vector of variables, like that:

Werner_E_0-1585568144419.png

In my first reply I forgot to mention why you should get rid of the square brackets. When you manually type a square bracket, you create a vector or matrix (like when you type Ctrl-M) which is sure not what you intended.

 

View solution in original post

10 REPLIES 10
LucMeekes
23-Emerald III
(To:epickakarot)

Yes, pictures are fine. But the worksheet is of much more help.

You should ALWAYS attach the (or a) worksheet that, at least minimally, shows your problem.

 

Success!

Luc

epickakarot
4-Participant
(To:LucMeekes)

Here is the file, wish it is clear

Is at the end of the file

LucMeekes
23-Emerald III
(To:epickakarot)

In the Guess values part you've nicely placed guess values for each of your variables to be solved.

No look at the labels of your guess values, and the labels of the parameters of the Find function. The guess values are labelled 'variable', while the parameters of the Find function are 'automatic'. Change those to 'variable' and see what happens.

 

Success!
Luc

 

epickakarot
4-Participant
(To:LucMeekes)

I´ve change the labels in the solver part. It keeps telling me the array error...

I also tried to define the variables as numbers, escalars, and do it twelve times once per month so it doesnt have to deal with matrices. But then it tell me to change the input values or to change TOL or CTOL. Even i put those as high as possible and i tried changing the input variables and no success in the resolution. I dont know what to do next ;(

LucMeekes
23-Emerald III
(To:epickakarot)

One more, simple thing:

Remove the '=' that follows your Find() function.

(Although many times it works as expected, I've seen too many occasions where a definition including an evaluation causes trouble).

 

Success!
Luc

epickakarot
4-Participant
(To:LucMeekes)

Same error. I have try to change again between variable or automatic without the = after the Find() but with none of those labels works ;(

Werner_E
25-Diamond I
(To:epickakarot)

Get rid of all the square brackets you typed manually! Especially the ones in your first equation which is the reason for the error message about the wrong array dimension.

Furthermore you should change your guess values to avoid the division by zero when using them (third equation).

 

Generally a much better approach would be to set up the solve block using just single scalar values, turn the solve block in a function with T.0 and T.red as arguments and then call this function vectorized.

 

epickakarot
4-Participant
(To:Werner_E)

Hello Werner, i did that and now there is no error but i cant see the solution for each variable, how can i see them?

Werner_E
25-Diamond I
(To:epickakarot)

I am surprised that you got a solution because when I tried I got the error message that no solution was found. Maybe I inadvertently changed an equation when I edited the file.

 

Anyway, the result you get in your variable solucion is a nested vector. A vector with six elements, each of which is a 12x1 matrix, a 12 element vector. By default Prime does not expand them when displaying but you can change that in the ribbon menu for array and tables.

You can also access a single result vector using vector indices.

So solucion[2= should show you the vector T.ico.

 

A better way probably is not to assign the result of the reply of the solve block to a single variable "Solucion" but to a vector of variables, like that:

Werner_E_0-1585568144419.png

In my first reply I forgot to mention why you should get rid of the square brackets. When you manually type a square bracket, you create a vector or matrix (like when you type Ctrl-M) which is sure not what you intended.

 

epickakarot
4-Participant
(To:Werner_E)

Done, changing the option "convert nested arrays" it displays all the values.

THANK YOU!!

 

Announcements

Top Tags