Message Boards Message Boards

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

Integrate integral C2 were the integand is a table and the output g1 table

In structural dynamics analysis (SDA) of continuous systems with random space and time inputs, complex numerical integrations are required. The inputs data are given in tables and the outputs are needed in table for continued analysis for further assessment analysis. The purpose of the needed computations is to use Mathematica as a tool to accomplish SDA results.

Attachments:
15 Replies
Posted 10 years ago

Is the following what you want? You're given a table of pairs {f,C2} and you want to end up a table of pairs {f,(2*Integrate[C2])^0.5} ? If so, the following should work:

(* Create an example table where there are pairs {f,C1} *)
a = 5/100;
U = 13200;
L = 100;
C1 = Exp[-a (2 \[Pi] f \[Xi])/U ] * Cos[(2  \[Pi]  f \[Xi])/U]
C2 = Table[{f, C1}, {f, 0, 1000, 5}]

(* Take the table of pairs of {f,C1} and create a table of pairs \
{f,(2*Integrate[C1^0.5])^0.5} *)
C3 = Table[{C2[[i, 
     1]], (2 NIntegrate[C2[[i, 2]]^0.5, {\[Xi], 0, L}])^0.5}, {i, 
   Length[C2]}]

(When you say in your Notebook that the X's aren't right, is that because the X's (or rather your values for f) were integrated, too?)

POSTED BY: Jim Baldwin

(When you say in your Notebook that the X's aren't right, is that because the X's (or rather your values for f) were integrated, too?) Yes

Thanks; everything seemed to work ok except the calculation takes a long time and below is a comparison of the accuracies

                          (* Comparison of data*)
                          f = 0;  14.142135623730951`; compare to 14.142135623730951`(recent calcs)
                          f = 5;  13.927347535477212`; compared to 14.087759680463982``(recent calcs)
                          f = 70     9.448983612771324`;compared to  9.384308379490255`(recent calcs)`

can check the nb to see results.

Thanks ---- luke

Anton ,

I have installed 10.01 and transferred my nb that is in V5.2 to the 10.01version. I have included that nb.

luke

PS basically I'm trying to integrate a table of functions and then plot table of (x,y) numbers. During this process the x values must remain the same.

Anton ,

I have installed 10.01 and transferred my nb that is in V5.2 to the 10.01version. I have included that nb.

luke

PS basically I'm trying to integrate a table of functions and then plot table of (x,y) numbers. During this process the x values must remain the same.

Attachments:

Luke, you are using a very old version of Mathematica. Version 5.2 still uses the old NIntegrate. (Version 6.0 uses the current NIntegrate framework.) It will be quite hard for me to help you since I do not have access to V5.2.

That said, I think the singularity handler manifests in your code. Please repeat your computations with SingularityDepth->1000 and experiment using higher values for MinRecursion and MaxRecursion.

POSTED BY: Anton Antonov

Luke, I think we are using different versions of Mathematica. What is your version?

POSTED BY: Anton Antonov

I'm using 5.2

Anton --Thanks, I appreciate your help!!!! Note: I shortened C2 and called it C3. (shortened the calculations) In29 and Out29 below deal with that. In36 deals with NIntegrate and shows a problem so I change to Integrate In30 and got your result Out30. When I changed the limit from 1 to 100; see "In and out 33"; the "X" value increases where it should stay the same as the "X" in C3. In34 is the actual integral I'm using and the first term in Out34 is correct; but the rest of the "X" are not correct; should be the same as C3. The integrated "Y" values may be correct; it's the "X"'s.

luke

In \!(C3 = {{0, 1}, {5, [ExponentialE]\^((-0.00011899972172688612\)\ ?\)\ Cos[\(?\ \ ?\)\/1320]}, {10, \[ExponentialE]\^\(\(-0.00023799944345377223)\ ?)\ \ Cos[(?\ ?)\/660]}, {15, [ExponentialE]\^((-0.00035699916518065836\)\ \ ?\)\ Cos[\(?\ ?\)\/440]}, {20, \ \[ExponentialE]\^\(\(-0.00047599888690754447)\ ?)\ Cos[(?\ ?)\/330]}, \ {25, [ExponentialE]\^((-0.0005949986086344305\)\ ?\)\ Cos[\(?\ \ ?\)\/264]}, {30, \[ExponentialE]\^\(\(-0.0007139983303613167)\ ?)\ Cos[(?\ \ ?)\/220]}, {35, [ExponentialE]\^((-0.0008329980520882028\)\ ?\)\ \ Cos[\(7\ ?\ ?\)\/1320]}, {40, \[ExponentialE]\^\(\(-0.0009519977738150889)\ \ ?)\ Cos[(?\ ?)\/165]}, {45, [ExponentialE]\^((-0.001070997495541975\)\ \ ?\)\ Cos[\(3\ ?\ ?\)\/440]}, {50, \[ExponentialE]\^\(\(-0.001189997217268861\ )\ ?)\ Cos[(?\ ?)\/132]}, {55, \ [ExponentialE]\^((-0.0013089969389957472\)\ ?\)\ Cos[\(?\ ?\)\/120]}, \ {60, \[ExponentialE]\^\(\(-0.0014279966607226335)\ ?)\ Cos[(?\ \ ?)\/110]}, {65, [ExponentialE]\^((-0.0015469963824495195\)\ ?\)\ \ Cos[\(13\ ?\ ?\)\/1320]}, {70, \[ExponentialE]\^\(\(-0.0016659961041764057)\ \ ?)\ Cos[(7\ ?\ ?)\/660]}, {75, \ [ExponentialE]\^((-0.0017849958259032917\)\ ?\)\ Cos[\(?\ ?\)\/88]}, {80, \ \[ExponentialE]\^\(\(-0.0019039955476301779)\ ?)\ Cos[(2\ ?\ ?)\/165]}, \ {85, [ExponentialE]\^((-0.002022995269357064\)\ ?\)\ Cos[\(17\ ?\ \ ?\)\/1320]}, {90, \[ExponentialE]\^\(\(-0.00214199499108395)\ ?)\ Cos[(3\ \ ?\ ?)\/220]}, {95, [ExponentialE]\^((-0.002260994712810836\)\ ?\)\ \ Cos[\(19\ ?\ ?\)\/1320]}, {100, \[ExponentialE]\^\(\(-0.002379994434537722)\ \ ?)\ Cos[(?\ ?)\/66]}, {105, [ExponentialE]\^((-0.0024989941562646085`\ )\ ?)\ Cos[(7\ ?\ ?)\/440]}})

Out[29]= \!({{0, 1}, {5, [ExponentialE]\^((-0.00011899972172688612\)\ ?\)\ \ Cos[\(?\ ?\)\/1320]}, {10, \[ExponentialE]\^\(\(-0.00023799944345377223)\ ?\ )\ Cos[(?\ ?)\/660]}, {15, [ExponentialE]\^((-0.00035699916518065836\)\ \ ?\)\ Cos[\(?\ ?\)\/440]}, {20, \ \[ExponentialE]\^\(\(-0.00047599888690754447)\ ?)\ Cos[(?\ ?)\/330]}, {25, \ [ExponentialE]\^((-0.0005949986086344304\)\ ?\)\ Cos[\(?\ ?\)\/264]}, \ {30, \[ExponentialE]\^\(\(-0.0007139983303613166)\ ?)\ Cos[(?\ \ ?)\/220]}, {35, [ExponentialE]\^((-0.0008329980520882028\)\ ?\)\ Cos[\(7\ \ ?\ ?\)\/1320]}, {40, \[ExponentialE]\^\(\(-0.0009519977738150888)\ ?)\ Cos[(?\ ?)\/165]}, {45, \ [ExponentialE]\^((-0.001070997495541975\)\ ?\)\ Cos[\(3\ ?\ ?\)\/440]}, \ {50, \[ExponentialE]\^\(\(-0.001189997217268861)\ ?)\ Cos[(?\ ?)\/132]}, {55, \ [ExponentialE]\^((-0.0013089969389957472\)\ ?\)\ Cos[\(?\ ?\)\/120]}, \ {60, \[ExponentialE]\^\(\(-0.0014279966607226335)\ ?)\ Cos[(?\ \ ?)\/110]}, {65, [ExponentialE]\^((-0.0015469963824495195\)\ ?\)\ \ Cos[\(13\ ?\ ?\)\/1320]}, {70, \ \[ExponentialE]\^\(\(-0.0016659961041764057)\ ?)\ Cos[(7\ ?\ ?)\/660]}, \ {75, [ExponentialE]\^((-0.0017849958259032917\)\ ?\)\ Cos[\(?\ ?\)\/88]}, \ {80, \[ExponentialE]\^\(\(-0.0019039955476301779)\ ?)\ Cos[(2\ ?\ \ ?)\/165]}, {85, [ExponentialE]\^((-0.002022995269357064\)\ ?\)\ Cos[\(17\ \ ?\ ?\)\/1320]}, {90, \[ExponentialE]\^\(\(-0.00214199499108395)\ ?)\ \ Cos[(3\ ?\ ?)\/220]}, {95, [ExponentialE]\^((-0.002260994712810836\)\ ?\ \)\ Cos[\(19\ ?\ ?\)\/1320]}, {100, \ \[ExponentialE]\^\(\(-0.002379994434537722)\ ?)\ Cos[(?\ ?)\/66]}, {105, [ExponentialE]\^((-0.0024989941562646085`)\ \ ?)\ Cos[(7\ ?\ ?)\/440]}})

In NIntegrate[(C3),{?,0,1}]

From In \!(* RowBox[{(NIntegrate::"inum "), ((:)(\ )), "\<\"Integrand \!\([LeftSkeleton] 1 [RightSkeleton]\) is not numerical at \!\({?}\) = \ \!\({0.5`}\). \!\(\*ButtonBox[\\"MoreÂ…\\", \ ButtonStyle->\\"RefGuideLinkText\\", ButtonFrame->None, \ ButtonData:>\\"NIntegrate::inum\\"]\)\"\>"}])

Out[36]= NIntegrate[C3,{?,0,1}]

In Integrate[(C3),{?,0,1}]

Out[30]= \!({{0, 1}, {5, ((0.9999395585214899\)\(\[InvisibleSpace]\)\) + 0.\ \ [ImaginaryI]}, {10, ((0.9998772341476005\)\(\[InvisibleSpace]\)\) + 0.\ \ [ImaginaryI]}, {15, ((0.9998130273929275\)\(\[InvisibleSpace]\)\) + 0.\ \ [ImaginaryI]}, {20, ((0.9997469387783866\)\(\[InvisibleSpace]\)\) + 0.\ \ [ImaginaryI]}, {25, ((0.9996789688312022\)\(\[InvisibleSpace]\)\) - \ 2.4256423570287898^-20\ [ImaginaryI]}, {30, ((0.9996091180849116\)\(\ \[InvisibleSpace]\)\) - 2.477051560095065^-20\ [ImaginaryI]}, {35, \ ((0.9995373870793505\)\(\[InvisibleSpace]\)\) + 0.\ [ImaginaryI]}, { 40, ((0.9994637763606591\)\(\[InvisibleSpace]\)\) - \ 2.5798304177902294^-20\ [ImaginaryI]}, {45, ((0.9993882864812746\)\(\ \[InvisibleSpace]\)\) - 2.6311997854715805^-20\ [ImaginaryI]}, {50, \ ((0.99931091799993\)\(\[InvisibleSpace]\)\) - 2.6825555878650602*^-20\ \ [ImaginaryI]}, {55, ((0.9992316714816498\)\(\[InvisibleSpace]\)\) - 2.7338976816811725*^-20\ [ImaginaryI]}, { 60, ((0.9991505474977442\)\(\[InvisibleSpace]\)\) + 0.\ [ImaginaryI]}, {65, ((0.9990675466258099\)\(\[InvisibleSpace]\)\) - \ 2.8365401707937054*^-20\ [ImaginaryI]}, { 70, ((0.9989826694497241\)\(\[InvisibleSpace]\)\) + 0.\ \ [ImaginaryI]}, {75, ((0.9988959165596416\)\(\[InvisibleSpace]\)\) - 2.9391261079888114*^-20\ [ImaginaryI]}, {80, \ ((0.9988072885519903\)\(\[InvisibleSpace]\)\) + 0.\ [ImaginaryI]}, {85, ((0.9987167860294703\)\(\[InvisibleSpace]\)\) + \ 0.\ [ImaginaryI]}, {90, ((0.9986244096010474\)\(\[InvisibleSpace]\)\) - 3.092896477640538^-20\ [ImaginaryI]}, {95, ((0.9985301598819512\)\(\ \[InvisibleSpace]\)\) - 3.144123753447079^-20\ [ImaginaryI]}, {100, \ ((0.9984340374936708\)\(\[InvisibleSpace]\)\) - 3.195336034482304*^-20\ \ [ImaginaryI]}, {105, ((0.9983360430639522\)\(\[InvisibleSpace]\)\) - \ 3.246533178224931*^-20\ [ImaginaryI]}})

In Integrate[(C3),{?,0,100}]

Out[33]= \!({{0, 100}, {500, ((98.47432186732775\)\(\[InvisibleSpace]\)\) + 0.\ \ [ImaginaryI]}, { 1000, ((95.1516218739715\)\(\[InvisibleSpace]\)\) + 0.\ \ [ImaginaryI]}, {1500, ((90.17147438682308\)\(\[InvisibleSpace]\)\) + 0.\ \ [ImaginaryI]}, { 2000, ((83.72532790153666\)\(\[InvisibleSpace]\)\) + 0.\ \ [ImaginaryI]}, {2500, ((76.04801583417462\)\(\[InvisibleSpace]\)\) - \ 2.36814499273618^-17\ [ImaginaryI]}, {3000, ((67.40775875992027\)\(\ \[InvisibleSpace]\)\) - 2.6345632087437145^-17\ [ImaginaryI]}, {3500, \ ((58.095116058842834\)\(\[InvisibleSpace]\)\) + 0.\ [ImaginaryI]}, { 4000, ((48.41137871044244\)\(\[InvisibleSpace]\)\) - \ 2.9550667609301643^-17\ [ImaginaryI]}, {4500, ((38.65690592278126\)\(\ \[InvisibleSpace]\)\) - 3.008098528664352^-17\ [ImaginaryI]}, {5000, \ ((29.11989647335106\)\(\[InvisibleSpace]\)\) - 2.9930188967289435*^-17\ \ [ImaginaryI]}, {5500, ((20.06605221903229\)\(\[InvisibleSpace]\)\) - 2.915125934892944*^-17\ [ImaginaryI]}, { 6000, ((11.729538319052729\)\(\[InvisibleSpace]\)\) + 0.\ \ [ImaginaryI]}, { 6500, ((4.305575275687835\)\(\[InvisibleSpace]\)\) - \ 2.6011131052702112*^-17\ [ImaginaryI]}, {7000, (-2.0550844119812233\) + \ 0.\ [ImaginaryI]}, { 7500, (-7.249633214176027\) - 2.1391685235662612*^-17\ \ [ImaginaryI]}, {8000, (-11.224572699093214\) + 0.\ [ImaginaryI]}, {8500, (-13.974993453098536\) + 0.\ \ [ImaginaryI]}, {9000, (-15.541889926583302\) - 1.3517813048945516*^-17\ [ImaginaryI]}, { 9500, (-16.007711255679638\) - 1.1038212145295681*^-17\ \ [ImaginaryI]}, {10000, (-15.490418957862715\) - 8.769264381390492*^-18\ \ [ImaginaryI]}, { 10500, (-14.136377377680587\) - 6.7730419377129346*^-18\ \ [ImaginaryI]}})

In \!(((2*Integrate[((C3))\^ .5, {?, 0, 100}]))\^ .5)

Out[34]= \!({{0, 14.142135623730951}, {21.147425268811283, \ ((14.087759680463986\)\(\[InvisibleSpace]\)\) + 0.\ [ImaginaryI]}, \ {25.14866859365871, \(\(13.966018979649741)([InvisibleSpace])) + 0.\ \[ImaginaryI]}, {27.831576837137405, \ ((13.773943380696016\)\(\[InvisibleSpace]\)\) + 0.\ [ImaginaryI]}, {29.906975624424412, \(\(13.504825224204863)(\ [InvisibleSpace])) + 0.\ \[ImaginaryI]}, {31.622776601683793, \ ((13.144614394528887\)\(\[InvisibleSpace]\)\) - 1.0811161353745691*^-15\ [ImaginaryI]}, {33.097509196468735, \ \(\(12.658581855965714)([InvisibleSpace])) + 1.1226261264412287*^-15\ \ \[ImaginaryI]}, {34.397906282503925, ((11.896032641194601\)\(\ \[InvisibleSpace]\)\) + 0.0948355593921728\ [ImaginaryI]}, \ {35.56558820077846, \(\(11.142261172590315)([InvisibleSpace])) + \ 0.5759427561557676\ \[ImaginaryI]}, { 36.628415014847064, ((10.559267746178637\)\(\[InvisibleSpace]\)\) + \ 1.1989359199429737\ [ImaginaryI]}, {37.60603093086394, \ \(\(10.126447984679059)([InvisibleSpace])) + 1.8682423768453593\ \[ImaginaryI]}, {38.51285106843081, \ ((9.8204630896133\)\(\[InvisibleSpace]\)\) + 2.528209140548143\ \ [ImaginaryI]}, {39.35979342530861, \(\(9.613578993086847)(\ [InvisibleSpace])) + 3.1425125345707876\ \[ImaginaryI]}, {40.155342728704355, \ ((9.47691206352986\)\(\[InvisibleSpace]\)\) + 3.689986626433017\ \ [ImaginaryI]}, {40.90623489235047, \(\(9.384361955617077)(\ [InvisibleSpace])) + 4.1608833011487105\ \[ImaginaryI]}, {41.61791450287817, \ ((9.314626709614732\)\(\[InvisibleSpace]\)\) + 4.552566077990048\ \ [ImaginaryI]}, {42.294850537622565, \(\(9.25121850616666)(\ [InvisibleSpace])) + 4.86578943226933\ \[ImaginaryI]}, {42.940760257109766, \ ((9.181355713740524\)\(\[InvisibleSpace]\)\) + 5.1019476310179\ \ [ImaginaryI]}, {43.55877174692863, \(\(9.094257655321282)(\ [InvisibleSpace])) + 5.260720316074253\ \[ImaginaryI]}, {44.151544355342686, \ ((8.978156270895685\)\(\[InvisibleSpace]\)\) + 5.336035968645732\ \ [ImaginaryI]}, {44.721359549995796, \(\(8.813577568914233)(\ [InvisibleSpace])) + 5.281427433646056\ \[ImaginaryI]}, \ {45.270190558378694, ((8.744387269338645\)\(\[InvisibleSpace]\)\) + \ 5.069730409921358\ [ImaginaryI]}})

Jim, Thanks, I have attached a file that I hope clarified the definition of the problem. In addition I have completed more calculation to show various features to save others from having to do that. I don't think this should have a "vote of 1" yet. I don't feel that the concerns are understood.

thanks luke

Attachments:

Anton --Thanks, I appreciate your help!!!! Note: I shortened C2 and called it C3. (shortened the calculations) In29 and Out29 below deal with that. In36 deals with NIntegrate and shows a problem so I change to Integrate In30 and got your result Out30. When I changed the limit from 1 to 100; see "In and out 33"; the "X" value increases where it should stay the same as the "X" in C3. In34 is the actual integral I'm using and the first term in Out34 is correct; but the rest of the "X" are not correct; should be the same as C3. The integrated "Y" values may be correct; it's the "X"'s.

luke

In \!(C3 = {{0, 1}, {5, [ExponentialE]\^((-0.00011899972172688612\)\ ?\)\ Cos[\(?\ \ ?\)\/1320]}, {10, \[ExponentialE]\^\(\(-0.00023799944345377223)\ ?)\ \ Cos[(?\ ?)\/660]}, {15, [ExponentialE]\^((-0.00035699916518065836\)\ \ ?\)\ Cos[\(?\ ?\)\/440]}, {20, \ \[ExponentialE]\^\(\(-0.00047599888690754447)\ ?)\ Cos[(?\ ?)\/330]}, \ {25, [ExponentialE]\^((-0.0005949986086344305\)\ ?\)\ Cos[\(?\ \ ?\)\/264]}, {30, \[ExponentialE]\^\(\(-0.0007139983303613167)\ ?)\ Cos[(?\ \ ?)\/220]}, {35, [ExponentialE]\^((-0.0008329980520882028\)\ ?\)\ \ Cos[\(7\ ?\ ?\)\/1320]}, {40, \[ExponentialE]\^\(\(-0.0009519977738150889)\ \ ?)\ Cos[(?\ ?)\/165]}, {45, [ExponentialE]\^((-0.001070997495541975\)\ \ ?\)\ Cos[\(3\ ?\ ?\)\/440]}, {50, \[ExponentialE]\^\(\(-0.001189997217268861\ )\ ?)\ Cos[(?\ ?)\/132]}, {55, \ [ExponentialE]\^((-0.0013089969389957472\)\ ?\)\ Cos[\(?\ ?\)\/120]}, \ {60, \[ExponentialE]\^\(\(-0.0014279966607226335)\ ?)\ Cos[(?\ \ ?)\/110]}, {65, [ExponentialE]\^((-0.0015469963824495195\)\ ?\)\ \ Cos[\(13\ ?\ ?\)\/1320]}, {70, \[ExponentialE]\^\(\(-0.0016659961041764057)\ \ ?)\ Cos[(7\ ?\ ?)\/660]}, {75, \ [ExponentialE]\^((-0.0017849958259032917\)\ ?\)\ Cos[\(?\ ?\)\/88]}, {80, \ \[ExponentialE]\^\(\(-0.0019039955476301779)\ ?)\ Cos[(2\ ?\ ?)\/165]}, \ {85, [ExponentialE]\^((-0.002022995269357064\)\ ?\)\ Cos[\(17\ ?\ \ ?\)\/1320]}, {90, \[ExponentialE]\^\(\(-0.00214199499108395)\ ?)\ Cos[(3\ \ ?\ ?)\/220]}, {95, [ExponentialE]\^((-0.002260994712810836\)\ ?\)\ \ Cos[\(19\ ?\ ?\)\/1320]}, {100, \[ExponentialE]\^\(\(-0.002379994434537722)\ \ ?)\ Cos[(?\ ?)\/66]}, {105, [ExponentialE]\^((-0.0024989941562646085`\ )\ ?)\ Cos[(7\ ?\ ?)\/440]}})

Out[29]= \!({{0, 1}, {5, [ExponentialE]\^((-0.00011899972172688612\)\ ?\)\ \ Cos[\(?\ ?\)\/1320]}, {10, \[ExponentialE]\^\(\(-0.00023799944345377223)\ ?\ )\ Cos[(?\ ?)\/660]}, {15, [ExponentialE]\^((-0.00035699916518065836\)\ \ ?\)\ Cos[\(?\ ?\)\/440]}, {20, \ \[ExponentialE]\^\(\(-0.00047599888690754447)\ ?)\ Cos[(?\ ?)\/330]}, {25, \ [ExponentialE]\^((-0.0005949986086344304\)\ ?\)\ Cos[\(?\ ?\)\/264]}, \ {30, \[ExponentialE]\^\(\(-0.0007139983303613166)\ ?)\ Cos[(?\ \ ?)\/220]}, {35, [ExponentialE]\^((-0.0008329980520882028\)\ ?\)\ Cos[\(7\ \ ?\ ?\)\/1320]}, {40, \[ExponentialE]\^\(\(-0.0009519977738150888)\ ?)\ Cos[(?\ ?)\/165]}, {45, \ [ExponentialE]\^((-0.001070997495541975\)\ ?\)\ Cos[\(3\ ?\ ?\)\/440]}, \ {50, \[ExponentialE]\^\(\(-0.001189997217268861)\ ?)\ Cos[(?\ ?)\/132]}, {55, \ [ExponentialE]\^((-0.0013089969389957472\)\ ?\)\ Cos[\(?\ ?\)\/120]}, \ {60, \[ExponentialE]\^\(\(-0.0014279966607226335)\ ?)\ Cos[(?\ \ ?)\/110]}, {65, [ExponentialE]\^((-0.0015469963824495195\)\ ?\)\ \ Cos[\(13\ ?\ ?\)\/1320]}, {70, \ \[ExponentialE]\^\(\(-0.0016659961041764057)\ ?)\ Cos[(7\ ?\ ?)\/660]}, \ {75, [ExponentialE]\^((-0.0017849958259032917\)\ ?\)\ Cos[\(?\ ?\)\/88]}, \ {80, \[ExponentialE]\^\(\(-0.0019039955476301779)\ ?)\ Cos[(2\ ?\ \ ?)\/165]}, {85, [ExponentialE]\^((-0.002022995269357064\)\ ?\)\ Cos[\(17\ \ ?\ ?\)\/1320]}, {90, \[ExponentialE]\^\(\(-0.00214199499108395)\ ?)\ \ Cos[(3\ ?\ ?)\/220]}, {95, [ExponentialE]\^((-0.002260994712810836\)\ ?\ \)\ Cos[\(19\ ?\ ?\)\/1320]}, {100, \ \[ExponentialE]\^\(\(-0.002379994434537722)\ ?)\ Cos[(?\ ?)\/66]}, {105, [ExponentialE]\^((-0.0024989941562646085`)\ \ ?)\ Cos[(7\ ?\ ?)\/440]}})

In NIntegrate[(C3),{?,0,1}]

From In \!(* RowBox[{(NIntegrate::"inum "), ((:)(\ )), "\<\"Integrand \!\([LeftSkeleton] 1 [RightSkeleton]\) is not numerical at \!\({?}\) = \ \!\({0.5`}\). \!\(\*ButtonBox[\\"MoreÂ…\\", \ ButtonStyle->\\"RefGuideLinkText\\", ButtonFrame->None, \ ButtonData:>\\"NIntegrate::inum\\"]\)\"\>"}])

Out[36]= NIntegrate[C3,{?,0,1}]

In Integrate[(C3),{?,0,1}]

Out[30]= \!({{0, 1}, {5, ((0.9999395585214899\)\(\[InvisibleSpace]\)\) + 0.\ \ [ImaginaryI]}, {10, ((0.9998772341476005\)\(\[InvisibleSpace]\)\) + 0.\ \ [ImaginaryI]}, {15, ((0.9998130273929275\)\(\[InvisibleSpace]\)\) + 0.\ \ [ImaginaryI]}, {20, ((0.9997469387783866\)\(\[InvisibleSpace]\)\) + 0.\ \ [ImaginaryI]}, {25, ((0.9996789688312022\)\(\[InvisibleSpace]\)\) - \ 2.4256423570287898^-20\ [ImaginaryI]}, {30, ((0.9996091180849116\)\(\ \[InvisibleSpace]\)\) - 2.477051560095065^-20\ [ImaginaryI]}, {35, \ ((0.9995373870793505\)\(\[InvisibleSpace]\)\) + 0.\ [ImaginaryI]}, { 40, ((0.9994637763606591\)\(\[InvisibleSpace]\)\) - \ 2.5798304177902294^-20\ [ImaginaryI]}, {45, ((0.9993882864812746\)\(\ \[InvisibleSpace]\)\) - 2.6311997854715805^-20\ [ImaginaryI]}, {50, \ ((0.99931091799993\)\(\[InvisibleSpace]\)\) - 2.6825555878650602*^-20\ \ [ImaginaryI]}, {55, ((0.9992316714816498\)\(\[InvisibleSpace]\)\) - 2.7338976816811725*^-20\ [ImaginaryI]}, { 60, ((0.9991505474977442\)\(\[InvisibleSpace]\)\) + 0.\ [ImaginaryI]}, {65, ((0.9990675466258099\)\(\[InvisibleSpace]\)\) - \ 2.8365401707937054*^-20\ [ImaginaryI]}, { 70, ((0.9989826694497241\)\(\[InvisibleSpace]\)\) + 0.\ \ [ImaginaryI]}, {75, ((0.9988959165596416\)\(\[InvisibleSpace]\)\) - 2.9391261079888114*^-20\ [ImaginaryI]}, {80, \ ((0.9988072885519903\)\(\[InvisibleSpace]\)\) + 0.\ [ImaginaryI]}, {85, ((0.9987167860294703\)\(\[InvisibleSpace]\)\) + \ 0.\ [ImaginaryI]}, {90, ((0.9986244096010474\)\(\[InvisibleSpace]\)\) - 3.092896477640538^-20\ [ImaginaryI]}, {95, ((0.9985301598819512\)\(\ \[InvisibleSpace]\)\) - 3.144123753447079^-20\ [ImaginaryI]}, {100, \ ((0.9984340374936708\)\(\[InvisibleSpace]\)\) - 3.195336034482304*^-20\ \ [ImaginaryI]}, {105, ((0.9983360430639522\)\(\[InvisibleSpace]\)\) - \ 3.246533178224931*^-20\ [ImaginaryI]}})

In Integrate[(C3),{?,0,100}]

Out[33]= \!({{0, 100}, {500, ((98.47432186732775\)\(\[InvisibleSpace]\)\) + 0.\ \ [ImaginaryI]}, { 1000, ((95.1516218739715\)\(\[InvisibleSpace]\)\) + 0.\ \ [ImaginaryI]}, {1500, ((90.17147438682308\)\(\[InvisibleSpace]\)\) + 0.\ \ [ImaginaryI]}, { 2000, ((83.72532790153666\)\(\[InvisibleSpace]\)\) + 0.\ \ [ImaginaryI]}, {2500, ((76.04801583417462\)\(\[InvisibleSpace]\)\) - \ 2.36814499273618^-17\ [ImaginaryI]}, {3000, ((67.40775875992027\)\(\ \[InvisibleSpace]\)\) - 2.6345632087437145^-17\ [ImaginaryI]}, {3500, \ ((58.095116058842834\)\(\[InvisibleSpace]\)\) + 0.\ [ImaginaryI]}, { 4000, ((48.41137871044244\)\(\[InvisibleSpace]\)\) - \ 2.9550667609301643^-17\ [ImaginaryI]}, {4500, ((38.65690592278126\)\(\ \[InvisibleSpace]\)\) - 3.008098528664352^-17\ [ImaginaryI]}, {5000, \ ((29.11989647335106\)\(\[InvisibleSpace]\)\) - 2.9930188967289435*^-17\ \ [ImaginaryI]}, {5500, ((20.06605221903229\)\(\[InvisibleSpace]\)\) - 2.915125934892944*^-17\ [ImaginaryI]}, { 6000, ((11.729538319052729\)\(\[InvisibleSpace]\)\) + 0.\ \ [ImaginaryI]}, { 6500, ((4.305575275687835\)\(\[InvisibleSpace]\)\) - \ 2.6011131052702112*^-17\ [ImaginaryI]}, {7000, (-2.0550844119812233\) + \ 0.\ [ImaginaryI]}, { 7500, (-7.249633214176027\) - 2.1391685235662612*^-17\ \ [ImaginaryI]}, {8000, (-11.224572699093214\) + 0.\ [ImaginaryI]}, {8500, (-13.974993453098536\) + 0.\ \ [ImaginaryI]}, {9000, (-15.541889926583302\) - 1.3517813048945516*^-17\ [ImaginaryI]}, { 9500, (-16.007711255679638\) - 1.1038212145295681*^-17\ \ [ImaginaryI]}, {10000, (-15.490418957862715\) - 8.769264381390492*^-18\ \ [ImaginaryI]}, { 10500, (-14.136377377680587\) - 6.7730419377129346*^-18\ \ [ImaginaryI]}})

In \!(((2*Integrate[((C3))\^ .5, {?, 0, 100}]))\^ .5)

Out[34]= \!({{0, 14.142135623730951}, {21.147425268811283, \ ((14.087759680463986\)\(\[InvisibleSpace]\)\) + 0.\ [ImaginaryI]}, \ {25.14866859365871, \(\(13.966018979649741)([InvisibleSpace])) + 0.\ \[ImaginaryI]}, {27.831576837137405, \ ((13.773943380696016\)\(\[InvisibleSpace]\)\) + 0.\ [ImaginaryI]}, {29.906975624424412, \(\(13.504825224204863)(\ [InvisibleSpace])) + 0.\ \[ImaginaryI]}, {31.622776601683793, \ ((13.144614394528887\)\(\[InvisibleSpace]\)\) - 1.0811161353745691*^-15\ [ImaginaryI]}, {33.097509196468735, \ \(\(12.658581855965714)([InvisibleSpace])) + 1.1226261264412287*^-15\ \ \[ImaginaryI]}, {34.397906282503925, ((11.896032641194601\)\(\ \[InvisibleSpace]\)\) + 0.0948355593921728\ [ImaginaryI]}, \ {35.56558820077846, \(\(11.142261172590315)([InvisibleSpace])) + \ 0.5759427561557676\ \[ImaginaryI]}, { 36.628415014847064, ((10.559267746178637\)\(\[InvisibleSpace]\)\) + \ 1.1989359199429737\ [ImaginaryI]}, {37.60603093086394, \ \(\(10.126447984679059)([InvisibleSpace])) + 1.8682423768453593\ \[ImaginaryI]}, {38.51285106843081, \ ((9.8204630896133\)\(\[InvisibleSpace]\)\) + 2.528209140548143\ \ [ImaginaryI]}, {39.35979342530861, \(\(9.613578993086847)(\ [InvisibleSpace])) + 3.1425125345707876\ \[ImaginaryI]}, {40.155342728704355, \ ((9.47691206352986\)\(\[InvisibleSpace]\)\) + 3.689986626433017\ \ [ImaginaryI]}, {40.90623489235047, \(\(9.384361955617077)(\ [InvisibleSpace])) + 4.1608833011487105\ \[ImaginaryI]}, {41.61791450287817, \ ((9.314626709614732\)\(\[InvisibleSpace]\)\) + 4.552566077990048\ \ [ImaginaryI]}, {42.294850537622565, \(\(9.25121850616666)(\ [InvisibleSpace])) + 4.86578943226933\ \[ImaginaryI]}, {42.940760257109766, \ ((9.181355713740524\)\(\[InvisibleSpace]\)\) + 5.1019476310179\ \ [ImaginaryI]}, {43.55877174692863, \(\(9.094257655321282)(\ [InvisibleSpace])) + 5.260720316074253\ \[ImaginaryI]}, {44.151544355342686, \ ((8.978156270895685\)\(\[InvisibleSpace]\)\) + 5.336035968645732\ \ [ImaginaryI]}, {44.721359549995796, \(\(8.813577568914233)(\ [InvisibleSpace])) + 5.281427433646056\ \[ImaginaryI]}, \ {45.270190558378694, ((8.744387269338645\)\(\[InvisibleSpace]\)\) + \ 5.069730409921358\ [ImaginaryI]}})

Posted 10 years ago

Would you mind re-posting the Mathematica code in your last reply either as a notebook or using the "Code Sample" formatting option?

I'm apparently still not understanding the issue described from "I want to input a similar table into the integral". While I will make unsophisticated responses questions posted here (e.g., not using Map when I should and using it when I don't have to), the best part of this forum is to get answers from experts who are so much kinder and diplomatic than on StackExchange. Making it easier on those experts pays tremendous dividends.

POSTED BY: Jim Baldwin

May be I do not understand the question. NIntegrate handles vector and matrix integrands. This is what I get with the table C2 at the end of the notebook in the original message:

In[16]:= NIntegrate[C2, {\[Xi], 0, 1}]

Out[16]= {{0., 1.}, {5., 0.99994}, {10., 0.999877}, {15., 
  0.999813}, {20., 0.999747}, {25., 0.999679}, {30., 0.999609}, {35., 
  0.999537}, {40., 0.999464}, {45., 0.999388}, {50., 0.999311}, {55., 
  0.999232}, {60., 0.999151}, {65., 0.999068}, {70., 0.998983}, {75., 
  0.998896}, {80., 0.998807}, {85., 0.998717}, {90., 0.998624}, {95., 
  0.99853}, {100., 0.998434}, {105., 0.998336}, {110., 
  0.998236}, {115., 0.998134}, {120., 0.998031}, {125., 
  0.997925}, {130., 0.997818}, {135., 0.997709}, {140., 
  0.997598}, {145., 0.997485}, {150., 0.99737}, {155., 
  0.997253}, {160., 0.997135}, {165., 0.997014}, {170., 
  0.996892}, {175., 0.996768}, {180., 0.996642}, {185., 
  0.996514}, {190., 0.996384}, {195., 0.996253}, {200., 
  0.996119}, {205., 0.995984}, {210., 0.995847}, {215., 
  0.995708}, {220., 0.995567}, {225., 0.995424}, {230., 
  0.99528}, {235., 0.995133}, {240., 0.994985}, {245., 
  0.994835}, {250., 0.994683}, {255., 0.994529}, {260., 
  0.994373}, {265., 0.994216}, {270., 0.994056}, {275., 
  0.993895}, {280., 0.993732}, {285., 0.993567}, {290., 
  0.993401}, {295., 0.993232}, {300., 0.993061}, {305., 
  0.992889}, {310., 0.992715}, {315., 0.992539}, {320., 
  0.992361}, {325., 0.992182}, {330., 0.992}, {335., 0.991817}, {340.,
   0.991632}, {345., 0.991445}, {350., 0.991256}, {355., 
  0.991065}, {360., 0.990873}, {365., 0.990678}, {370., 
  0.990482}, {375., 0.990284}, {380., 0.990084}, {385., 
  0.989883}, {390., 0.989679}, {395., 0.989474}, {400., 
  0.989267}, {405., 0.989058}, {410., 0.988847}, {415., 
  0.988635}, {420., 0.98842}, {425., 0.988204}, {430., 
  0.987986}, {435., 0.987766}, {440., 0.987544}, {445., 
  0.987321}, {450., 0.987096}, {455., 0.986869}, {460., 
  0.98664}, {465., 0.986409}, {470., 0.986176}, {475., 
  0.985942}, {480., 0.985706}, {485., 0.985468}, {490., 
  0.985228}, {495., 0.984987}, {500., 0.984743}, {505., 
  0.984498}, {510., 0.984251}, {515., 0.984002}, {520., 
  0.983752}, {525., 0.983499}, {530., 0.983245}, {535., 
  0.982989}, {540., 0.982731}, {545., 0.982472}, {550., 
  0.982211}, {555., 0.981947}, {560., 0.981682}, {565., 
  0.981416}, {570., 0.981147}, {575., 0.980877}, {580., 
  0.980605}, {585., 0.980331}, {590., 0.980055}, {595., 
  0.979778}, {600., 0.979499}, {605., 0.979218}, {610., 
  0.978935}, {615., 0.978651}, {620., 0.978364}, {625., 
  0.978076}, {630., 0.977786}, {635., 0.977495}, {640., 
  0.977201}, {645., 0.976906}, {650., 0.976609}, {655., 
  0.976311}, {660., 0.97601}, {665., 0.975708}, {670., 
  0.975404}, {675., 0.975098}, {680., 0.974791}, {685., 
  0.974481}, {690., 0.97417}, {695., 0.973858}, {700., 
  0.973543}, {705., 0.973227}, {710., 0.972909}, {715., 
  0.972589}, {720., 0.972268}, {725., 0.971944}, {730., 
  0.971619}, {735., 0.971293}, {740., 0.970964}, {745., 
  0.970634}, {750., 0.970302}, {755., 0.969968}, {760., 
  0.969633}, {765., 0.969295}, {770., 0.968956}, {775., 
  0.968616}, {780., 0.968273}, {785., 0.967929}, {790., 
  0.967583}, {795., 0.967236}, {800., 0.966887}, {805., 
  0.966536}, {810., 0.966183}, {815., 0.965828}, {820., 
  0.965472}, {825., 0.965114}, {830., 0.964755}, {835., 
  0.964393}, {840., 0.96403}, {845., 0.963665}, {850., 
  0.963299}, {855., 0.962931}, {860., 0.962561}, {865., 
  0.962189}, {870., 0.961816}, {875., 0.961441}, {880., 
  0.961064}, {885., 0.960686}, {890., 0.960306}, {895., 
  0.959924}, {900., 0.95954}, {905., 0.959155}, {910., 
  0.958768}, {915., 0.958379}, {920., 0.957989}, {925., 
  0.957597}, {930., 0.957204}, {935., 0.956808}, {940., 
  0.956411}, {945., 0.956013}, {950., 0.955612}, {955., 
  0.95521}, {960., 0.954806}, {965., 0.954401}, {970., 
  0.953994}, {975., 0.953585}, {980., 0.953175}, {985., 
  0.952763}, {990., 0.952349}, {995., 0.951933}, {1000., 0.951516}}
POSTED BY: Anton Antonov
Posted 10 years ago

I think the integral you want can be integrated explicitly:

L=.;
a=.;
f=.;
U=.;
c2 = Exp[-a(2\[Pi] f \[Xi])/U ] * Cos[(2  \[Pi]  f \[Xi])/U]
integral = Integrate[c2^2 \[Xi],{\[Xi],0,L}]

with the following result

E^(-((2 a f \[Pi] \[Xi])/U)) Cos[(2 f \[Pi] \[Xi])/U]

(U (a^2 (-1+a^2) U+(1+a^2)^2 U-E^(-((4 a f L \[Pi])/U)) ((1+a^2)^2 (4 a f L \[Pi]+U)+a^2 (4 a (1+a^2) f L \[Pi]+(-1+a^2) U) Cos[(4 f L \[Pi])/U]-2 a^2 (2 (1+a^2) f L \[Pi]+a U) Sin[(4 f L \[Pi])/U])))/(32 a^2 (1+a^2)^2 f^2 \[Pi]^2)

Then a table could be constructed with (2*integral)^0.5.

POSTED BY: Jim Baldwin

Thanks for the reply, Jim The integrand in practice is given a "table"; the exponential function I provide is an example to illustrate. Look at the end of the nb, it has an example of the type of table I'm trying to Integrate. It's this type of table I'm trying to integrate to get the required table.I'm trying to get around using Simpson's rule or the trapezoidal rule without a number of iterations. I was hoping this problem had be solved already.

Posted 10 years ago

How about something like either the two ways below? One uses Map and the other uses Table.

L = 100
f[z_] := NIntegrate[z, {x, 0, L}]
t = {{1, Exp[-0.1 x] Cos[2.3 x]}, {2, Exp[-0.2 x] Cos[4.3 x]}}
Map[f, t[[All, 2]]]
Table[NIntegrate[t[[i, 2]], {x, 0, L}], {i, Length[t]}]
POSTED BY: Jim Baldwin

You don't need to use Map or Table. NIntegrate handles vector and matrix integrands:

In[358]:= NIntegrate[t[[All, 2]], {x, 0, L}]
Out[358]= {0.0188565, 0.0107933}
POSTED BY: Anton Antonov

This is a reply to all ---Thanks I provided equations as examples; do not want to apply equations in the integral.

My input (integrand) to the integral is a "Table"; see the Table at the end of the example in nb. I want to input a similar table into the integral; the table could have 500 (X, Y) terms; don't want to do this term by term. The "X" part is not effected by the integration; only the "Y" part. After integration only a table of (X,Y) terms (numbers) will remain. I'm going to do this about 150 times.

My customer provides me a the "table" which is a cross power spectral density and this integrated result is a generalize force.

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