Prev: Identifying workspaces
Next: notch filter problem
From: Patricio on 16 Apr 2010 17:55 I tried the following M-file: clc clear all syms x f=(x^2/exp(x^2/2) - 1/exp(x^2/2) + 4)^2; a=-3; b=3; Integral=real(double(int(f,a,b))); fprintf('Integral value: %5.3f',Integral); disp(' ') Even though the condition "Warning: Explicit integral could not be found" is printed on the screen, the calculation is always done. Could someone tell me if the result is correct and how was the calculations done? Thanks, Patricio
From: Walter Roberson on 16 Apr 2010 18:28 Patricio wrote: > I tried the following M-file: > > clc > clear all 'clear all' inside an .m file is almost always unnecessary and unwanted (but it wouldn't have caused what you saw) > syms x > f=(x^2/exp(x^2/2) - 1/exp(x^2/2) + 4)^2; > a=-3; > b=3; > Integral=real(double(int(f,a,b))); > fprintf('Integral value: %5.3f',Integral); > disp(' ') > Even though the condition "Warning: Explicit integral could not be > found" is printed on the screen, the calculation is always done. > Could someone tell me if the result is correct and how was the > calculations done? The calculation would be done numerically. However, there should not be any problem in integrating that function -- Maple finds it without difficulty. 1/2*a^3 * exp(-a^2) - 1/4 * a * exp(-a^2) - 3/8 * Pi^(1/2) * erf(a) + 8 * a * exp(-1/2*a^2) - 16*a - 1/2 * b^3 * exp(-b^2) + 1/4 * b * exp(-b^2) + 3/8 * Pi^(1/2) * erf(b) -8 * b * exp(-1/2 * b^2) + 16 * b Over -3 to 3, that simplifies to -51/2 * exp(-9) + 96 + 3/4 * Pi^(1/2) * erf(3) - 48 * exp(-9/2)
From: Patricio on 16 Apr 2010 19:11 Walter Roberson <roberson(a)hushmail.com> wrote in message <hqaoaq$odr$1(a)canopus.cc.umanitoba.ca>... > Patricio wrote: > > I tried the following M-file: > > > > clc > > clear all > > 'clear all' inside an .m file is almost always unnecessary and unwanted (but > it wouldn't have caused what you saw) > > > syms x > > f=(x^2/exp(x^2/2) - 1/exp(x^2/2) + 4)^2; > > a=-3; > > b=3; > > Integral=real(double(int(f,a,b))); > > fprintf('Integral value: %5.3f',Integral); > > disp(' ') > > > Even though the condition "Warning: Explicit integral could not be > > found" is printed on the screen, the calculation is always done. > > Could someone tell me if the result is correct and how was the > > calculations done? > > The calculation would be done numerically. > > However, there should not be any problem in integrating that function -- Maple > finds it without difficulty. > > > 1/2*a^3 * exp(-a^2) - 1/4 * a * exp(-a^2) - 3/8 * Pi^(1/2) * erf(a) + 8 * a * > exp(-1/2*a^2) - 16*a - 1/2 * b^3 * exp(-b^2) + 1/4 * b * exp(-b^2) + 3/8 * > Pi^(1/2) * erf(b) -8 * b * exp(-1/2 * b^2) + 16 * b > > Over -3 to 3, that simplifies to > -51/2 * exp(-9) + 96 + 3/4 * Pi^(1/2) * erf(3) - 48 * exp(-9/2) Dear Walter, I was working whith MuPad. Nevertheless, the following exemple has the same behavior in Maple: clc syms x f=(-2/9/x^(4/3)-8/9/(1-x^2)^(5/3)*x^2-2/3/(1-x^2)^(2/3))^2; intsym=int(f,a,b) a=0.001; b=0.99; intdouble=real(double(int(f,a,b))) Patricio
From: Walter Roberson on 17 Apr 2010 00:45 Patricio wrote: > I was working whith MuPad. Nevertheless, the following exemple has the > same behavior in Maple: > > clc > syms x f=(-2/9/x^(4/3)-8/9/(1-x^2)^(5/3)*x^2-2/3/(1-x^2)^(2/3))^2; > intsym=int(f,a,b) > a=0.001; > b=0.99; > intdouble=real(double(int(f,a,b))) Not everything has a closed form integral, and sometimes if the integral does exist it can be difficult to find it. After a few steps, Maple is telling me that the above intsym does have a closed form, which can be represented as below. Getting it to this point required a small amount of expression rewriting, one step of which was obvious and the second was not obvious that it would have an effect. (14/27) * (( -2 * a^2 / ((a - 1) * (a + 1)))^(11/12) * ( -2 / ((b - 1) * (b + 1)))^(17/12) * ( -(b - 1) * (b + 1))^(29/6) * ( -(1954/33) * a^(47/3) + (21718/165) * a^(41/3) + (16207/1155) * a^(53/3) + a^(5/3) - (30398/165) * a^(35/3) + (11/105) * a^(71/3) + (3235/77) * a^(17/3) - (122147/1155) * a^(23/3) + (197566/1155) * a^(29/3) - (11237/1155) * a^(11/3) - (281/1155) * a^(59/3) - (23/35) * a^(65/3)) * ( -2 / ((a - 1) * (a + 1)))^(1/2) * (b^(23/6) - 4 * b^(59/6) - 4 * b^(35/6) + b^(71/6) + 6 * b^(47/6)) * hypergeom([1/6, 5/6], [17/6], a^2 / ((a - 1) * (a + 1))) - ( -(a - 1) * (a + 1))^(29/6) * ( -2 / ((b - 1) * (b + 1)))^(1/2) * ( -2 / ((a - 1) * (a + 1)))^(17/12) * ( -2 * b^2/((b - 1) * (b + 1)))^(11/12) * ( -(122147/1155) * b^(23/3) - (30398/165) * b^(35/3) - (11237/1155) * b^(11/3) + (16207/1155) * b^(53/3) + b^(5/3) - (281/1155) * b^(59/3) - (23/35) * b^(65/3) + (21718/165) * b^(41/3) + (11/105) * b^(71/3) + (197566/1155) * b^(29/3) + (3235/77) * b^(17/3) - (1954/33) * b^(47/3)) * ( -4 * a^(35/6) - 4 * a^(59/6) + a^(71/6) + 6 * a^(47/6) + a^(23/6)) * hypergeom([1/6, 5/6], [17/6], b^2 / ((b - 1) * (b + 1))) - (192/1309) * ( -2 * a^2 / ((a - 1) * (a + 1)))^(17/12) * ( -2 / ((b - 1) * (b + 1)))^(17/12) * ( -(b - 1) * (b + 1))^(29/6) * ((406/15) * a^(44/3) - (536/15) * a^(26/3) + a^(8/3) - (106/15) * a^(14/3) - (476/15) * a^(38/3) + (211/15) * a^(56/3) + (11/15) * a^(68/3) + (319/15) * a^(20/3) - (74/15) * a^(62/3) - (344/15) * a^(50/3) + (574/15) * a^(32/3)) * (b^(23/6) - 4 * b^(59/6) - 4 * b^(35/6) + b^(71/6) + 6 * b^(47/6)) * hypergeom([1/6, 5/6], [23/6], a^2 / ((a - 1) * (a + 1))) + (5/7) * ( -2 / ((a - 1) * (a + 1)))^(17/12) * ((192/935) * ( -(a - 1) * (a + 1))^(29/6) * ( -2 * b^2 / ((b - 1) * (b + 1)))^(17/12) * (b^(8/3) + (319/15) * b^(20/3) + (406/15) * b^(44/3) - (106/15) * b^(14/3) + (211/15) * b^(56/3) + (574/15) * b^(32/3) - (344/15) * b^(50/3) - (536/15) * b^(26/3) - (476/15) * b^(38/3) + (11/15) * b^(68/3) - (74/15) * b^(62/3)) * ( -4 * a^(35/6) - 4 * a^(59/6) + a^(71/6) + 6 * a^(47/6) + a^(23/6)) * hypergeom([1/6, 5/6], [23/6], b^2 / ((b - 1) * (b + 1))) + ( -2 / ((b - 1) * (b + 1)))^(17/12) * ((((2321032/1215) * ( -(5/4) * b^(71/6) + b^(59/6) - (1/2) * b^(47/6) + (1/7) * b^(35/6) - (1/56) * b^(23/6) - (1/56) * b^(119/6) + (1/7) * b^(107/6) - (1/2) * b^(95/6) + b^(83/6)) * ((88/41447) * a^(161/6) - (187132/207235) * a^(89/6) + (5289/414470) * a^(149/6) - (121/165788) * a^(173/6) - (486/5921) * a^(41/6) + (534069/828940) * a^(77/6) - (86256/207235) * a^(65/6) + (13527/59210) * a^(53/6) + (2187/165788) * a^(29/6) - (159672/207235) * a^(113/6) + (45287/118420) * a^(125/6) - (3278/29605) * a^(137/6) + a^(101/6)) * hypergeom([5/2, 10/3], [7/2], a^2) + (1497056/6075) * ( -(534069/748528) * b^(77/6) + (21564/46783) * b^(65/6) - (94689/374264) * b^(53/6) + (8505/93566) * b^(41/6) - (10935/748528) * b^(29/6) + (55/68048) * b^(173/6) - (10/4253) * b^(161/6) - (5289/374264) * b^(149/6) + (1043/8506) * b^(137/6) - (28819/68048) * b^(125/6) + (39918/46783) * b^(113/6) - (207235/187132) * b^(101/6) + b^(89/6)) * (a^(35/6) + 7 * a^(83/6) - (35/4) * a^(71/6) + a^(107/6) - (7/2) * a^(95/6) + 7 * a^(59/6) - (1/8) * a^(23/6) - (7/2) * a^(47/6) - (1/8) * a^(119/6)) * hypergeom([5/2, 10/3], [7/2], b^2) - (268672/729) * ( -(5/4) * b^(71/6) + b^(59/6) - (1/2) * b^(47/6) + (1/7) * b^(35/6) - (1/56) * b^(23/6) - (1/56) * b^(119/6) + (1/7) * b^(107/6) - (1/2) * b^(95/6) + b^(83/6)) * ((563/8396) * a^(149/6) + a^(101/6) + (726/2099) * a^(125/6) - (2731/16792) * a^(137/6) - (17901/16792) * a^(65/6) + (3276/2099) * a^(77/6) - (5159/8396) * a^(113/6) + (33/8396) * a^(173/6) - (48/2099) * a^(161/6) - (2187/33584) * a^(41/6) + (1701/4198) * a^(53/6) - (48753/33584) * a^(89/6)) * hypergeom([7/2, 13/3], [9/2], a^2) - (43336/567) * ( -(5824/5417) * b^(77/6) + (3978/5417) * b^(65/6) - (1512/5417) * b^(53/6) + (243/5417) * b^(41/6) - (44/16251) * b^(173/6) + (256/16251) * b^(161/6) - (2252/48753) * b^(149/6) + (5462/48753) * b^(137/6) - (3872/16251) * b^(125/6) + (20636/48753) * b^(113/6) - (33584/48753) * b^(101/6) + b^(89/6)) * hypergeom([7/2, 13/3], [9/2], b^2) * (a^(35/6) + 7 * a^(83/6) - (35/4) * a^(71/6) + a^(107/6) - (7/2) * a^(95/6) + 7 * a^(59/6) - (1/8) * a^(23/6) - (7/2) * a^(47/6) - (1/8) * a^(119/6))) * ( -(b - 1) * (b + 1))^(5/6) + (240956/1215) * ( -(b - 1) * (b + 1))^(1/2) * ( -(100539/60239) * b^(77/6) + (99666/60239) * b^(65/6) - (57186/60239) * b^(53/6) + (33777/120478) * b^(41/6) - (3645/120478) * b^(29/6) + (121/120478) * b^(137/6) + (11/120478) * b^(125/6) + (2730/60239) * b^(113/6) - (20042/60239) * b^(101/6) + b^(89/6)) * (a^(35/6) + 7 * a^(83/6) - (35/4) * a^(71/6) + a^(107/6) - (7/2) * a^(95/6) + 7 * a^(59/6) - (1/8) * a^(23/6) - (7/2) * a^(47/6) - (1/8) * a^(119/6))) * ( -(a - 1) * (a + 1))^(5/6) + (561176/1215) * ( -(5/4) * b^(71/6) + b^(59/6) - (1/2) * b^(47/6) + (1/7) * b^(35/6) - (1/56) * b^(23/6) - (1/56) * b^(119/6) + (1/7) * b^(107/6) - (1/2) * b^(95/6) + b^(83/6)) * ( -(a - 1) * (a + 1))^(1/2) * ((100539/20042) * a^(77/6) - (60239/20042) * a^(89/6) + (28593/10021) * a^(53/6) - (11/3644) * a^(137/6) + a^(101/6) - (49833/10021) * a^(65/6) + (3645/40084) * a^(29/6) - (1365/10021) * a^(113/6) - (33777/40084) * a^(41/6) - (1/3644) * a^(125/6)) * ( -(b - 1) * (b + 1))^(5/6) + ( -(a - 1) * (a + 1))^(29/6) * ( -(b - 1) * (b + 1))^(29/6) * ((121/5103) * a^(137/6) * (b^(23/6) - 4 * b^(59/6) - 4 * b^(35/6) + b^(71/6) + 6 * b^(47/6)) * hypergeom([7/2, 13/3], [9/2], a^2) - (121/5103) * b^(137/6) * ( -4 * a^(35/6) - 4 * a^(59/6) + a^(71/6) + 6 * a^(47/6) + a^(23/6)) * hypergeom([7/2, 13/3], [9/2], b^2) + (b^(23/6) - 4 * b^(59/6) - 4 * b^(35/6) + b^(71/6) + 6 * b^(47/6)) * ((1769/165) * a^(15/2) - (371/33) * a^(19/2) - (851/165) * a^(11/2) + a^(7/2) - (37/33) * a^(27/2) + (65/11) * a^(23/2) - (29/165) * a^(31/2) + (1/15) * a^(35/2)) * hypergeom([11/6, 8/3], [17/6], a^2) - ((65/11) * b^(23/2) - (851/165) * b^(11/2) - (29/165) * b^(31/2) - (371/33) * b^(19/2) + (1769/165) * b^(15/2) + (1/15) * b^(35/2) + b^(7/2) - (37/33) * b^(27/2)) * ( -4 * a^(35/6) - 4 * a^(59/6) + a^(71/6) + 6 * a^(47/6) + a^(23/6)) * hypergeom([11/6, 8/3], [17/6], b^2) + ( -(2/25) * b^(13/6) + (8/25) * b^(49/6) + (8/25) * b^(25/6) - (2/25) * b^(61/6) - (12/25) * b^(37/6)) * a^(23/6) + ((8/25) * b^(13/6) + (48/25) * b^(37/6) + (8/25) * b^(61/6) - (32/25) * b^(49/6) - (32/25) * b^(25/6)) * a^(35/6) + ( -(12/25) * b^(61/6) + (48/25) * b^(25/6) + (48/25) * b^(49/6) - (72/25) * b^(37/6) - (12/25) * b^(13/6)) * a^(47/6) + ((8/25) * b^(13/6) + (48/25) * b^(37/6) + (8/25) * b^(61/6) - (32/25) * b^(49/6) - (32/25) * b^(25/6)) * a^(59/6) + ( -(2/25) * b^(13/6) + (8/25) * b^(49/6) + (8/25) * b^(25/6) - (2/25) * b^(61/6) - (12/25) * b^(37/6)) * a^(71/6) + (2/25) * (b^(23/6) - 4 * b^(59/6) - 4 * b^(35/6) + b^(71/6) + 6 * b^(47/6)) * ( -4 * a^(25/6) - 4 * a^(49/6) + a^(13/6) + 6 * a^(37/6) + a^(61/6)))))) / (a^(23/6) * ( -(a - 1) * (a + 1))^(29/6) * ( -(b - 1) * (b + 1))^(29/6) * ( -2 / ((b - 1) * (b + 1)))^(17/12) * ( -2 / ((a - 1) * (a + 1)))^(17/12) * b^(23/6) * (a - 1)^4 * (a + 1)^4 * (b - 1)^4 * (b + 1)^4)
|
Pages: 1 Prev: Identifying workspaces Next: notch filter problem |