51,744 reputation
281206
bio website uoregon.edu/~noeckel
location
age
visits member for 3 years, 2 months
seen 5 hours ago

Mar
26
comment Why am I getting a conditional output when importing the Dirac Equation to Mathematica?
I don't know what your goal is, but you can see what happens when you don't add the Hold attribute. The evaluation will give nonsense unless you're much more explicit in the LaTeX input.
Mar
26
comment Why am I getting a conditional output when importing the Dirac Equation to Mathematica?
The ultimate problem is what I mentioned in my first comment: the goal of ToExpression is to create a Mathematica expression, and what you're getting is an expression that doesn't actually correspond to the Dirac equation mathematically, even if it visually looks like your LaTeX input. And that doesn't depend on $\hbar$ being there or not. It's the symbols $\mu$ in super and subscripts. Their meaning is lost.
Mar
26
comment Why am I getting a conditional output when importing the Dirac Equation to Mathematica?
Yes to both 1) and 2). And hbar is indeed not properly imported. As I say in the linked answer, the LaTeX import abilities are limited. It's usually best to write equations directly in Mathematica than to import them from LaTeX. It's sad but true. Maybe one can say something beyond this if you explain what you want to do with the imported formula.
Mar
25
comment Precision of starting values in FindMinimum
It's not a precision problem, I think. Just a shot in the dark: try specifying two starting numbers for k1Opt and k2Opt each, to bracket the search region. This will also lead to a different search algorithm being used. But if you want the question to remain open and get an actual answer, you have to specify the unknown functions.
Mar
25
comment question of nested for loops with 3 variables
Homework help is not the purpose of this site.
Mar
25
comment operating lists
Look up Grid in the documentation.
Mar
24
comment Setting Marker Line widths in Legend
I get a nice plot using the code in my answer here and doing Show[autoLegend[p,{Style["0.025mm",14],Style["0.05mm",14],Style["0.075mm",14],S‌​tyle["0.1mm",14],Style["0.25mm",14],Style["0.5mm",14],Style["0.75mm",14],Style["1‌​.0mm",14]},Alignment->{.5,.5}], ImageSize->Large] where I called your plot p, re-done without all the Legend... commands. You don't need the PlotLegend package if you use my functions.
Mar
24
comment Setting Marker Line widths in Legend
What Mathematica version are you using? The PlotLegends package is outdated.
Mar
24
comment Flatten nested lists
I didn't really intend to make you delete the other solution - it was fun to look at...
Mar
24
comment Flatten nested lists
@ShutaoTang Yes, but your Slot based approach wouldn't work with my lis2. Anyway, at this point the OP certainly has a lot of methods to choose from...
Mar
24
comment Flatten nested lists
@Mr.Wizard Yes, the bottom-up approach can only work if the leafs are atomic - I guess maybe one could ensure that using Block if the entries are at least named by symbols that can be blocked.
Mar
24
comment Flatten nested lists
@Mr.Wizard Oh, I know what happened: I was on MMA version 8, and tested my lis2 with your method. It errored out, but now I see it works in version 10. In version 8, your answer doesn't even work with the original lis... It's because MapAt in version 8 doesn't seem to accept position specification All. That change isn't mentioned in the version-10 documentation.
Mar
23
comment Flatten nested lists
If anyone looks at the edit history, they will get dizzy... I could still annoy you with this example, though: lis = {a, {{{b}, {c, d, e}}, {{f}, {g, h, i}, {x}}}, b}; where I added an {x} together with the {f}. Your first approach works, the second still doesn't.
Mar
23
comment Flatten nested lists
Same comment here as for @Mr.Wizard.
Mar
23
comment Flatten nested lists
This works for the example, but not for lis = {a, {{{b}, {c, d, e}}, {{f}, {g, h, i}}}, b}. I upvoted anyway, since the question doesn't specify what generalizations are desirable.
Mar
23
comment Flatten nested lists
Your last one is probably a quote from the pirate in Asterix&Obelix, right? But it doesn't work on lis = {a, {{{b}, {c, d, e}}, {{f}, {g, h, i}}}, b}.
Mar
23
comment Collecting and simplifying polynomials
You can solve this by using my answer to How to keep Collect[] result in order?. I think this is a duplicate. Also, the other answers in the linked question, using PolynomialForm, don't seem to work for this example. But I tried my approach, and it does work.
Mar
22
comment Plot appears squeezed
Use something like AspectRatio -> 1.
Mar
22
comment Block anti-diagonalize a square matrix?
One would first have to investigate what constitutes a "best anti-diagonal form" as stated in the question. Then one would have to check whether it is unique in some sense to be defined. Without that knowledge, it's not at the level of a Mathematica question, but a math question.
Mar
22
comment How can I create a shortcut for a command in Mathematica?
Maybe the edited answer will help.