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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

array dimensions not matching

YA_10963798
8-Gravel

array dimensions not matching

I spent five hours trying to solve this problem, however could not figure  it out, can you please  help the sheet is attached 

Screenshot 2024-03-31 164333.png

1 ACCEPTED SOLUTION

Accepted Solutions

Hi

All three variables are one column vectors. 

sigma0 is 11 high

hdash is 9 high

phi is 11 high 

They by matrix multiplication cannot be multiplied together.

I do not know the context of the equation in the scheme of things so there is two options.

 

multiply h'dash x (sigma0 transposed) to get a 9 x 11 matrix multiplied by phi  for a nine row column vector.

 

add some elements to hdash to get it to a 11 x 1 column vector to match size of sigma0 and phi then use vectorized element x element multiplication across the three matrices0

 

The ctrl equal signs in the example below should be changed to the consignment equals ":="

 

terryhendicott_0-1711907720810.png

View solution in original post

3 REPLIES 3

Hi

All three variables are one column vectors. 

sigma0 is 11 high

hdash is 9 high

phi is 11 high 

They by matrix multiplication cannot be multiplied together.

I do not know the context of the equation in the scheme of things so there is two options.

 

multiply h'dash x (sigma0 transposed) to get a 9 x 11 matrix multiplied by phi  for a nine row column vector.

 

add some elements to hdash to get it to a 11 x 1 column vector to match size of sigma0 and phi then use vectorized element x element multiplication across the three matrices0

 

The ctrl equal signs in the example below should be changed to the consignment equals ":="

 

terryhendicott_0-1711907720810.png

I can't add or delete values it will effect the result

FieldEng
6-Contributor
(To:YA_10963798)

I think you misunderstood what terryhendicott is saying.  You have vectors of different lengths.  The only way that you can multiply them is if their dimensions agree.  h' has only 9 elements, while the other two vectors have 11.  By definition, you're missing two elements in h'. 

 

The equation you have written implies that you're trying to solve for Fs.  If you take the 10th element of sigma_0, and multiply by the 10th element of h', there's nothing there.  h'(10) doesn't exist.  

 

As terryhendicott said, you need to use the ":=".  This assigns the values to the variable "Fs". Otherwise, when you use the "Fs = ",  you're asking Mathcad to give you the value of Fs.

Top Tags