New answers tagged

1

We can reduce computational time by 25 times with extended expressions for coefficients of equations and by reducing integration time with option PrecisionGoal -> 4 as follows Clear["Global`*"] m = 1; w = (a^2 + (m/p)^2)^(1/2); z = (b^2 - a^2)/w^2; y1 = ArcTan[z^(1/2)]/z^(1/2); (*R[2,4,0,b_,a_]:=*)R1 = (3 + 2 z - 3 (1 + z) y1)/(z^2 w^3); (*R[2,...


2

AceGen already uses all kernels available when needed. Why is your generation so slow can have several reasons: You are using a Mathematica command that takes all the time (e.g. Simplify). This would no be AceGen related problem. You are generating all components of tangent explicitly (e.g. SMSD[R,p]) for large number of DOFs. In this case you should make ...


0

Only slightly different to @Andrzej , thought I'd give it a go n = 2; d0 = Divisors[n] d = DeleteDuplicates[Sort /@ Tuples[%, 2]] Sqrt /@ ((#[[1]] + #[[2]]) & /@ %) IntegerQ /@ % d[[#]] & /@ Position[%, True] Little more clunky but maybe Tuples[] will help


3

First take a outer product to get all the pairs d=Divisors[n]; prod = Flatten[Outer[List, d, d], 1] Then e.g. define a function like this IsSquare[{a_, b_}] := Module[{check}, check = IntegerQ[Sqrt[a + b]]; If[check == True, Print[{a, b}]]; check ] and apply it to the outer product IsSquare /@ prod which will print all the pairs that ...


Top 50 recent answers are included