Tag Info

Hot answers tagged

10

SetSystemOptions[ "ReduceOptions" -> {"DiscreteSolutionBound" -> 10000000}]; f[n_] := Module[{eqn}, eqn = (n1 + n3 + n5 == n2 + n4 + n6) && (n1 >= n2) && (n1 - n2 + n3 - n4 >= 0) && (n1 <= n) && (n1 - n2 + n3 <= n) && (n1 - n2 + n3 - n4 + n5 <= n) && (2 n <= n1 + ...


9

Mathematica will not always give you answers the way you want it. Sometimes a little bit of massaging needs to be done. In this case let's define some rules: logrule = {Log[x_] + Log[y_] :> Log[x y], n_ Log[x_] :> Log[x^n]} expr = Solve[z == x^m y^n && z == \[Tau] x^(m - 1) y^(1 - n), {x, y}]; Then: expr //. logrule You can also use ...


9

Although I don't know exactly why Refine fails in this example, Reduce can often help when simpler methods fail. Here, I feed it the desired statement together with the assumptions which are specified in Assuming: statement = x + (1 - x) (1 + y)^z > 0; Assuming[0 < x < 1 && 0 < y < 1 && 0 < z < 1, ...


8

I've fiddled with this on and off for a while now, hesitating to decide whether it was worth posting since another answer has already been accepted. The undocumented function, Experimental`OptimizeExpression, can be used to break down the solutions algebraically into common subexpressions, and it seemed like an approach worth sharing. On the other hand, ...


7

you can also try: PolarPlot[2/Cos[t], {t, 0, Pi/4}] or ContourPlot[x == 2, {x, 0, 4 Pi}, {y, 0, 4 Pi}] If you want to find the area using other method, I would suggest to use Area and ImplicitRegion in V10 as follows: r = ImplicitRegion[y >= Exp[-x] && x <= 2 && y <= 1, {x, y}]; Area[r] (*(1 + E^2)/E^2*) for shading issue ...


6

I am not getting the same results in version 10. Also I see no problem with the results already indicated, and I'll say a bit about that as we proceed. Here is what I obtain in version 10. smatrix = {{1 - 2.96392/u2, 0.0000196744/u2}, {1. - 2.96392/u2, -2.11737*10^-10 + 0.0000196746/u2}}; det = Det[smatrix]; sols = Solve[det == 0, u2] During ...


6

Abstract This is not exactly the requested solution, but it is parametrized, and I think it will give some insight and can possibly be improved. With this code (modified 03.09.14 11:30) it is possible to determine all integer solutions to $1=\sum _{i=1}^n \frac{1}{a(i)}$ without the $a(i)$ being bounded by $amax$, by letting $amax=\infty$. In this sense ...


6

There is a difficulty with the statement of the problem. Generally the problem can be solved as shown below. In this case there is a stipulation that $1 < x < 5$ and $1 < y < 5$. Unfortunately the solution to the system does not satisfy these constraints (also shown below). If we agree to use only numerical techniques and pretend that Solve ...


6

Its my understanding that you want to insist on using Plot for this problem. Then how about defining a function that has a vertical jump at x=2 and otherwise exceeds the required PlotRange so that its remaining parts won't show up? Plot[100 Sign[x - 2], {x, -3, 3}, ExclusionsStyle -> Red, PlotRange -> {-1, 1}]


6

There are a number of issues with your code. First, GaussianDistribution is not a built-in function; I think you want to have NormalDistribution in combination with RandomVariate. Secondly, SetDelayed (:=) returns Null (or $Failed if something went wrong), so y has the value Null after your second line. Hence the lines after that don't work. Allow me to ...


5

eq = (60 - r/2) (70 - ca - r/2) - (60 - r/2 - ca + (4/25) (70 - r/2 - ca))*(70 - r/2) == 0 sol = Solve[eq,ca]; caFun[r_] := Evaluate[ca /. sol[[1]]] caFun[r] (* ((-19600 + 280 r - r^2)/(2 (-265 + r)) *)


5

As suggested by george2079 the equation can be solved by substition: Reverse@Simplify[f[x] == 2 x + 1/x - f[1/x]/2 /. f[1/x] -> 2/x + x - f[x]/2] f[x] == 2 x To find $f^{-1}(4)$ you can use f = 2 # &; InverseFunction[f][4] 2


5

Oh, you just incorrectly type the equation in Mathematica, your second one should be: 1 - 2 d + 2 d b + 2 e b == 0, check the 2 d term. It's not a 2 b. Solve[{2 + 2 a d + 2 a e == 0, 1 - 2 d + 2 d b + 2 e b == 0, 1 + 2 d c + 2 e c == 0, a^2 + b^2 + c^2 - 2 == 2 b, a^2 + b^2 + c^2 - 2 == 0}, {a, b, c, d, e}] (* {{a -> -2 Sqrt[2/5], b -> 0, c ...


5

The new V10 region functionality is rather suited to implementing your description of the problem in a direct way: reg = ImplicitRegion[y < 1 && y > E^-x && x < 2, {x, y}]; Show[BoundaryDiscretizeRegion[reg, {{0, 2}, {E^-2, 1}}], Axes -> True, AxesOrigin -> {0, 0}, AspectRatio -> 1/GoldenRatio] Also for finding the ...


5

Forgive me if this is not useful but sometimes I find value in using Interval in such problems: x = y = z = Interval[{0, 1}]; x + (1 - x) (1 + y)^z Interval[{0, 3}] Interval represents a closed interval rather than the open intervals in your example so this is not equivalent, nevertheless it may help to find the bounds of an expression.


5

Introduction My first suggestion is to learn a little more about optimization. A good tutorial can be found here from Wolfram: http://reference.wolfram.com/language/tutorial/ConstrainedOptimizationGlobalNumerical.html Analysis Now let's have a closer look at your problem. der1 = (a (0.50984 + 2.75322 b))/(0.0649842 + 0.70185 b - 0.871367 b^2)^2 ...


4

The various powers involving p serve to bury the x too deep to be able to solve for it without additional assumptions. To make the job of specifying such assumptions easier, I'll introduce an auxiliary variable z. First I solve for z, which requires only two additional assumptions to allow Solve to invert the powers. The result is stored in zSolution. Then I ...


4

I shoot for reasonable clarity instead of performance - in my opinion observed <1.5 hour runtime is acceptable, considering clarity - at least to my eyes - of the solution: With[{b = LCM @@ Range@100}, Select[b/IntegerPartitions[b, {10}, b/Range@100 // Reverse], Unequal@@#&]] Here all numbers are multiplied by b, least common multiplier for all ...


4

You have a typo in your second equation. eqns = {2 + 2 a*d + 2 a*e == 0, 1 - 2 e + 2 d*b + 2 e*b == 0, 1 + 2 d*c + 2 e*c == 0, -2 + a^2 - 2 b + b^2 + c^2 == 0, -2 + a^2 + b^2 + c^2 == 0}; Solve[eqns, {a, b, c, d, e}] // Simplify


4

A simpler solution would be to use Eliminate sol = y /. First@Solve[Eliminate[{eqn1, eqn2}, z], y] -((1 + 2 x - 7 x^2 - 14 x^3)/(x (2 + 21 x^2))) Plot[sol, {x, -2, 2}, PlotRange -> {-2, 2}, Frame -> True]


4

UPDATE: version 10.0.1 on a Mac produces the same behavior. An extended comment and observation. $Version "10.0 for Mac OS X x86 (64-bit) (June 29, 2014)" The double integral evaluates only with integration over c as the outer integral int1 = Integrate[1/(E^((a - c)^2 + (b - c)^2)), {c, 0, 1}, {b, -Infinity, Infinity}] Investigating the ...


4

a = Sum[10^i, {i, 20, 40, 10(*step size*)}]


4

I like this short one: Solve[w^2 c^2 - 1 == 0 && (c == 1 || c == 2), {w, c}] (*{{w -> -1, c -> 1}, {w -> 1, c -> 1}, {w -> -(1/2), c -> 2}, {w -> 1/2, c -> 2}}*) It can be generalized as: cvalues = {1, 2, 5, 6}; Solve[w^2 c^2 - 1 == 0 && Or @@ Thread[c == cvalues], {w, c}]


4

This is a bit long for a comment. You can use a tandem of LinearSolve and NullSpace. But for exact problems this will, I'm fairly sure, use dense matrices. That takes you back to what Solve is doing anyway, under the hood. Assuming your inputs are integer or rationals you might avoid dense matrix algebra as follows. Use numerical methods to find a single ...


3

Let's define a polynomial p of one variable x depending on two parameters A and L: p[x_, A_, L_] := 96 x^8 − 192 L x^7 + (768 π^2 A^2 + 128 L^2) x^6 + (−64 L^3 − 640 A^2 π^2 L) x^5 + (2655 π^4 A^4 − 640 L^2 π^2 A^2 + 32 L^4) x^4 + (384 A^2 L^3 π^2 − 578 A^4 L π^4) x^3 + (4476 π^6 A^6 − 2760 L^2 π^4 A^4 + 128 L^4 π^2 A^2) x^2 + (456 ...


3

With the help of Bill's edits, the code should look like this: Clear[f, omega, alpha, beta, h, M, T, v, rho]; eta = Sqrt[beta^2 (Sqrt[4 alpha^2 omega^2/beta^2 + 1] - 1)/(2 alpha^2)]; chi = Sqrt[beta^2 (Sqrt[4 alpha^2 omega^2/beta^2 + 1] + 1)/(2 alpha^2)]; alpha = Sqrt[h^2 M/(12 (1 - v^2) rho)]; beta = Sqrt[M T/((1 - v^2) rho)]; a = 1; ...


3

Factor x^p out of the last term to get w == a p (a + b (y/x)^p)^(1/p-1) then use Eliminate[{{w == a p (a + b z^p)^(1/p - 1), z == y/x}}, z] to get ((-a + ((a p)/w)^(p/(-1 + p)))/b)^(1/p) == y/x && x != 0 $\left(\frac{\left(\frac{a p}{w}\right)^{\frac{p}{p-1}}-a}{b}\right)^{\frac{1}{p}}=\frac{y}{x}\land x\neq 0$


3

sol1 = Solve[1 - 3 x y == 5 z - 2 x, z] sol2 = Solve[y == 7 x z - z/x /. sol1, y] Plot[y /. sol2, {x, -5, 5}] Solve[Simplify@Eliminate[{1 - 3 x y == 5 z - 2 x, y == 7 x z - z/x}, z], y]


3

Dom = ImplicitRegion[ x^2 + y^2 >= 1 && x^2 + y^2 <= 5, {x, y}]; c = { DirichletCondition[u[x, y] == 200, x^2 + y^2 == 1], DirichletCondition[u[x, y] == 0, x^2 + y^2 == 5]}; result = NDSolveValue[{\!\( \*SubsuperscriptBox[\(\[Del]\), \({x, y}\), \(2\)]\(u[x, y]\)\) == 0, c}, u, {x, y} \[Element] Dom]; GraphicsRow[{ ...


3

Try something like this: z = z /. Solve[eqn1][[1]]; (*1/5 (1 + 2 x - 3 x y)*) Since you know how z is expressed through x and y, you can put it to the second equation, and get the solution for y. sol = y /. Solve[eqn2, y][[1]]; Plot[sol, {x, -2, 2}]



Only top voted, non community-wiki answers of a minimum length are eligible