Tag Info

Hot answers tagged

23

Other answers have already suggested ways of querying options. There's no way of systematically generating a list of all string values, but it's not too difficult to put together a list of all of the values which are used by Wolfram Research in Mathematica itself. If you look in the various files in these locations: ...


15

Have you tried adding AppendTo[$Path, FileNameJoin[{$UserBaseDirectory, "ExtraPackges"}]] to the file FileNameJoin[{$UserBaseDirectory, "Kernel", "init.m"}] ? init.m is described here, under "more information".


14

I believe I would use: expr = Q1 a1 + Q2 a2 + Q3 a3 + Q4 a4 + Q5 a5 + Q6 a6 + Q7 a7 + Q8 a8 + Q9 a9 + Q10 a10 + Q11 a11 + Q12 a12 + Q13 a13 + Q14 a14 + Q15 a15 + Q16 a16 + Q17 a17 + Q18 a18 + Q19 a19 + Q20 a20 + Q21 a21 + Q22 a22 + Q23 a23 + Q24 a24 + Q25 a25 + Q26 a26 + Q27 a27 + Q28 a28 + Q29 a29 + Q30 a30 + Q31 a31 + Q32 a32 + Q33 a33 ...


11

Perhaps: using systemnames = Names["System`*"]; Select[systemnames, CurrentValue[#] =!= $Failed &]; CurrentValue /@ % // Short (* ==> {False, {FrontEnd`FileName[{$UserBaseDirectory, "Autoload"}], ... } *) for the System` context, and replacing System with the appropriate context name for other members of the list Contexts[]?


8

xQ = Q1 a1 + Q2 a2 + Q3 a3 + Q4 a4 + Q5 a5 + Q6 a6 + Q7 a7 + Q8 a8 + Q9 a9 + Q10 a10 + Q11 a11 + Q12 a12 + Q13 a13 + Q14 a14 + Q15 a15 + Q16 a16 + Q17 a17 + Q18 a18 + Q19 a19 + Q20 a20 + Q21 a21 + Q22 a22 + Q23 a23 + Q24 a24 + Q25 a25 + Q26 a26 + Q27 a27 + Q28 a28 + Q29 a29 + Q30 a30 + Q31 a31 + Q32 a32 + Q33 a33 + Q34 a34 + Q35 a35 + Q36 ...


6

To my understanding CurrentValue adds an alternative syntax to what Options and SetOptions provide for the frontend and notebooks. So in addition to what's documented I think Options[$FrontEnd] and Options[Notebook] would be a good starting point. These are what I usually consult when searching for something.


5

Basing on Sjoerds self answer, you were missing the subdirectories. I added that and the tr files (don't know if it was worth something). Probably I'm missing some others because this doesn't check box structures, but it does get a few extras fnames = FileNames[ "*.nb" | "*.tr", {FileNameJoin[{$InstallationDirectory, "SystemFiles", ...


5

You can do this programmatically by converting the expression to strings, replacing Qs with Rs and then converting it back to an expression. For example: expr := Q1 a1 + Q2 a2 + Q3 a3 + Q4 a4 + Q5 a5 + Q6 a6 + Q7 a7 + Q8 a8 + Q9 a9 + Q10 a10 + Q11 a11 + Q12 a12 + Q13 a13 + Q14 a14 + Q15 a15 + Q16 a16 + Q17 a17 + Q18 a18 + Q19 a19 + Q20 a20 + Q21 ...


4

ClearAll[x, y, z, d, h, p, m, f, g, a, w]; expr = Sin[x] + Cos[y] + z^3 + Exp[d] + h + 3 h^2 + 4 h^3 + Integrate[Exp[p], p] + D[Sin[m]^Exp[f], m]*Series[Sin[g], {g, 0, 3}] + 2 (E^a BesselK[0, 2 Sqrt[E^a]]) C[2]/D[Gamma[w], {w, 2}]; Cases[Variables[Level[expr, -1]], x_ /; AtomQ[x] :> x] (* {a, d, f, g, h, m, p, w, x, y, z} *)


4

Perhaps there's a better way than using Reduce three times, but it seems to me that the computations to figure out the range of each variable will have to be done somehow. Reduce does that. This will work on such simple inequalities as in the OP's example: And @@ (First@Reduce[a == b + c && a >= 2 && b <= 10 && c == 5, #] ...


4

Using Nasser's expression code as an example: expr = Sin[x] + Cos[y] + z^3 + Exp[d] + h + 3 h^2 + 4 h^3 + Integrate[Exp[p], p] + D[Sin[m]^Exp[f], m]*Series[Sin[g], {g, 0, 3}] + 2 (E^a BesselK[0, 2 Sqrt[E^a]]) C[2]/D[Gamma[w], {w, 2}]; You might use: Variables @ Level[expr, {-1}] {a, d, f, g, h, m, p, w, x, y, z} To extract indexed ...


3

The reason that MakeExpression has any FormatValues at all is because there's one defined in GetFEKernelInit.tr for some experimental functionality (which we probably ought to clean up in a future release). The fact that it's experimental also led to our not fully implementing the error-handling cases of typesetting, which is the source cause of the pink ...


3

This constitutes only a beginning (if that) of an answer, maybe more an extended comment. You seem to have some problems with your code. First, I don't think you need to define any of the following as functions (i.e., defined using := ): a, b, c, \[HBar], H0, G, \[CapitalOmega]M, \[CapitalOmega]\[Gamma], \ \[CapitalOmega]\[CapitalLambda], \[Lambda], f, y ...


3

the dK[2] just means the integral is with respect to K[2], $\int f(t) dt$ is exactly the same as $\int f(K[2]) dK[2]$ In this case, it appears in the solution because X1[x] is an unknown, so the only way for the differential equation to be formally solved is to include how it would affect the solution via the integrals. However, you can solve for x1 at ...


3

Clear[GetVariables] SetAttributes[GetVariables, HoldFirst]; GetVariables[expr_, f_:Identity, excludedContexts:{__String}:{"System`"}]:= Cases[Unevaluated[expr], a_Symbol/;!Or[ MemberQ[excludedContexts, Context[a]], MemberQ[Attributes[a], Locked | ReadProtected] ] :> f[a], {0, Infinity} ]//DeleteDuplicates It is used like ...


3

sr = {Exp[v_] :> v, v1_^v2_ :> {v1, v2}}; variables[expr_] := FixedPoint[Replace[Variables[# /. sr], _[x_] :> x, {1}] &, expr] variables[Sin[Subscript[x, 1]] + Cos[Subscript[x, 2]]] (* {Subscript[x, 1], Subscript[x, 2]} *) variables[Sin[x] + Cos[y] + z^3 + Exp[d] + h + 3 h^2 + 4 h^3 + Integrate[Exp[p], p] + D[Sin[m]^Exp[f], m]] (* {d, f, h, ...


2

Go to Notebooks->Notebook's Default Context and select Unique to this notebook: Now, could you possibly use more reasonable capitalization and punctuation in your questions?


2

You can try the existance statement: Reduce[ Exists[{#2, #3}, a == b + c && a >= 2 && b <= 10 && c == 5 ], #1] & @@ RotateLeft[{a, b, c}, #] & /@ Range[0, 2] {2 <= a <= 15, -3 <= b <= 10, c == 5}


1

Perhaps what you are looking for is as simple as vars[expr_] := DeleteDuplicates@Cases[expr, _Symbol, \[Infinity]] vars[1 + y^2 + Sin[x] + Cos[x]] {y, x} Probably there are expressions on which this will fail, but it might handle those you are interested in.


1

Some additional details on $Input. The Mathematica documentation states that $Input is bound to the name of the stream from which the loading file is being read. But what is that stream name? It appears to be whatever string Get, (<<), or Needs receive as their first argument. To test this hypothesis, I made a .m file with the following contents and ...


1

You are not using the functions correctly In[9]:= DateString[] Out[9]= "Tue 30 Apr 2013 09:37:20" while In[10]:= DateString[TimeZone -> 0] Out[10]= "Tue 30 Apr 2013 07:37:26" and In[33]:= AstronomicalData["Sun", {"NextRiseTime", {2012, 10, 8, 6, 0, 0}}, TimeZone -> 1] Out[33]= {2012, 10, 8, 6, 35, 31.7528} In[34]:= AstronomicalData["Sun", ...


1

As the Locale & Internalization guide page says $TimeZone is resettable. If the developers would foresee adverse effects I guess they wouldn't have documented it in this way. The only problem that I can see is that you have to take care that your system time is also set to GMT, otherwise real-time calculations (e.g., elevation of the sun as seen in ...



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