New answers tagged

1

While the structural operation DeleteCases[eq1 /. Equal -> Subtract, _?(FreeQ[#,T0]&)] works, I prefer using an algebraic approach on a algebraic problem. vars = Select[Not@*FreeQ[T0]]@Variables[eq1 /. Equal -> Subtract]; coeffs = CoefficientArrays[eq1 /. Equal -> Subtract, vars]; Fold[#2 + #1.vars &, Reverse@ReplacePart[coeffs, 1 -> 0]...


1

Block[{T1, Equal = Plus}, SetAttributes[T1, Constant]; eq1] -Derivative[1, 0][T0][x, t]^2 - T0[x, t]*Derivative[2, 0][T0][x, t] Or (thanks to Mr. Wizard here) eq1 /. {s_Symbol /; StringMatchQ[SymbolName[Unevaluated@s], "T" ~~ Except["0"]] -> 0, Equal -> Plus} -Derivative[1, 0][T0][x, t]^2 - T0[x, t]*Derivative[2, 0][T0][x, t]


1

Not the most elegant solution, but you can use the Collectcommand in the following manner eq1 = Derivative[0, 1][T1][x, t] - Derivative[1, 0][T0][x, t]^2 - T0[x, t]*Derivative[2, 0][T0][x, t] - Derivative[2, 0][T1][x, t]; (Coefficient[#1, {T0[x, t], Derivative[1, 0][T0][x, t], Derivative[1, 0][T0][x, t]^2}] & )[...


4

Weirdly, the less specific assumption $G1>0$ works to achieve your simplification here: Simplify[xxx, Assumptions -> G1 > 0]


0

You can always brute force it. eq = x y + y^2 - 1 + (z + Cos[z]) y x - 24*(z + Cos[z]) + Tan[x] == x^4 (Solve[eq /. {z + Cos[z] -> f[z]}, f[z]][[1, 1]] /. Rule -> Equal) /. f[z] -> z + Cos[z] (*z + Cos[z] == (x^4 - Tan[x] - x y - y^2 + 1)/(x y - 24)*) This, of course, requires that all expressions containing z be the same form.


2

This function brings everything to one side (f), takes a derivative with respect of variable of interest var and integrates back to get an expression dependent on this variable. This is then the left hand side lhs, the right hand side rhs is formed by the rest of the expression: Clear[e,iso] iso[eq_,var_]:=Module[{f,lhs,rhs,g}, f=eq/.Equal[a_,b_]->a-b; ...


1

With Reduce you can actually solve this problem; you need, though, to specify the variable you want to use to solve it for: Reduce[xy + y^2 - 1 + zyx - 24*z + Tan[x] == x^4, z] which yields as a solution z == 1/24 (-1 - x^4 + xy + y^2 + zyx + Tan[x]) This will obviously work only if your variable can be expressed explicitly.


1

First you can try Subscript (Control key + _) to make tx and ty look more like a coefficient, then use Subscript[tx,0] -> Function[{x,y},x^2 (1-x^2) C1]. The reason for making the function of x and y even when it is a function only of x is to convince the partial derivative function that its y derivative is 0. Another way to do similar things is to use ...


0

another way is to use Simplify or Fullsimplify Simplify @@ ConditionalExpression[-Sqrt[1 - x - x^2], 1/2 (-1 - Sqrt[5]) < x < 1/2 (-1 + Sqrt[5])] returns -Sqrt[1 - x - x^2]


1

Why not apply ComplexExpand to get an expression totaly free of imginary unit I ? ceRe = ComplexExpand[Re[expr], TargetFunctions -> {Re, Im}] // FullSimplify[#, 0 <= e <= 1/10] & (* (1/(6 e (-1 + 2 e)))(2 + e (-13 + 12 e) + (-2 + e) Cos[1/3 ArcTan[8 + e (-12 + e (-210 + e (647 + 216 (-3 + e) e))), 12 Sqrt[3] (1 - 2 e) (1 - e)^(3/2) e ...


2

(Update: Re was unhelpful here; removing it.) I am not sure how helpful this is, but if we start with a qualified FullSimplify: expr = (* your expression here *) simp = FullSimplify[expr, 0 <= e <= 1/10] (1/(24 e (-1 + 2 e)))(8 - 52 e + 48 e^2 + ( 2 I (I + Sqrt[3]) (-2 + e)^2)/(8 - 12 e - 210 e^2 + 647 e^3 - 648 e^4 + 216 e^5 + 12 Sqrt[3] (1 ...


0

Not an answer because I am not sure exactly what the OP wants as the output. However : expr = -((-2 + 13 e - 12 e^2)/(6 (-e + 2 e^2))) + ((1 - I Sqrt[3]) (-4 + 4 e - e^2))/(6 2^(2/3) (-e + 2 e^2) (16 - 24 e - 420 e^2 + 1294 e^3 - 1296 e^4 + 432 e^5 + Sqrt[4 (-4 + 4 e - e^2)^3 + (16 - 24 e - 420 e^2 + 1294 e^3 - ...


3

Using an Iterator: With[{fn = GeneralUtilities`ListIterator[{f, g, h}]}, Unevaluated@Read[fn] /@ y[u, v, w]] (* y[f[u], g[v], h[w]] *)


6

I'm not sure if this counts as a separate case per se, so here it goes: threadOver[f_List, h_[x__]] := Inner[Construct, f, {x}, h] As an example, evaluate threadOver[myFuncs, expr] to obtain: y[f[u], g[v], h[w]] A more complicated instance of my threadOver function making use of ListCorrelate could be the following: threadOver[f_List, h_[x__]] := ...


2

If you are allowed to modify expr in place, this would do the trick: expr[[1;;-1]] = MapThread[Construct, {myFuncs, Level[expr,1]}] expr y[f[u],g[v],h[w]] Otherwise, you could use the following function: innerMap[fs_, expr_] := Head[expr] @@ MapThread[Construct, {fs, Level[expr,1]}] innerMap[myFuncs, expr] y[f[u],g[v],h[w]]


4

It's funny how convoluted all of these answers need to be. Here's another convoluted one. It's clunky because it does extra operations and then removes these extra pieces. innerMap[fs_, expr_] := Through@*fs /@ expr // MapIndexed[#1[[First@#2]] &] innerMap[{f, g, h}, y[u, v, w]] (* y[f[u], g[v], h[w]] *) (The function MapIndexed[#1[[First@#2]] &] ...


9

MapIndexed[myFuncs[[#2[[1]]]][#] &, expr] or MapIndexed[Extract[myFuncs, #2][#] &, expr] or ReplacePart[expr, i_ :> myFuncs[[i]]@expr[[i]]] or expr // Query[Thread[Range@Length@myFuncs -> myFuncs]] or Head[expr] @@ Array[myFuncs[[#]]@expr[[#]] &, Length@expr] or Head[expr] @@ Construct @@@ Transpose @ {myFuncs, List @@ expr}


12

Inner[# @ #2 &, #, {##} & @@ #2, #2[[0]]] &[myFuncs, expr] y[f[u], g[v], h[w]] or Inner[Construct, #, List @@ #2, Head @#2] &[myFuncs, expr] y[f[u], g[v], h[w]] Also Construct @@@ Thread[{#2[[0]] @@ #, #2}, #2[[0]]] &[myFuncs, expr] y[f[u], g[v], h[w]] and Operate[Apply[#]@*(Compose @@@ Thread @{myFuncs, {##}} &) &, ...


13

Using Mapthread innerMap[funcs_, expr_] := Head[expr] @@ MapThread[#1[#2] &, {funcs, List @@ expr}] innerMap[myFuncs, expr] y[f[u], g[v], h[w]]


2

Here is an approach that doesn't need to flatten the whole tree of data. Let's take the example of moving the level 1 keys at the level 3, on the data assoc of your self-answer : assoc = Fold[AssociationThread[#2 -> #1] &, "X", Reverse@Table[ToString[10 i + j], {i, 4}, {j, 2}]] Here is a function showAssocListTree that will be usefull to ...


7

Definitions Here is an alternative implementation using the Wolfram Function Repository functions AssociationKeyFlatten and ToAssociations (submitted by WRI personnel) and the function meMerge (localMerge) from the answer by andre314: Clear[TransposeAssoc]; TransposeAssoc[assoc_Association, perm_?PermutationListQ] := Block[{assoc2, assoc3, LocalMerge}...


8

If you factor a permuation perm into a product of cycles of the form $(j\ k)$ with $k=j+1$, then the permuation can be effected by Query and Transpose. Functions: adjacentCycles[perm] (* factors perm into "adjacent" 2-cycles *) dsTranspose[x, perm] (* like Transpose[x, perm], but x is a Dataset or Association *) Code: (* ...


Top 50 recent answers are included