2
$\begingroup$

I have a problem with this 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]

Functions u and v should be real-valued functions. Can I get their analytical form? I tried to use ComplexExpand, but still has something like Arg[(x + I y) (47. + x + I y)].

Then I calculate derivative with Final = D[v, x] - D[u, y]. I don't understand why this line doesn't work:

Plot3D[Final, {x, -b, -b/10}, {y, b/10, b}, AxesLabel -> Automatic]
$\endgroup$
3
  • 4
    $\begingroup$ The problem with Final is that you are taking derivatives of expressions that have Re and Im as Heads. Mathematica doesn't like taking derivatives of those functions: look at the output of D[Re[f[x]],x]. The same thing happens with Conjugate, so doing the obvious thing of replacing Re[a] with (a + Conjugate[a])/2 won't work. $\endgroup$
    – march
    Commented Nov 13, 2015 at 18:36
  • $\begingroup$ I suspect you need to use numerical derivatives. Have a look at ND ( which requires the NumericalCalculus package: do Needs["NumericalCalculus"]` $\endgroup$
    – george2079
    Commented Nov 13, 2015 at 20:49
  • $\begingroup$ Have you tried an explicit TargetFunctions -> {Re, Im} setting in ComplexExpand[]? $\endgroup$ Commented Nov 14, 2015 at 3:11

1 Answer 1

2
$\begingroup$
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 = ComplexExpand[((1 - 2 nu)*Re[Zline] - y*Im[Z])/(2 G), 
   TargetFunctions -> {Re, Im}];
v = ComplexExpand[(2*(1 - nu)*Im[Zline] - y*Re[Z])/(2 G), 
   TargetFunctions -> {Re, Im}];
Final = D[v, x] - D[u, y];



   Plot3D[Final, {x, -b, -b/10}, {y, b/10, b}, AxesLabel -> Automatic, 
 BaseStyle -> FontSize -> 18, AxesStyle -> Black]

enter image description here

$\endgroup$
2
  • $\begingroup$ Knew it'd work… $\endgroup$ Commented Nov 14, 2015 at 6:51
  • $\begingroup$ Thank you very much! Now I need understand why there are points of discontinuity... They definitely should not be here $\endgroup$
    – Trarbish
    Commented Nov 15, 2015 at 6:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.