Tag Info

New answers tagged

2

Wolfram|Alpha is more willing to change the input because the input is generally natural language. Alpha has interpreted hw has two single-letter symbols, h and w. Mathematica has interpreted hw as a single two-letter symbol. Because you asked Mathematica to solve for h and h does not appear in the expression, there is no solution. Adding a space tells ...


4

You can find the family of parameters with Reduce. For example f[x_] := x^5 + a x^4 + b N@Reduce[f[x] == x && f'[x] == 1 && 0 < a < 1, {x, a, b}, Reals] Here x acts as an arbitrary parameter with certain restrictions.


5

What you have is basically a nonlinear second order recursion, and in this case it can be solved by: sol = RSolve[-k x f[x] + k (x + 1) f[x + 1] - r f[x] + r f[x - 1] == 0, f[x], x] The answer is fairly large, and besides having variables r and k, it also has two constants C[1] and C[2], so there may be enough flexibility to enforce your desired ...


1

Unnecessary use of SetDelayed rather than Set causes repetitive recalculations and slows everything down. Use of Simplify with some of the interim calculations also improves performance. params[ss_, mm_] = {c -> 0.05, mu -> 1, bo -> 10, k -> 0.01, sig -> ss, eps -> 1, rm -> mm}; b[a_] = bo a/(1 + a); rS[ga_] = rm/(1 + c ga); ...


1

As noted by Bill S, getsol[0,0] fails. In fact, getsol[sig,0] appears to fail for any value of sig. I suggest you try For[i = 0, i < 0.3, i = i + 0.1, For[j = .1, j < 0.3, j = j + 0.1, sig = i; rm = j; Print[sig, " ", rm, " ", getsol[sig, rm]]]] which excludes rm = 0. Note also that the third argument of the outer For has been changed from ...


1

I think part of the issue lies with the coordinate singularity at r=0. I made the following transformations, first x1 -> x1/KO2 , x2->x2/KS . Then u1=x1/r and u2=x2/r. I also assumed that you were solving from R0>0 to R because you couldn't solve at R0=0. I set the boundary conditions u1[0]=0, u2[0]=0 . These transformations were used because Laplacian[ ...


3

Update notice 2: Found starting initial conditions that work in V10. Update notice: bbgodfrey pointed out that the built-in shooting method does not work in V10.0.1 (nor V10.0.2). Set up the shooting method by hand, so you can control the convergence. The problem is that small changes in the initial conditions cause the solutions to blow up before r ...


0

I seem to get only the trivial (all zero) solution. I had to separate into explicit real and imaginary parts (of both variables and equations), and equate those latter separately. Also I rationalized since Solve will do that anyway, and be grumpy about it. G3[x1_, x2_] = Rationalize[ Rationalize[{2 ((0. + 0. I) + (316.127 + 912.071 I) x1^2 Conjugate[ ...


4

eq1 = (1 + E^b)/(1 + E^(9/10 a + b)) == 95/100; a0 = a /. Solve[eq1, a] /. C[1] -> 0 f[b1_, x_] := (1 + E^b1)/(1 + E^(x a0 + b1)) /. b -> b1 Quiet@FindRoot[NIntegrate[f[b, x], {x, 0, Infinity}] == 1, {b, -20}] (* {b -> -29.4444} *)


1

You can solve for the reciprocal of res: capacitance =.; Solve[i[250*10^-6, res] == 10^-6 /. res -> 1/reciprocal, reciprocal, Reals] Solve::ratnz: Solve was unable to solve the system with inexact coefficients. The answer was obtained by solving a corresponding exact system and numericizing the result. >> {{reciprocal -> ...


0

the parametric equation of line from point P in direction of vector V P={1, 2, 3}; V={5, 6, 7}; L[t_]:=P+V t the equation of elipsoid in 3d with focal points P1 and P2 and summ of distansies 2S P1={1, 2, 3}; P2={5, 6, 7}; P={x, y, z}; S=20; El= Norm[P-P1]+Norm[P-P2]==2S /.Abs[a_]^2->a^2 parametric equation of elips in 3d as curve with axies directed ...


3

If the output is as shown you can use ToRules: Reduce[{a^2 + 6 b - 7 == 0 && a - 1/b == 0}, {a, b}, Reals]; {ToRules[%]} {{a -> -3, b -> 1/6 (7 - a^2)}, {a -> 1, b -> 1/6 (7 - a^2)}, {a -> 2, b -> 1/6 (7 - a^2)}} If you are attempting to find many solutions you may need to increase the System Option ...


4

I'm on 10.0 for Mac OS X x86 (64-bit) (December 4, 2014), just use Backsubstitution -> True while using Reduce, Solve[{a^2 + 6 b - 7 == 0 && a - 1/b == 0}, {a, b}, Reals] $\left\{\left\{a\to -3,b\to -\frac{1}{3}\right\},\{a\to 1,b\to 1\},\left\{a\to 2,b\to \frac{1}{2}\right\}\right\}$ Reduce[{a^2 + 6 b - 7 == 0 && a - 1/b == 0}, {a, ...


3

[Udpate: simplified DirichletCondition, omitted unnecessary Method specification.] Following the Transient PDE examples in Finite Element Programming, I came up with this: Ω = ImplicitRegion[(x + y <= 10), {{x, 0, 10}, {y, 0, 10}}]; Dif = 0.0000072; eq1 = D[u[t, x, y], t] == Dif*Laplacian[u[t, x, y], {x, y}] - 1.2; sol = NDSolve[{eq1, ...


4

You've encountered floating-point roundoff error. Note the combination of very large and very small numbers in eq4. Let's try something different. I'll evaluate just your integrals, without the numbers: v1[t_] = Integrate[a, t] + v10 v2[t_] = Integrate[a, t] + v20 x1[t_] = Integrate[v1[t], t] + h x2[t_] = Integrate[v2[t], t] + h Now we'll just Solve ...


4

You can use ToRules to convert the output to a list of rules. From the documentation: ToRules takes logical combinations of equations, in the form generated by Roots and Reduce, and converts them to lists of rules, of the form produced by Solve. Example: roots = Roots[x^2 + 1 == 0, x] (* x == I || x == -I *) ToRules[roots] (* Sequence[{x -> I}, ...


1

If you need to compute Roots, you can then extract the numerical roots this way: myRoots = Roots[x^2 + 15 x + 13 == 0, x]; Max@Level[myRoots, 1, Heads -> False][[All, 2]] or Sort@Level[myRoots, 1, Heads -> False][[All, 2]]


2

It's better to stay away from loops in Mathematica: k = 6; l = Tuples[ConstantArray[Range[k - 1], 4]]; p[{a_, b_, c_, m_}] := Module[{w = Exp[(2*Pi*I*m)/k]}, x^4 - 6*x^2 - x*(w^(a - c) + w^(c - a) + w^b + w^(-b) + w^(b - c) + w^(c - b) + w^a + w^(-a)) + (3 - w^c - w^(-c) - w^(a + b - c) - w^(-a - b + c) - w^(a - b) - w^(-a + b))] sols = ...


3

The tutorial "ExplicitRungeKutta" Method for NDSolve shows how to get the built-in coefficients for the the default 2(1) embedded pair: NDSolve`EmbeddedExplicitRungeKuttaCoefficients[2, Infinity] (* {{{1}, {1/2, 1/2}}, {1/2, 1/2, 0}, {1, 1}, {-(1/2), 2/3, -(1/6)}} *) The general syntax for a given method, order, and precision appears to be ...


1

One can go about this using an anzatz that each product of variables is replaced by a sum of corresponding new variables. Some GroebnerBasis rewriting and reduction by the result can then recover the desired form. convertEqToQuadraticForm[form_, t_] := Module[{vars = Variables[form], len, tvars, reps, allvars, gb}, len = Length@vars; tvars = Array[t, ...


4

These equations are solvable, but the process is exceptionally slow and the output huge. To help Solve, replace the approximate real numbers 1. and 2. by 1 and 2. Then, solve the nine linear equations in terms of p and the parameters. nine = Simplify[Solve[{eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq9, eq10}, {Ly, Lq, LA, gA, gB, r, g1, g2, g3}][[1]]]; ...


8

Similar question: How can I simulate this toggle mechanism? {z1 = 15, z2 = 139/50, z3 = 1001/50, z4 = 12, z5 = 1001/50, z6 = 12}; {a0x = 0, a0y = 0, b0x = -z1, b0y = 0}; newsys = {ax == z2 Cos[t], ay == z2 Sin[t], (-ax + bx)^2 + (-ay + by)^2 == z3^2, (-b0x + bx)^2 + (-b0y + by)^2 == z4^2, (-b0x + ex)^2 + (-b0y + ey)^2 == z6^2, (-ax + ex)^2 + ...


3

I'm not sure if this is solvable. However, there appears to be one and only one solution (assuming you want real values for X and T), available by the following kludgy means: First, solve the individual equations for T: s1 = Solve[-(8.314)*T*Log[X] == 8.3*(1400 - T), T] s2 = Solve[-(8.314)*T*Log[1 - X] == 8.3*(1200 - T), T] giving {{T -> 11620./(8.3 ...


0

This is not exactly the answer, maybe someone can improve it.....the output has imaginary components. Minor modifications to the input eqns. FindRoot[{T*Log[X] - (8.3*T)/8.314 == (-(8.3/8.314))*1400, T*Log[1 - X]*(-((8.3*T)/8.314)) == (-8.3/8.314)*1200}, {{T, 500}, {X, 450}}] OUTPUT: {T -> 231.958 + 105.976 I, X -> -0.0120535 + 0.0141176 I}


5

It is hard to figure out what you really need. If you describe the surrounding application you may get better answers. You should avoid using capital letters to start user Symbols in Mathematica as this may conflict with internals. If I follow your updated question I believe you want this: fn[x_, y_] := Min @ Quotient[{x, y}, {2, 1}] Test: fn[2, 1] ...


1

Try this: This makes everything b-dependent: Map[TrigExpand, expr] /. {Sin[a] -> n*Sin[b], Cos[a] -> Sqrt[1 - n^2*Sin[b]^2]} // Simplify (* -((R Csc[b] (n - n^3 Cos[2 b] + Cos[b] Sqrt[4 - 2 n^2 + 2 n^2 Cos[2 b]] + Sqrt[4 - 2 n^2 + 2 n^2 Cos[2 b]] Cos[3 b] - n^2 Sqrt[4 - 2 n^2 + 2 n^2 Cos[2 b]] Cos[3 b] - 3 n Cos[4 b] + ...


3

Given that U*V = f[r], one can invert the function f locally about a center, r == center in terms of a power series with Normal @ InverseSeries @ Series[f[r], {r, center, orderOfApproximation}] /. r -> U*V This yields a truncated power series (polynomial) that approximates InverseFunction[f][U*V]. For instance, Block[{α = 0.13, Q = 0.5^2, M = 1, R = ...


1

You can also use a combination of the options MeshFunctions and Mesh: f[x_, y_] := (x^2 + y^2 - 4) g[x_, y_] := (y - x^2 + 2 x - 1) ContourPlot[{f[x, y], g[x, y]}, {x, -7/2, 4}, {y, -9/5, 21/5}, Contours -> {0}, ContourShading -> False, BaseStyle -> Thick, MeshFunctions -> {g[#, #2] - f[#, #2] &}, Mesh -> {{{0, Directive[Red, ...


2

c = 621455041; n = 74596505816855975484638389815392741477; sol1 = Solve[c == m^2, m, Modulus -> n] {{m -> 24929}, {m -> 52367465358866978466157125093802778}, {m -> 74544138351497108506172232690298938699}, {m -> 74596505816855975484638389815392716548}} If you want to know if it is right, substitiute the solution back into the equation And @@ ...


2

You have a bad attitude not to answer the asked questions. For example, my question number 3. They are not asked without reason. I try to answer nevertheless. So first of all your equations: eq1 = (4 x + 12 x^3 + 12 x^5 + 4 x^7 - 4 y - 2 x^2 y + 6 x^4 y + 2 x^6 y - 2 x^8 y + 2 x y^2 + 12 x^3 y^2 + 10 x^5 y^2 - 12 y^3 - 12 x^2 y^3 + 2 x^4 y^3 - 2 x^8 ...


1

Mathematica solves the problem easily DSolve[x y[x] y'[x] == x^2 + 2 y[x]^2, y[x], x] (* {{y[x]->-x Sqrt[-1+x^2 C[1]]},{y[x]->x Sqrt[-1+x^2 C[1]]}} *) From the solutions we conclude that your function u = y/x is simply u[x_] = Sqrt[-1+x^2 C[1]] You can in fact check that this u[x] solves the transformed equation x u'[x] = 1/u[x] + u[x] ...


1

The reason why D[u[t]]>0 doesn't work is that the derivative at the changing point doesn't exist. You can verify this by: D[UnitBox[x], x] $\begin{array}{cc} \{ & \begin{array}{cc} \text{Indeterminate} & x=\frac{1}{2}\lor x=-\frac{1}{2} \\ 0 & \text{True} \\ \end{array} \\ \end{array}$ So the predicate in WhenEvent never come true. ...


2

From the documentation: If dom is Reals, or a subset such as Integers or Rationals, then all constants and function values are also restricted to be real. So if a complex number is involved, specify the constraints as constraints rather than a domain. Since you did not specify the form of h, as an example let its form be h = (x - r0) + (y + r0)*I. ...


1

Edit: Using FindInstance a = 2 t + 1; b = 2 - t^2; c = t^3; d = t^2 - 4; eq1 = Eliminate[{x == a, y == b}, t] 7 - 4 y == -2 x + x^2 eq2 = Eliminate[{x == c, y == d}, {t}] 64 + 48 y + 12 y^2 + y^3 == x^2 fi = FindInstance[Evaluate@eq1 && Evaluate@eq2, {x, y}, Reals, 2] // N {{x -> -2.96738, y -> -1.93502}, {x -> 4.59731, y ...


1

The problem lies in the location of t and T as variables . To see this, note that we have two parametric curves: f1[t_] := {2 t + 1, 2 - t^2}; f2[t_] := {t^3, t^2 - 4}; We know the intersections must occur for some values t and T such that f1[t]==f2[T]. NSolve[f1[t] == f2[T], {t, T}] or more explicitly (note the different positioning of t and T) ...


3

The problem with arbitary rot, mentioned in a comment by the OP, is that the equations contain terms like (1 - 3 Cos[π/6 + rot]^2) Cos[qx Cos[π/6 + rot] + qy Sin[π/6 + rot]] That rot appears inside Cos simply as well as inside Sin and Cos which are themselves inside a Cos, and that there are several such terms, makes this a difficult equation to solve ...


2

Use Reduce. In fact, with your definitions of fqReal and fqImag, the command red = Reduce[ fqReal == 0 && fqImag == 0 && -Pi <= qx <= Pi && -Pi <= qy <= Pi, {qx, qy}] gives $\left(\text{qx}==-\frac{4 ...


2

In addition to @belisarius' solution, you might want to look at StringForm Clear[f] f[c_, d_, z_] = c + d z; (* either Set or SetDelayed works *) s = Solve[{f[c, d, 1] == 2, f[c, d, -1] == 1}, {c, d}]; StringForm["c = `1`, d = `2`", c, d] /. s[[1]]


4

You need to understand how to define a function and how replacement rules work. This is a nice start point. f[c_, d_, z_] := c + d z s = Solve[{f[c, d, 1] == 2, f[c, d, -1] == 1}, {c, d}] (* {{c -> 3/2, d -> 1/2}} *) Print["c=", c /. s[[1]], " d=", d /. s[[1]]] (* c=3/2 d=1/2 *)



Top 50 recent answers are included