# Tag Info

3

Try the following: Coefficient[f[r, ϕ], Cos[ϕ]]

3

Try rather using the following syntax for your replacement: ( <expr> ) /. { x -> 3.14 } In your case, probably something like: FullSimplify[ (\[Tau] - ArcCos[a[\[Tau]]/b[\[Tau]]]/ Sqrt[b[\[Tau]]^2 - a[\[Tau]]^2]) /. {\[Delta] -> 0.05, \[Beta] -> 1.77, n -> 12} ] See the explanation on Applying Transformation Rules: On the ...

1

It seems the current version (10.3) is now aware of the Meijer $G$ expressions for the order derivatives (see this math.SE answer as well): Derivative[1, 0][StruveL][0, z] // FunctionExpand BesselK[0, z] - MeijerG[{{1/2, 1/2}, {}}, {{0, 0, 1/2, 1/2}, {}}, z/2, 1/2]/(2 π^2) (The last version I used, version 8, was unable to do this, if memory ...

0

I have came up with a solution: In[1]:= asc = <|"A" -> <|"a" -> 1, "b" -> 2, "c" -> 3|>|>; Module[{tmp = asc["A"]}, AssociateTo[tmp, # -> tmp[#] + 1 & /@ {"a"}]; AssociateTo[asc, "A" -> tmp] ] Out[2]= <|"A" -> <|"a" -> 2, "b" -> 2, "c" -> 3|>|>

4

One possibility would be the simple asc["A"]["a"] = 99; As @m_goldberg commented this can be shortened to asc["A", "a"] = 99; To change several keys: asc[[1]][[2 ;; 3]] = 4

3

As was commented, you should probably tell us also about the problematic rule you cannot use but anyway you might be interested in the following approach: As you (should) know, everything in Mathematica is an expression, in other words it can be expressed as f[x,y,...] Your expression: expr = p[{1, 2}] p[{2, 3}]^2 p[{4, 5}] is actually interpreted as: ...

1

If[Read[StringToStream[\$Version], Number] >= 9 ,FilterOptions[a_,b___] := Sequence @@ FilterRules[{b}, Options[a]] ]; would be a general use bridge to make notebooks and packages before version 9 and later compatible with respect to FilterOptions being superseded by FilterRules having a different call interface. You may place it into ...

1

First I would suggest not using Print at all. Print is mainly a debugging tool in Mathematica. Next, assuming that by labeling you mean putting the set of numbers generated by an iteration into a structure that you can retrieve them from later, here are two approaches. I build a table of values of Sin[x] with x going from 0 to 90 degrees in 10 degree ...

2

This seems to admit a simple recursive approach. terms[(Times | Plus)[args__]] := terms /@ {args} terms[x_] := x Then terms[b c + a b c] {{b, c}, {a, b, c}} terms[a b c + Sin[x] Cos[x - y]] {{a, b, c}, {Cos[x - y], Sin[x]}} However, terms[d/e Cos[x - y]] {d, 1/e, Cos[x - y]} Will this last result will be acceptable? I can not make ...

7

In this example, I am assuming that the structure of your expressions will always be similar to your input: input = a*b*c + Cos[x - y]; The method below is not exactly general. First remove the outer-most Plus: list = List @@ Expand[input] (* {a b c, Cos[x - y]} *) We then Map Apply over the list while being careful to avoid those expressions which ...

Top 50 recent answers are included