New answers tagged

2

Use an association to avoid indexing e.g. ops = AssociationThread[{"Add", "Subtract"}, {plus, minus}]; Manipulate[ops[op][x, y], {{op, "Add", "operation type"}, Keys@ops, ControlType -> PopupMenu}, {x, 1, 10}, {y, 1, 10}]


2

All credit to @Roman who deserves the accept for discovering 7095816 was the target number. With this number pinned down I tried to solve this myself with Mathematica, but it was still too slow: variables = Array[x, 16]; matrix = ArrayReshape[variables, {4, 4}]; target = 7095816; uniqueConstraint = (And @@ (Unequal @@@ Subsets[variables, {2}])); ...


4

There are only seven (six unique) solutions up to row/column sums of $10^8$ (of course there are 1152 equivalent squares by permutation/transposition for each one): $$ \left( \begin{array}{cccc} 2 & 16 & 108 & 180 \\ 24 & 192 & 9 & 15 \\ 144 & 18 & 150 & 90 \\ 160 & 20 & 135 & 81 \\ \end{array} \right),\...


4

Abs makes this integrand hard to evaluate for the system and it is more straightforward to obtain a numerical integral. Defining first iLT[t_, x_] = InverseLaplaceTransform[1/(1 + s L (s c + (1/R3))), s, t - x]//FullSimplify one can see that it takes vary small values in the interesting region and in order to avoid false numerical integration we specify ...


3

When Plot is too slow, I fall back on a Table and a ListLinePlot which means you can control how many points to plot: u = 230*Sqrt[2]; ω = 2*Pi*50; Φ = Pi/46; L = 45*10^(-7); c = 59*10^(-6); R3 = 1/10; ilt = InverseLaplaceTransform[1/(1 + s*L*(s*c + (1/R3))), s, τ]; intg[t_?NumericQ] := NIntegrate[Abs[u*Sin[ω*x + Φ]]*(ilt /. {τ -> t - x}), {x, 0, t}]; ...


4

it is having hard time with exact integral. Replace with numerical. Clear["Global`*"]; u = 230*Sqrt[2]; ω = 2*Pi*50; Φ = Pi/46; L = 45*10^(-7); c = 59*10^(-6); R3 = 1/10; tmp = InverseLaplaceTransform[1/(1 + s*L*(s*c + (1/R3))), s, t - x]; Integrand = Abs[u*Sin[ω*x + Φ]]*tmp; f[t_?NumericQ] := NIntegrate[Integrand, {x, 0, t}] ...


1

The transformation can be calculated once outside (before) the plot. Replace InverseLaplaceTransform with its result and use NIntegrate instead of Integrate. Then the plot will be done in a few seconds. Andreas


1

The numeric integration confirms the former f = 10^5;u = 1;m = (R1 + R3)/(c*R1*R3);R1 = 100;R3 = 100;n = 100;k = c*R1;c = 100*10^(-9); g[t_?NumericQ] := (NIntegrate[(((((u*Sin[2*Pi*f*x])* Sign[u*Sin[2*Pi*f*x]])/2) + ((u*Sin[2*Pi*f*x])/ 2)))*((Exp[-m*(t - x)])/k), {x, 0, t}])^2/n; f*NIntegrate[g[t], {t, 0, 1/f}] (*0.000187112*) in view of N[...


3

You can use a RadioButtonBar to pick the 10 combinations of equations. Use Subsets[equations, {3}] instead of Permutations because this avoids all the choices where you have a repeated equation. It's a bit clunky and I didn't know how to represent this very well with the UI elements, but I've also added a CheckboxBar so you can select the equations from the ...


7

I think it might be helpful to evaluate the arguments on their own and see what happens. The first argument r^# & /@ Range[0, n] outputs (for a specific choice of n) With[{n = 3}, r^# & /@ Range[0, n]] (* {1, r, r^2, r^3} *) which generates a list that you could also get by the following Table[r^i, {i, 0, n}] The FullForm of the first argument ...


Top 50 recent answers are included