Message Boards Message Boards

0
|
7652 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Derivative of the imaginary/real part of the complex function

Posted 9 years ago

Hi all!

I struggle with a following code:

b = 2*23.5;
nu = 0.3;
Ee = 10^5;
h = 4.5;
z = x + y*I;
G = Ee/(2*(1 + nu));
Zline = (Ee*2*h)/(2*Pi*(1 - nu^2))*ArcSinh[Sqrt[z/b]];
Z = (Ee*2*h)/(2*Pi*(1 - nu^2))*1/Sqrt[z (z + b)];
u = ((1 - 2 nu)*Re[Zline] - y*Im[Z])/(2 G);
v = (2*(1 - nu)*Im[Zline] - y*Re[Z])/(2 G);
Final = D[v, x] - D[u, y]
Plot3D[Final, {x, -b, -b/10}, {y, b/10, b}, AxesLabel -> Automatic]
Plot3D[u, {x, -b, 0}, {y, 0, b}, AxesLabel -> Automatic]
Plot3D[v, {x, -b, 0}, {y, 0, b}, AxesLabel -> Automatic]

As you see, there are complex function Zline and Z. I use real and imaginary parts of these function in "u" and "v". Then I would like to calculate the derivative and plot it. Unfortunately, it doesn't work. Please, any suggestions? And the second problem, when I plot "u" there is a point of discontinuity. According to the problem (this is a displacement field), there should not be such points.

POSTED BY: Ilia V
3 Replies

I have a similar problem. I have given

qout = ((z (-2 f^2 - 2 f z + L z))/f^2 + (
  I ? wd^2 (-1 + ((-2 f + L) z)/f^2))/?)/(-1 + ((-2 f + L) z)/f^2 + (
  I (-2 f + L) ? wd^2)/(f^2 ?))

and $Assumptions = {Element [?, Reals], ? > 0, Element [f, Reals], f > 0, Element [Zr, Reals], Zr > 0, Element [wd, Reals], Element [w, Reals], w > 0, Element [L, Reals], L > 0, Element [z, Reals], Element [wr, Reals], wr > 0, Element [Rr, Reals], Rr > 0}

So the Im [1/qout] gives:

(f^2 + 2 f z - L z) ((2 f - L) ?^2 wd^4 + 
    z (2 f^2 + 2 f z - L z) ?^2) Im[1/(
   ?^2 wd^4 (f^2 + 2 f z - L z)^2 + 
    z^2 (2 f^2 + 2 f z - L z)^2 ?^2)] - (
 f^4 ? wd^2 Re[1/(
   z^2 (2 f^2 + 2 f z - L z)^2 + (?^2 wd^4 (f^2 + 2 f z - L z)^2)/
    ?^2)])/?

By searching, I found that Mathematica returns 0 if I put Imaginary [z^2 (2 f^2 + 2 f z - L z)^2] but not when it is in the denominator. Imaginary [(z^2 (2 f^2 + 2 f z - L z)^2)^-1] which is relly weird since the inverse of real number is real!

POSTED BY: Kostas Mavrakis
Posted 9 years ago

Thank you for the reply, Sean!


About problem 1. Thank you for your explanations. If I understand correctly there is a problem also with other Re and Im parts. For example, Im[Z] gives:

157406. Im[1/Sqrt[(x + I y) (47. + x + I y)]]

Well, If I write Im[Z] // ComplexExpand I get:

(0. + 0. I) - (
 157406. Sqrt[Sqrt[x^2 + y^2] Sqrt[(47. + x)^2 + y^2]]
   Sin[1/2 Arg[(x + I y) (47. + x + I y)]])/(
 Sqrt[x^2 + y^2] Sqrt[(47. + x)^2 + y^2])

So there are still complex numbers (x + I y). It is strange, isn't it? Also I noticed that another way to make x and y real doesn't work:

Refine[Im[Z], {Element[x, Reals], Element[y, Reals]}]
157406. Im[1/Sqrt[(x + I y) (47. + x + I y)]]

About Problem 2. According to above, Im[Z] is a complex valued function (actually it should not be complex). However, I can plot it.

Plot3D[Im[Z], {x, -b, 0}, {y, 0, b}, AxesLabel -> Automatic]

So why I can plot complex Im[Z], but cannot plot complex Final? Thank you again for your help!

POSTED BY: Ilia V

Problem1. If you take a look at your equations, you can see "Im" and "Re". You are accidentally trying to differentiate these (which you can't really do). It's important to look back and see which part of your code behaves unexpectedly.

The problem is that Re[Zline] doesn't evaluate the way you think it does. It returns:

157406. Re[ArcSinh[0.145865 Sqrt[x + I y]]]

Mathematica doesn't know what x and y are Real values unless you tell it. One way of doing this is to use the ComplexExpand function.

Problem 2. You cannot plot "Final". It is a complex valued function. Maybe you didn't instead it to be? If so, then there's something wrong with your calculations. In some cases, there are very small imaginary components caused by floating point error. These can be removed with the Chop function as shown:

Plot3D[Chop[Final], {x, -b, -b/10}, {y, b/10, b}, AxesLabel -> Automatic]

The imaginary values for "Final" are not negliable however. So, this won't work. You can choose to plot the real and imaginary values separately:

Plot3D[{Re[Final], Im[Final]}, {x, -b, -b/10}, {y, b/10, b},  AxesLabel -> Automatic]
POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract