Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

** Community Tip** - Learn all about the Community Ranking System, a fun gamification element of the PTC Community.
X

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Mar 29, 2020
11:27 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 29, 2020
11:27 AM

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!

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

Mar 30, 2020
07:36 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 30, 2020
07:36 AM

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:

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.

10 REPLIES 10

Mar 29, 2020
01:51 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 29, 2020
01:51 PM

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

Mar 29, 2020
01:56 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 29, 2020
04:18 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 29, 2020
04:18 PM

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

Mar 29, 2020
05:00 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 29, 2020
05:00 PM

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 ;(

Mar 29, 2020
05:07 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 29, 2020
05:07 PM

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

Mar 29, 2020
05:21 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 29, 2020
05:21 PM

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

Mar 30, 2020
07:10 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 30, 2020
07:10 AM

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.

Mar 30, 2020
07:17 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 30, 2020
07:17 AM

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?

Mar 30, 2020
07:36 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 30, 2020
07:36 AM

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:

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.

Mar 30, 2020
07:43 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 30, 2020
07:43 AM

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

THANK YOU!!