Message Boards Message Boards

0
|
3018 Views
|
1 Reply
|
3 Total Likes
View groups...
Share
Share this post:

Derive after Nintegration or symbolic integration?

Posted 5 years ago

j1 = 0.9

j3 = 0.9
j4 = 0.1
jz = 0.5
d1 = 0.1
d2 = 0.1

z = 4

r1 = 1/2 (Cos[x] + Cos[y])
r2 = Cos[x]*Cos[y]
a = 2*(j1 - j2 + j2*r2 - j1*r1)*z*sa + d1*(2*sa - 1) + jz*sb
b = 2*(j3 - j4 + j4*r2 - j3*r1)*z*sb + d2*(2*sb - 1) + jz*sa
c = jz*Sqrt[sa*sb]
ecl = (j2 - j1)*n*z*sa^2 - d1*n*sa^2 + (j4 - j3)*n*z*sb^2 - 
  d2*n*sb^2 - jz*n*sa*sb

(*A+B>0*)
w1 = ((a - b)*((a + b)^2 - 4*c^2) + ((a + b)^2 + 4*c^2)*
     Sqrt[(a + b)^2 - 4*c^2])/(2*((a + b)^2 - 4*c^2))
w2 = ((-a + b)*((a + b)^2 - 4*c^2) + ((a + b)^2 + 4*c^2)*
     Sqrt[(a + b)^2 - 4*c^2])/(2*((a + b)^2 - 4*c^2))
q1 = w1/(Exp[w1/t] - 1)
q2 = w2/(Exp[w2/t] - 1)

sa = 0.5
sb = 0.5
j2 = 0.3

D[(1/(4*Pi^2))*NIntegrate[q1 + q2, {y, -Pi, Pi}, {x, -Pi, Pi}], t]

1.If NIntegrate is used in the last derivation, the following error will occur and the value of 0 will be returned. NIntegrate::inumr: The integrand ((0. +4. (0.8 +Times[<<3>>]+Times[<<2>>])-4. (0.6 +Times[<<3>>]+Times[<<2>>])) ..... Plus[<<3>>]+4. Plus[<<3>>])^2)) has evaluated to non-numerical values for all sampling points in the region with boundaries {{0,3.14159},{0,3.14159}}.

2.Doubts should be caused by the fact that the variable t is not assigned, but I have to derive t, so I can't assign value. Is it impossible to use NIntegrate? 3.Finally, I use Integrate, but I can't work it out. Is there any convenient way? PS: I only need a numerical value at last, and I don't need a formula, so I try to use NIntegrate.Thank you very much.

POSTED BY: qin richard

Maybe so:

j1 = 9/10;
j3 = 9/10;
j4 = 1/10;
jz = 1/2;
d1 = 1/10;
d2 = 1/10;
z = 4;
r1 = 1/2*(Cos[x] + Cos[y]);
r2 = Cos[x]*Cos[y];
a = 2*(j1 - j2 + j2*r2 - j1*r1)*z*sa + d1*(2*sa - 1) + jz*sb;
b = 2*(j3 - j4 + j4*r2 - j3*r1)*z*sb + d2*(2*sb - 1) + jz*sa;
c = jz*Sqrt[sa*sb];
ecl = (j2 - j1)*n*z*sa^2 - d1*n*sa^2 + (j4 - j3)*n*z*sb^2 - 
d2*n*sb^2 - jz*n*sa*sb;
w1 = ((a - b)*((a + b)^2 - 4*c^2) + ((a + b)^2 + 4*c^2)*
  Sqrt[(a + b)^2 - 4*c^2])/(2*((a + b)^2 - 4*c^2));
w2 = ((-a + b)*((a + b)^2 - 4*c^2) + ((a + b)^2 + 4*c^2)*
  Sqrt[(a + b)^2 - 4*c^2])/(2*((a + b)^2 - 4*c^2));
q1 = w1/(Exp[w1/t] - 1);
q2 = w2/(Exp[w2/t] - 1);
sa = 1/2;
sb = 1/2;
j2 = 3/10;

n = 1;(* I assume *)

FUNC[T_?NumericQ] :=(1/(4 \[Pi]^2))*NIntegrate[Evaluate[D[q1 + q2, t] /. t -> T], {x, -Pi, Pi}, {y, -Pi, Pi}, Method -> "LocalAdaptive"]

FUNC[2] (* for t = 2 *)
(*  1.59329  *)

Plot[FUNC[T], {T, 1/100, 1}]

enter image description here

POSTED BY: Mariusz Iwaniuk
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