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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Translate the entire conversation x

Must be a factor

YA_10963798
14-Alexandrite

Must be a factor

Hi there

I have a problem with this function . The issue is R is a cumulative value so the R2=R0+R1> 

R3= R0+R1+R2 and so on... I wanted to implement that in this function but an error ( must be a vector ) shows 

Is there a way to fix this or to write it differently 

YA_10963798_0-1768299322575.png

Thanks 

The sheet is attached prime 11 

34 REPLIES 34
Werner_E
25-Diamond I
(To:YA_10963798)

There should be no difference between an explicit and an implicit (invisible) multiplication.

Implicit multiplication is called "scaling operator" by PTC and usually is used between a quantity and its unit, like in

Werner_E_0-1768996016128.png

which seems to be the reason why PTC has chosen Ctrl-Shift-U  for the keyboard short.

But its allowed to use that operator between two 'normal' variables or constants as well, as you did for some reason. Problem only may be that its harder to read and to distinguish between a single variable H2O4 and the product H2 O4..

There is one difference though and this is why we could use that scaling operator as some sort of postfix notation when calling a function: If the second operand is a function name, this function is applied to the first operand:

Werner_E_1-1768997006539.png

 

According your other problem I sure would need a worksheet to play with (preferably with small demo data and nice simple variable names) and this time it should clearly show the problem you experience. It's still the many NaN's, or is it something else?
It's necessary that you clearly state what the problem is! E.g. in your last post you wrote " the difference now my M,f1 and q are nested "  but the screenshot you showed below this statement did not use any f1 or q - that's confusing! f1 and q were seen in the screenshot above this statement but this seems to be working as expected.

 

YA_10963798
14-Alexandrite
(To:YA_10963798)

Hi Werner 

Thank you for the explanation . Now it is clearer in mind that the difference between the two dots doesn't mean dot product and vector product . 

 

For my problem . Yes f2 still all NaN unfortunately. 

in my original sheet this is the result 

 

YA_10963798_0-1768999032421.png

but I got M 

YA_10963798_1-1768999077054.png

I'm trying to do the same function in smaller sheet for you to use , but I got this 

YA_10963798_2-1768999208665.png

actually it is not important for me in this mock sheet because I have the results in the main sheet ... but I need to fix the step after to find f2 and write the correct iterator 

Can you help me with this ... would you just got any results for M and fix f2 ? 

Thanks 

Yusra 

Werner_E
25-Diamond I
(To:YA_10963798)

I feel like we're going around in circles! 😞
The sheet you just posted shows (again, or still) the already explained problem with the 1x3 matrix instead of the expected 3x1 matrix.

That should have been dealt with and sorted out long ago!

 


@YA_10963798 wrote:

Hi Werner 

Thank you for the explanation . Now it is clearer in mind that the difference between the two dots doesn't mean dot product and vector product . 

 


Both operators give you the vector dot product if applied to two vectors unless you explicitly vectorize the expression

Werner_E_0-1769003295101.png

 

The outer vector product (cross product) is a separate operator and accepts 3x1 vectors only

Werner_E_1-1769003368850.png

 

YA_10963798
14-Alexandrite
(To:Werner_E)

In my original sheet it is working I got M ... but yes there all matrix have the same dimensions . 

See I got M 

YA_10963798_0-1769004026782.png

 

I need to fix f2 only 

so even if you fix M anyway you prefer it is okay . I just need to fix the iterator in f2 function 

Do you want me to share the original sheet ? 

 

Werner_E
25-Diamond I
(To:YA_10963798)

Can't you create a simple  but correct demo sheet duplicating the problem.

I guess I will be much too confused by the many similar but different irritating variable names and the huge data of your original sheet.

I think its important to break down the problem to its basic cause and honestly I don't understand your "I need to fix f2 only" as i can't see any f2 anywhere and would not know what to fix.

 

BTW, in your original sheet - are you sure that the three elements of M.i.center are normal 1594x1 vectors containing just scalars and NaN's?

Try to display one of these vectors -> M.i.center[1=  and see what the result is. 

Announcements

Top Tags