Mathematica Asked by Jak on December 19, 2020
There are two things that I want to ask:
ParallelTable[]
and the length of the table?This is meant to be a rough estimate of the time that will take my code to run, so I don’t mind approximations as long as they don’t differ much from reality. So far, I’m using a linear relation, which I’m not being very fortunate with.
ParallelTable[]
? Each entry is an array, where the first position is the output of some function (IMLEOArcA[...]
in my case), and the remaining positions are the parameters for said function (2, tOutbound, tInbound, tStay, Isp, ToverWPropulsion, thrust, 3, tDepartureEarth, IspCargoI, ToverWPropulsionCargoI, thrustCargoI, IspCargoII, ToverWPropulsionCargoII, thrustCargoII
in my case).I expect the performance to vary across machines. However, I also expect it to maintain roughly the same computation time vs length relation, with differences being confined to a certain constant. For instance, assuming a linear relation (I don’t know if this is true, and probably won’t be), I expected the slope to be constant across machines, with the actual line being defined after knowing one of the points.
The code below is meant as a guide to the question. It won’t run on its own, since there are definitions missing. I have included them, but they’re lengthy and ultimate need the import of .m files, which I don’t know how could I include them here. Since the code wouldn’t run without said .m files, and since the extra definitions didn’t bring anything useful to the problem, I decided against including them. Just think of IMLEOArcA[...]
as a blackbox function of several parameters. In your answers, feel free to replace it with another function.
The function findIMLEO[...]
has a bit more to it than the ParallelTable[]
, but ultimately I’m interested in optimising the ParallelTable[]
usage.
findIMLEO[Isp_, ToverWPropulsion_, tStay_, tOutboundRange_, tInboundRange_, thrustRange_, tDepartureEarthRange_, architecture_, dataToRefine_] :=
Module[{IspCargoI, ToverWPropulsionCargoI, IspCargoII, ToverWPropulsionCargoII, thrustCargoI, thrustCargoII, pTable, refinement = False, dataToRefineParameters},
If[[email protected] != 0, dataToRefineParameters = dataToRefine[[All, 2 ;;]]; refinement = True];
IspCargoI = Isp;
IspCargoII = Isp;
ToverWPropulsionCargoI = ToverWPropulsion;
ToverWPropulsionCargoII = ToverWPropulsion;
pTable = ParallelTable[thrustCargoI = thrust;
thrustCargoII = thrust;
{IMLEOArcA[2, tOutbound, tInbound, tStay, Isp, ToverWPropulsion,
thrust, 3, tDepartureEarth, IspCargoI,
ToverWPropulsionCargoI, thrustCargoI, IspCargoII,
ToverWPropulsionCargoII, thrustCargoII, False],
2, tOutbound, tInbound, tStay, Isp, ToverWPropulsion, thrust, 3, tDepartureEarth, IspCargoI, ToverWPropulsionCargoI, thrustCargoI, IspCargoII, ToverWPropulsionCargoII, thrustCargoII},
{tOutbound, tOutboundRange},
{tInbound, tInboundRange},
{thrust, thrustRange},
{tDepartureEarth, tDepartureEarthRange}
];
pTable = Flatten[pTable, 3];
If[refinement == True, pTable = Join[dataToRefine, pTable]];
pTable = DeleteDuplicates[pTable]
] // AbsoluteTiming
1 Asked on October 2, 2021 by user74005
3 Asked on October 2, 2021 by billy-kalfus
0 Asked on October 2, 2021
2 Asked on October 1, 2021
2 Asked on October 1, 2021 by samvid-mistry
7 Asked on October 1, 2021 by matt-groff
3 Asked on September 30, 2021 by ka-wa-yip
0 Asked on September 30, 2021
numerical integration numerics precision and accuracy summation
0 Asked on September 30, 2021 by logosintegralis
1 Asked on September 30, 2021
1 Asked on September 30, 2021
1 Asked on September 29, 2021
1 Asked on September 29, 2021 by mksjd
boundary condition at infinity differential equations equation solving nonlinear numerical integration
1 Asked on September 29, 2021
distributions integral equations integral transforms probability or statistics
6 Asked on September 29, 2021 by alexey-golyshev
Get help from others!
Recent Questions
Recent Answers
© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir