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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Strange lines on top of the functions while using nested arrays

rsulwinski
10-Marble

Strange lines on top of the functions while using nested arrays

Hello,

I have encountered a very strange problem in Mathcad 15. While using nested arrays to express two functions, the results appeared with having a line on top of the functions. This line does not seem to be mentioned anywhere in the manual and is interfering with calculations of derivatives.

There is of course a workaround by using the substitute function - transforming the functions with the line on top to ones without the line. The problem is, my calculations in general will contain huge amount of sub-functions and their mixed partial derivatives, so fixing the problem manually is very burdensome and inelegant.

Has anyone encountered this problem and found a solution?

Kind regards


Rafal

ACCEPTED SOLUTION

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

The problem must be caused by the fact that I am multiplying functions instead of variables

Either this or is has to do with the fact that the elements are matrices themselves. I am not sure.

But an easy solution could be to transpose the first vector and that way use normal matrix multiplication instead of vector dot product:

Regards

Werner

View solution in original post

10 REPLIES 10

You've hit the quote key instead of the colon.  The result  produces the overbar

Hello Fred,

Thank you for your reply. I did not know about the complex conjugate operator, however I have not used the quote key - all my definitions were established using the colon. The problem is, Mathcad is showing the results of multiplication of two nested arrays with the overbar, with me not having used the overbar in any previous definitions. Still, I found it is possible to obtain the results without the overbar in the "U.total" function if the overbar [ " ] is applied to "U.0", "U.1" and "U.2" functions.

Best regards


Rafal 

When I open your file, it's "broken":

And the green derivative is:

(Note that there are complex conjugate overbars in this expression.  The next lines  I see are:

Which is why I assumed that you were typing the left hand side.  If you copied that left hand side from the green derivative, then I suggest might work.

In the attachment you can find snapshots of the calculated worksheet. I wrote the last expression (I actually copied it from the "U.total" soution) with the overbar to show that it is making the function unusable for any further calculations.

The snapshots should be self explanatory.

I see that you have the overbar on the rhs of your expression:

Having a complex conjugate on the RHS of an expression is okay, you're telling Mathcad, "evaluate this expression then take the complex conjugate of the result."  That's why the "new" expression below works-- I've defined U(r,x) as the complex conjugate og u(r,x)

But you can't tell Mathcad "the complex conjugate of this function is _________, it doesn't understand it.  For the same reason you can't write

and expect Mathcad to understand, although you and I can deduce that x = 9/4, Mathcad doesn't understand what's on the left hand side (LHS).  Now, if you make U_total a function of x and f Mathcad can evaluate it:

Werner_E
25-Diamond I
(To:rsulwinski)

Mathcad correctly conforms to the mathematical definition of the dot product

-> Dot product - Wikipedia

and unless told otherwise it defaults to complex numbers

And - no, you can't use the conjugate operator on the LHS of an assignment.

Regards

Werner

Hello Werner,

You are right. Mathcad is doing everything accordingly to mathematical definition of the dot product.

Taking the real part is the solution that is seek. I have checked the "assume, ALL = real" on my problem and unfortunately it does not work. The problem must be caused by the fact that I am multiplying functions instead of variables (I have z*u(fi,x) instead of a1*b1 which works).

I have attached a snapshot showing all possible combinations with "assume, , = real" which do not work.

Best regards


Rafal

Werner_E
25-Diamond I
(To:rsulwinski)

The problem must be caused by the fact that I am multiplying functions instead of variables

Either this or is has to do with the fact that the elements are matrices themselves. I am not sure.

But an easy solution could be to transpose the first vector and that way use normal matrix multiplication instead of vector dot product:

Regards

Werner

Indeed, taking transpose of the first vector solves the problem. No dot products and complex numbers. Thank you very much for your help Werner! Much appreciated.

Best regards

Rafal

Werner_E
25-Diamond I
(To:Werner_E)

Here is another solution using vectorization and vector sum, but I would stay with the transposed vector as described before.

Announcements

Top Tags