Questions on correct (or improved) formulation of Mathematica code to achieve particular results. Use this tag (not "symbol") for questions about all those odd @@ /@ # & and ~ characters.

learn more… | top users | synonyms

6
votes
0answers
108 views

Design considerations behind `O` (a.k.a. BigOh, a.k.a. Landau Order)

This works without any warnings: O[Log[x]]. This raises a warning: O[x^2]. I have a few questions around this: Why is it a ...
4
votes
0answers
120 views

Syntax error for optional pattern, but only in debugger

This expression (explained here by Leonid) evaluates fine unless Evaluation->Debugger is enabled: h[x : (_Integer) : 1] := x Syntax::sntxf: "x:" cannot be ...
4
votes
0answers
81 views

Is there a way to check whether two notebooks share the same variables?

When I code in Mathematica, I often re-use code from old notebooks which fulfilled a specific purpose; for example, one testing for soft matches in strings, or one that identifies outliers on a graph ...
4
votes
0answers
109 views

Proper treatment of roots and powers in Series?

I have the following problem in Mathematica 9 on Linux. I let Mathematica compute the Series expansion: ...
3
votes
0answers
153 views

Do any mainstream text editors support Wolfram Language syntax for highlighting?

Syntax Highlighting for Mathematica on a Blog There is the above, but I'm not terribly excited to install rogue packages. For example on github, I share lots of Mathematica code. I see no way to ...
2
votes
0answers
38 views

Syntax for FrontEnd`SelectionSetStyle

I know FrontEnd`SelectionSetStyle is undocumented, but its name suggests it does what I need. What is its syntax? I have already tried several variations of the ...
2
votes
0answers
205 views

NonLinearModelFit with Two Dimensional List of Weights

I'm currently trying to fit Planck's law (B[λ, T]) to measurements, thereby determining Planck's constant. I have a list of triplets containing wavelength, ...
2
votes
0answers
254 views

Conditional statements in intial conditions?

This is potentially a daft question, but I thought I'd ask it; I have some material free to diffuse in a boundary between rn and ro; I've been able to get it working nicely for neumann type boundary ...
2
votes
0answers
183 views

Syntax colouring when using Symbolize

I need to use symbols with suffixes in order to make my code readable in relation to the Eurocodes. To do this I use Symbolize from the ...
1
vote
0answers
29 views

CreateDialog opening two windows instead of one

I'm having issues working with code from Mathematica 9.0.1 since I've updated to 10.0.0. My previous code involved using packages to set functions, and then those packages were loaded and the ...
1
vote
0answers
81 views

SyntaxForm not correctly parsed by FrontEnd

When using TagBox with SyntaxForm, I noticed sometimes it is not well parsed by the ...
1
vote
0answers
33 views

Why is `Cell` > `Convert To` > `InputForm` not invertible?

I sometimes post code to PhysicsSE, and I usually convert it to InputForm first before posting, in order to avoid pages and pages of ...
1
vote
0answers
71 views

Decapitating “explicit” and “implicit” heads

This is a follow up to this question. So far, I named "explicit" heads to those that appear explicitly in the expression. For example, f[x] has an explicit head. I ...
1
vote
0answers
36 views

Matching Root[…] objects with patterns, unexpected hidden argument

I needed to write patterns that could distinguish between arbitrary-function and polynomial forms of Root objects, for example, ...
1
vote
0answers
106 views

Defining an operator

Let s be a positive integer and let DifferenceDelta be this function with step = 1. Define ...
0
votes
0answers
3 views

Update variable with incrementing value

I would like to have a vector v defined as v1 = A[[1]], v2 = A[[2]], etc. incrementing from 1 - 10 that is then used in a for loop. Currently, my code only computes e for v1 (giving e1), but I would ...
0
votes
0answers
43 views

Resolving initial / boundary condition conflicts ?

This is likely very simple, but I often run into trouble with inconsistent boundary conditions for PDEs; While I know Mathematica sometimes produces "false" errors for spatial derivative conditions, ...
0
votes
0answers
27 views

How to change FormatType for output and Syntax error separately?

For some demand, I am using MathMLForm for all output SetOptions["stdout", FormatType -> MathMLForm] But this effect the syntax error format as well.(it's ...
0
votes
0answers
44 views

TableDirection in TableForm

I got confused about what does "the outermost dimension" and "the first dimension" mean in the document I snipped. Does it mean row or column?
0
votes
0answers
52 views

g00 (metric tensor) not explicitly evaluated in FeynCalc

I am learning Mathematica and FeynCalc by doing some basic cross section calculations. I have an issue with trace calculations: When I plug in for instance the ...
0
votes
0answers
84 views

Why is my answer being displayed with “Subscript^(0,1)[a,b]”?

I type in my equations using ctrl+- to make it look nice and my answer outputs in "Subscript^(0,1)[a,b]" form? What is going on? In the answer some bits are displayed with the actual subscripts and ...
0
votes
0answers
149 views

Assigning numerical values to constants results in complex coefficients in Equations of Motion

I am using Mathematica to get the Equations of Motion (EOM) for a mechanical system (using Lagrangian Mechanics). While I get the EOM in symbolic form, on introducing the following code for assigning ...