Changeset b85227d in sasmodels
 Timestamp:
 Dec 14, 2017 6:16:05 PM (7 years ago)
 Branches:
 master, core_shell_microgels, magnetic_model, ticket1257vesicleproduct, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
 Children:
 c654160
 Parents:
 ef85a09
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

doc/guide/plugin.rst
ref85a09 rb85227d 556 556 557 557 For 1D oriented shapes, an integral over all angles is usually needed for 558 the *Iq* function. Usingsymmetry and the substitution $u = \cos(\alpha)$,558 the *Iq* function. Given symmetry and the substitution $u = \cos(\alpha)$, 559 559 $du = \sin(\alpha)\,d\alpha$ this becomes 560 560 561 561 .. math:: 562 562 563 I(q) &= \int_{\pi/2}^{pi/2} \int_{pi}^{pi} 564 F(q_a = q \sin(\alpha)\sin(\beta), 565 q_b = q \sin(\alpha)\cos(\beta), 566 q_c = q \cos(\alpha))^2 \sin(\alpha)\,d\beta\,d\alpha/(4\pi) \\ 567 &= 8/(4\pi) \int_{0}^{pi/2} \int_{0}^{\pi/2} F^2 \sin(\alpha)\,d\beta\,d\alpha \\ 568 &= 8/(4\pi) \int_0^1 \int_{0}^{\pi/2} F^2 \,d\beta\,du 563 I(q) &= \frac{1}{4\pi} \int_{\pi/2}^{pi/2} \int_{pi}^{pi} 564 F(q_a, q_b, q_c)^2 \sin(\alpha)\,d\beta\,d\alpha \\ 565 &= \frac{8}{4\pi} \int_{0}^{pi/2} \int_{0}^{\pi/2} 566 F^2 \sin(\alpha)\,d\beta\,d\alpha \\ 567 &= \frac{8}{4\pi} \int_1^0 \int_{0}^{\pi/2}  F^2 \,d\beta\,du \\ 568 &= \frac{8}{4\pi} \int_0^1 \int_{0}^{\pi/2} F^2 \,d\beta\,du 569 570 for 571 572 .. math:: 573 574 q_a &= q \sin(\alpha)\sin(\beta) = q \sqrt{1u^2} \sin(\beta) \\ 575 q_b &= q \sin(\alpha)\cos(\beta) = q \sqrt{1u^2} \cos(\beta) \\ 576 q_c &= q \cos(\alpha) = q u 569 577 570 578 Using the $z, w$ values for GaussLegendre integration in "lib/gauss76.c", the … … 581 589 double sin_beta, cos_beta; 582 590 SINCOS(beta, sin_beta, cos_beta); 591 const double qa = sin_alpha * sin_beta * q; 583 592 const double qb = sin_alpha * cos_beta * q; 584 const double qa = sin_alpha * sin_beta * q; 585 const double Fq = F(qa, qb, qc, ...); 586 inner_sum += GAUSS_W[j] * Fq*Fq; 593 const double form = Fq(qa, qb, qc, ...); 594 inner_sum += GAUSS_W[j] * form * form; 587 595 } 588 596 outer_sum += GAUSS_W[i] * inner_sum; … … 602 610 .. math:: 603 611 604 I(q) &= \int_{\pi/2}^{\pi/2} F(q_{ab} = q \sin(\alpha), 605 q_c = q \cos(\alpha))^2 \sin(\alpha)\,d\alpha/\pi \\ 606 &= (2/\pi) \int_0^1 F^2\,du 612 I(q) &= \frac{1}{\pi}\int_{\pi/2}^{\pi/2} 613 F(q_{ab}, q_c)^2 \sin(\alpha)\,d\alpha/\pi \\ 614 &= \frac{2}{\pi} \int_0^1 F^2\,du 615 616 for 617 618 .. math:: 619 620 q_{ab} &= q \sin(\alpha) = q \sqrt{1  u^2} \\ 621 q_c &= q \cos(\alpha) = q u 622 607 623 608 624 with integration loop:: … … 612 628 const double cos_alpha = 0.5*GAUSS_Z[i] + 0.5; 613 629 const double sin_alpha = sqrt(1.0  cos_alpha*cos_alpha); 630 const double qab = sin_alpha * q; 614 631 const double qc = cos_alpha * q; 615 const double qab = sin_alpha * q; 616 const double Fq = F(qab, qc, ...); 617 sum += GAUSS_W[j] * Fq*Fq; 632 const double form = Fq(qab, qc, ...); 633 sum += GAUSS_W[j] * form * form; 618 634 } 619 635 sum *= 0.5; // = 2/pi * sum * (pi/2) / 2
Note: See TracChangeset
for help on using the changeset viewer.