Skip to main content
10-Marble
December 3, 2023
Solved

This value must be a vector

  • December 3, 2023
  • 2 replies
  • 3711 views

In the solve block there is an issue with my vectorized values where even if they are vectorized the solve block will still ask them to be in vector form.

Also, for some odd reason I believe my if statement asks for a scalar result even though I am following my professors' steps in which his if statement works.

Attached you will find the worksheet in question.

 

Thank you.

Best answer by Werner_E

@terryhendicott wrote:

Hi,

Seems Werner has beat me to it.


🙂

 

The extra pair of parentheses you added are not necessary in Prime,  but I, too, would recommend using them for better clarity.

 

You (resp. @JR_9175191 )  forgot to assign the result to the variable Q so the calculation below the solve block use the guess value which you duplicated in front of the sheet

 

I would also recommend to use explicit vectorization every time we want vectorization to be done and not rely on Primes implicit vectorization.

Werner_E_0-1701652481167.png

 

@JR_9175191 

I have not checked you sheet against it, but you may want to use the input values in this document and see if the results match to ensure that your sheet does not have any hidden typos

https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=92fa1ba8def9d4d6f7c233505271b180e763c8e1

 

 

 

 

2 replies

21-Topaz II
December 3, 2023

Hi,

Do you intend to get three answers for Q to match each length of pipes or one answer for Q after it has passed through three pipes in a line?

Cheers 

Terry

10-Marble
December 3, 2023

Hi Terry,

 

Three answers, one for each pipe.

 

Thank you for your quick reply.

 

Jan

21-Topaz II
December 3, 2023

Hi,

Can you supply the equations for flow given by your instructor?

Cheers

Terry

25-Diamond I
December 4, 2023

Not sure if a negative value is what you expect but you had a least two errors:

1) Your function f() was defined wrongly as at the end you simply typed "Re" instead of the full function call

2) epsilon is defined as a scalar, its not a 3x1 vector, so you should not use it as if it were a vector

Werner_E_0-1701649373697.png

Maybe the way I fixed your function f() is not the way it finally should be ...
Maybe W.s is not supposed to be zero?

 

21-Topaz II
December 4, 2023

Hi,

Seems Werner has beat me to it.

Changes I made are:

Capture.JPG

Capture2.JPG

Capture3.JPG

Capture4.jpg

 

 

Werner_E25-Diamond IAnswer
25-Diamond I
December 4, 2023

@terryhendicott wrote:

Hi,

Seems Werner has beat me to it.


🙂

 

The extra pair of parentheses you added are not necessary in Prime,  but I, too, would recommend using them for better clarity.

 

You (resp. @JR_9175191 )  forgot to assign the result to the variable Q so the calculation below the solve block use the guess value which you duplicated in front of the sheet

 

I would also recommend to use explicit vectorization every time we want vectorization to be done and not rely on Primes implicit vectorization.

Werner_E_0-1701652481167.png

 

@JR_9175191 

I have not checked you sheet against it, but you may want to use the input values in this document and see if the results match to ensure that your sheet does not have any hidden typos

https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=92fa1ba8def9d4d6f7c233505271b180e763c8e1