Tag Info

Hot answers tagged

7

Just for fun: f[a_, t_] := a {t - Sin[t], 1 - Cos[t]} Manipulate[ ParametricPlot[{f[1, 4 t], f[2, 2 t], f[4, t]}, {t, 0, 4 Pi}, PlotStyle -> {Red, Green, Blue}, Epilog -> {{Orange, Circle[{4 p, 1}, 1], Black, PointSize[0.015], Point[f[1, 4 p]]}, {Orange, Circle[{4 p, 2}, 2], Black, PointSize[0.015], Point[f[2, 2 p]]}, {Orange, ...


6

Since version 9 you do not need to do anything extra. tab1 = {{a1, a1 + a2}, {b1, b2*b2}} tab2 = {{2, 5}, {5, 2}} Solve[tab1 == tab2] {{a2 -> 3, b1 -> 5, a1 -> 2, b2 -> -Sqrt[2]}, {a2 -> 3, b1 -> 5, a1 -> 2, b2 -> Sqrt[2]}}


6

It is probably because it is solving a degree 131397 equation: (1 - 2.25577*^-5*h)^5.25588 == 0.9644952131579817 // Rationalize[#, 0] & (* (1 - (225577 h)/10000000000)^(131397/25000) == 79369373/82291101 *) Simpler comparison, to show equivalence with a rationalized equation: s1 = NSolve[(1 - 2.25577*^-5*h)^5.30 == 0.9644952131579817 // ...


6

The general problem is too difficult. Are there any constraints that you can use? For example, if 0 < p < 1 and all values and functions are real Reduce[ {1 - (1 - p^y)^(u (1 - p)) == a, 0 < p < 1}, y, Reals] // Simplify[#, 0 < p < 1] &


5

I can't exactly understand what you're asking for, but is this roughly what you are looking for? A = {{0, 1}, {-k, -c}}; eigA = Eigenvalues[A]; RegionPlot[Min[eigA] < 0, {c, -4, 4}, {k, -2, 2}, FrameLabel -> {"c", "k"}] // Quiet As another amusing example of a two-parameter matrix stability diagram (where blue indicates stability, and red ...


4

First put all your equations into a list (I'm not copying the full code here for brevity) eq = { eq1 == xx, eq2 == yy ...} And then: {val, sol} = NMaximize[{q@2, And @@ eq}, Array[q, 13], Method -> {"SimulatedAnnealing", "PerturbationScale" -> 10}]; sol // TableForm


4

A simple approach is to use a Rule to replace the Rule... equation = Solve[{x^2 + y == 2, y == 1}, {x, y}] /. Rule -> Equal {{x==-1,y==1},{x==1,y==1}} Here, Rule is the full form of the arrow ->.


3

You can use MapThread for this purpose: eqs = MapThread[Equal, {tab1, tab2}, 2] (*{{a1 == 2, a1 + a2 == 5}, {b1 == 5, b2^2 == 2}}*) Solve[Flatten[eqs]] (*{{a2 -> 3, b1 -> 5, a1 -> 2, b2 -> -Sqrt[2]}, {a2 -> 3, b1 -> 5, a1 -> 2, b2 -> Sqrt[2]}}*)


3

I think the problem is that your integrand is just too large numerically to be handled correctly. Are you sure the expressions you are using are based on sound model or mathematics? The number they generate are so large. I can't imagine real physical problem will produce such values. Trying just integrating over x by fixing y to see the problem. I went only ...


3

It requires a transformation that is not generically valid. Also it is a bit hard to make it happen using Simplify due to the default complexity measure. Solve[ Simplify[((v k)^-n (k v^n - v k^n))/(n - 1) == b, Assumptions -> k > 0, ComplexityFunction -> (LeafCount[#] + 5*Count[#, Power[aa_, Except[_Integer]], Infinity] &)], v] ...


3

Introduction There are a few ways to make such a table: (1) a symbolic way that seems conceptually clear and whose slowness is not prohibitive for a table of at most a few thousand entries; (2) using the table created by NDSolve in solving the equation by integrating its derivative either (a) directly or (b) correcting the errors in it; and (3) making a ...


2

Your approach is correct, and you just need to be aware of the fact that the inverse of Exp is a multi-branched complex function. Presumably you want a real solution, and so you must choose C[1] so that the resulting solution is real-valued. In more detail, you compute the solution with the left boundary condition, and then solve for the value of a which ...


2

I finally got a chance to look into the tolerancing. It seems that there is a fairly narrow window for which NSolve, with a nondefault tolerance setting, will handle this. mat = {{a1, b3, b2}, {b3, a2, b1}, {b2, b1, a3}}; eqns = { b1 - (b2 b3)/a1 == 0.1867, a2 - (b3 b3)/a1 == 1.9867, a3 - (b2 b2)/a1 == 0.9867, a1 - (b2 b2)/a3 ...


2

As you're trying to represent things that aren't functions, I suggest to change your representation to vectors (affine): (* a few functions *) line[{v_List, d_List}, a_] := a v + d circle[{c_List, r_}, t_] := c + r {Cos@t, Sin@t} intersection[{v_List, d_List}, {c_List, r_}] := Solve[line[{v, d}, a] == circle[{c, r}, t], {t, ...


2

I'll try to address this one step at a time. Since a is assigned a value of 0.022 I shall assume we will be working numerically. Let's plot our function. a = 0.022; expr = (1/2) x Sqrt[1 + 4 a^2 x^2] + ArcSinh[2 a x]/(4 a) Plot[expr, {x, -1*^5, 1*^5}] 1/2 x Sqrt[1 + 0.001936 x^2] + 11.3636 ArcSinh[0.044 x] There appear to be no complications so ...


2

Here is a case where you should take a close look at the magniture of your quantities and do some manipulation to normalize things before throwing the system at the computer: Zl = 2.05*10^-15 \[Alpha] = 1.6381 \[Rho] = 0.326*10^-10 k = 8.9875517873681764*10^9 e = 1.602176565*10^\[Minus]19 divide both of your expressions by ( \[Rho] e ) : ...


2

The code NSolve[Rationalize[f1[x] == f2[x], 0], x, Reals], 100] yields three solutions (with or without N), which is the minimum number of solutions if Zl ρ is positive. The following, which sets the precision of the input to match the working precision, NSolve[SetPrecision[f1[x] == f2[x], 100], x, Reals, WorkingPrecision -> 100] also yields three ...


2

How do I plot the derivatives of the solution You can simply tell NDSolve to also solve for the derivative: sol = First@NDSolve[{x''[t] + x'[t] + 10 Sin[x[t]] == 3, x[0] == 0, x'[0] == 1}, {x[t], x'[t]}, {t, 0, 20}]; Plot[{x[t] /. sol, x'[t] /. sol}, {t, 0, 20}, PlotStyle -> {Red, Blue}, PlotRange -> All, Frame -> True, PlotLegends ...


2

x BesselJ[1,x] very soon dominates the behavior and you can use BesselJZero[n,k] to constrain FindRoot[]: > f[x_]=x BesselJ[1,x] - 2 BesselJ[0,x] > zero[n_]:=BesselJZero[1,n-1]//N > FindRoot[f[x]==0, {x, zero[1005]-1, zero[1005]+1}] Of course you need to be a little careful about the interval you search for the root in. A more thorough approach ...


1

For a start I think you may need to use SetDelayed (:=) instead of Set (=). Then be careful with the spaces, a b c (the product of three different variables) is not the same as abc (a single variable). Then porbably you want something like this: ClearAll[a, b, c, d, e, f, g, h, i, j, k] Panel[Grid[{{Style["Inputs", Bold], SpanFromLeft}, {"a:", ...


1

sol=Assuming[ -10 < k < 10, Simplify@Solve[ And @@ { k*x - (x - y)*y^2 == 0, y + (x - y)*y^2 - (1 - x - y) == 0 }, {x, y}] ]; that is the analytical solution (there are three). You can evaluate that numerically dat=Transpose@Table[Chop@N[{x, y} /. sol], {k, -10, 10, 0.1}]; ListLinePlot[dat] empty regions are complex


1

Since nobody has posted a "messy" solution yet, let me: if the matrices are in one list alist = {a1,a2,...,an} and the rhs' are in another, blist = {b1,b2,...,bn} then Clear[x]; vars = x[#] & /@ Range[n]; vars /. Solve[Dot[#1, vars] == #2 & @@@ Transpose[{alist, blist}], vars]


1

Here is what I believe you are seeking: ParametricPlot[{{1 (Theta - Sin[Theta]), 1 (1 - Cos[Theta])}, {2 (Theta - Sin[Theta]), 2 (1 - Cos[Theta])}, {4 (Theta - Sin[Theta]), 4 (1 - Cos[Theta])}}, {Theta, -10 Pi, 10 Pi}, AspectRatio -> .5, PlotRange -> {{-8 Pi, 8 Pi}, Automatic}] The resulting Plot:


1

Not sure why this resurfaced but it can be done symbolically by separating real and imaginary parts. This of course is no guarantee that for some regions on parameter space the solution values will actually be real valued. zz = Array[x, 6] + I Array[y, 6]; polys = Expand[ ComplexExpand[{zz[[1 ;; 3]].Conjugate[zz[[1 ;; 3]]] - a, zz[[1 ;; 3 ;; ...


1

Just another way. Noting from the puzzle the integer digits must consist of integer and multiples that do not exceed 10 (and obviously 0 cannot be one of the digits) thus only 1 and 2,3 and their multiples less than 10 can form the digits of the desired number, i.e.{1,2,3,4,6,8,9}.. You could pare down further but: set = {1, 2, 3, 4, 6, 8, 9}; sub = ...


1

Here's a way that mimics the by-hand method. The idea is to replace common subexpressions by symbols until it gets to the point where Solve will work. In some places I'm assuming that quantities are real and positive. eqn = -i - q + p s^(-1 + a) (1 + s^a)^(-1 + 1/a) - t == 0 /. s -> u^(1/a) // PowerExpand eqn = eqn /. a -> 1/(1 - r) // Simplify (* ...


1

This is but a mild variant. I'll create an example using n=4. SeedRandom[1111]; n = 4; tmat = RandomInteger[{-10, 10}, {n - 2, n}] (* Out[190]= {{-8, 5, -3, -8}, {-4, 2, 4, 2}} *) LinearSolve[IdentityMatrix[n] - Join[tmat, {ConstantArray[0, n], ConstantArray[0, n]}], UnitVector[n, n]] (* Out[196]= {18/11, 50/11, 0, 1} *) An alternative might be to ...


1

Probably I do not quite understand the problem, but if you want solutions which would be valid for all t, then I would first eliminate it from the equations above. Unfortunately SolveAlways[] don't work in this case. Still You can calculate GroebnerBasis and eliminate t like this gb = GroebnerBasis[{x == 1/18 (-6 b - t + 12 y + Sqrt[t] Sqrt[12 b + t + ...


1

Use Map over ReplaceAll to translate all your solutions into a list of constants. Example using randomly selected functions that seem to work: sols = NSolve[{10 Sin[4 n] == Exp[1], 0 <= n <= 5}, {n}, Reals]; Plot[Map[n /. # &, sols], {z, 0, 1}]


1

You want to find the value of n for which a[n] == 17160 Clear[a]; a[n_] = a[n] /. RSolve[{a[n + 1] == (n + 1)*a[n], a[10] == 10}, a[n], n][[1]] Pochhammer[1, n]/362880 LogPlot[{a[n], 10, 17160}, {n, 1, 14}] FindRoot[a[n] == 17160, {n, 12}] {n -> 13.} a[13] 17160



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