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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Symbolic operations with complex functions: conjugate, Re and Im

Sergey
15-Moonstone

Symbolic operations with complex functions: conjugate, Re and Im

Hello!

 

I am struggling a bit with the symbolic representation of some complex problems. Please, take a look at the attached file. 

How can I properly define complex function on form z=r*e^(i*phi)? Should I write z(r,phi)=r*e^(i*phi)? If I do so, then the symbolic evaluation of complex potentials (Phi and Psi) doesn't get along. Also, I am trying to use Re and Im functions to define the real and Imaginary parts of "z" without any success. The same goes to the conjugate of "z": it should be z*=r*e^(-i*phi).

Hopefully somebody can help me out.

 

UPDATE:

I did some progress, but still can't define properly function "z" without Mathcad telling that some variable is undefined. Updated sheet is attached.

 

Best regards, Sergey

 

 

 

ACCEPTED SOLUTION

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

Defining z as a function with the arguments r and phi would be the preferred way if you want it actually to be seen as a function, but it works both ways.

z as a function:

Werner_E_0-1698712836983.png

 

z as a variable:

Werner_E_1-1698712889686.png

 

 

View solution in original post

13 REPLIES 13
ttokoro
20-Turquoise
(To:Sergey)

image.pngimage.png

Werner_E
25-Diamond I
(To:Sergey)

Defining z as a function with the arguments r and phi would be the preferred way if you want it actually to be seen as a function, but it works both ways.

z as a function:

Werner_E_0-1698712836983.png

 

z as a variable:

Werner_E_1-1698712889686.png

 

 

Werner_E
25-Diamond I
(To:Werner_E)

Just an additional note: You don't need to provide a guess value if you evaluate the solve block (find) symbolically.

 

To the community: Since which version of Prime has it been possible to evaluate solve blocks symbolically again?
This feature of real Mathcad was broken when Prime entered the stage and I wasn't aware that this option had been reintroduced.
I just tried with Prime 6 and it does not work but I never had installed P7 and P8, so all I can say that it works in P9.

Inserting a region with a symbolic evaluation as a line in a program still does not work as it did in Mathcad, though.

What’s New in PTC Mathcad Prime 9.0.0.0
In this document, find topics introducing the enhancements in this release. Enhancements are categorized by functional area.
•Application Enhancements
◦Text Styles
◦Gradient Operator
◦Internal Links
•Symbolic Engine Enhancements
◦Symbolic Solving of ODEs
◦Logarithmic Integral Functions
◦Elliptic Integral Functions
◦Symbolic Solve Block (find)
◦Symbolic Assumption on Function
◦Definite Integral with complex limits
◦Improvement of Calculus Operators
◦General keyword improvements
◦General function improvements
•Numeric Engine Enhancements
◦PDESolve in Solve Block
◦General function enhancements
•Usability Enhancements
◦Custom Color Picker
◦Go-to Page
◦Current Page Tooltip
◦Math region to Text region conversion

Cheers

Ah, thanks! So P9 is the first version where its possible to symbolically evaluate solve blocks.

I tend not to read the "Whats New" document as of the glacier speed of Primes development, but I was aware of the gradient operator and the symbolic solve of ODEs but I missed symbolic solve block evaluation.

Its funny that they really dare to mention the introduction of a custom color picker in the ninth version of a software in 2023.

Sergey
15-Moonstone
(To:Werner_E)

Nice that we find it out 🙂

Sergey
15-Moonstone
(To:Werner_E)

Thank you very much for help. 

I am in love with Mathcad.

Sergey
15-Moonstone
(To:Werner_E)

How would you performed the symbolic derivation of the function z? When z is defined as a function of r and phi, the derivative is zero. 

 

Sergey_0-1698736893232.png

Sergey_1-1698736911702.png

 

 

ttokoro
20-Turquoise
(To:Sergey)

image.pngimage.pngimage.pngimage.png

Sergey
15-Moonstone
(To:ttokoro)

Thank you @ttokoro !!!

Werner_E
25-Diamond I
(To:Sergey)


@Sergey wrote:

How would you performed the symbolic derivation of the function z? When z is defined as a function of r and phi, the derivative is zero. 

 

Sergey_0-1698736893232.png

Sergey_1-1698736911702.png

 

 


The derivative is zero because Phi(z(,r,phi)) simplifies to an expression in r and phi - no z! So the derivative with respect to z is zero.

 

What you possibly have in mind is easier to accomplish if z is not defined as a function

Werner_E_0-1698758333914.png

but it can also be done with z as a function, but a bit awkward as it uses an auxiliary variable (I used z_) and the modifier "substitute":

Werner_E_1-1698758454517.png

 

 

Sergey
15-Moonstone
(To:Werner_E)

THank you.

 

I find the solution given by @ttokoro is most suitable for this case. I will go forward with it.

Anyway, I appreciate the feedback and your solution.

 

Werner_E
25-Diamond I
(To:Werner_E)

Additional remark:

Depending on your needs, using "substitute" might be something you can use even if z is not defined with respect to r and phi, neither as a variable nor as a function:

Werner_E_0-1698760295266.png

 

Announcements

Top Tags