109k views

### What are the most common pitfalls awaiting new users?

As you may already know, Mathematica is a wonderful piece of software. However, it has a few characteristics that tend to confuse new (and sometimes not-so-new) users. That can be clearly seen from ...
71 views

141k views

### Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
8k views

### Can one identify the design patterns of Mathematica?

... or are they unnecessary in such a high-level language? I've been thinking about programming style, coding standards and the like quite a bit lately, the result of my current work on a mixed .Net/...
336 views

### Why is D[a[b][c],a[b]] equal to 1[c]?

Background: I had the same issue as described here, and I went to extend Mr.Wizard’s code such that a[b][c] would be shown as $a_b^c$. Issue: To my surprise, ...
382 views

### VectorPlot3D of the Electric Field E as Determined from the Potential V

I am new to Mathematica and I am trying to create the electric field $F$ from the electric potential $V$ (using arbitrary distances) and then plot the subsequent vector graph to show that the electric ...
63 views

### How do we input powers of indexed variables?

I have tried (a[i])^2 and alternatively (a^2)[i] Apparently both seem to work, but I was wondering what was the right way ...
284 views

### How do I get Mathematica to recognize this simplification? (ReplaceAll pattern rule)

I want Mathematica to understand this $$(\sum_{k=0}^n a_k)(\sum_{j=0}^n b_j) = (\sum_{k=0}^n \sum_{j=0}^n a_k b_j)$$ I have tried this ...
1k views

### Compute the half width and full width at half maximum (HWHM / FWHM) of a mathematical expression

I have managed to compute the half width at half maximum (HWHM) and full width at half maximum (FWHM) of a sinc function through the code below. ...
77 views

### How to recall set variables in simple Product[] and Sum[] functions?

I'm new to Mathematica but have been trying to write a code that will define new variables based off of variables preset by a user. I'm allowing them to define a variable ...
156 views

### table parametric plot ode

I have a series of ODEs I'd like to plot (a double pendulum specifically) Where I'm comparing my own "handwritten" ODE to that of System modelers solutions. This is mostly an exercise to ensure the ...
954 views

### Finding Anagrams of given length from DictionaryLookup

What I'm trying to find are the 4 letter words in the Mathematica dictionary that have the most anagrams and the amount of anagrams these have each. But I can't seem to find all the 4 letter words in ...
359 views

### Why is the first argument of the SetDelayed evaluated?

In[1]: f=g; In[2]: SetDelayed[f[x_],x^2]; In[3]: ?f Globalf f=g In[4]: ?g Globalg g[x_]:=x^2 However, SetDelayed has the ...
229 views

### WL terminology: evaluate, call, invoke, use, etc

A WL (Mma) program is a sequence of expressions to be evaluated, which generally involves applying commands and functions to actual arguments. What is the accepted terminology for what I think of as ...
472 views

### Plot 3D doesn't show anything

Good Evening, I defined a function which is composed of other several functions. Mathematica compiles well but I can't get a plot and I do not understand way. Can anyone help me with the code and ...
264 views

### Define scalar quantity that squares to 1?

My equations contain different cases which differ only by some signs. So in order to work with all cases simultaneously, I introduce a placeholder for a sign: s[x] ...
143 views

### Why doesn't CloudDeploy work in my desktop

I have difficulty in making CloudDeploy in my desktop. Does anyone know why ? Thanks Here is what I see: Here is the code if someone would like to test ...
279 views

### How to map a function over a dimension in a matrix? [closed]

I have a function g[x,r] yielding a 3x1 vector, where x is a ...
123 views

### Custom opaque operator with custom axioms?

Is there any way to define a custom opaque operator/function in Mathematica that satisfies custom axioms, so that the Mathematica engine can perform simplifications using those axioms? For example, ...
155 views

### How to define a function whose argument is in the replace list?

As a simplified example: In[780]:= f[x_] := a /. {a -> x}; f[1] Out[781]= 1 This yields the correct result. But ...
313 views

### Apply ToString to a list of variables [duplicate]

I have data1 = {1, 1}; data2 = {2, 2}; datalist = {data1, data2}; I want to create a string list based on the variable names inside ...
2k views

### How do you set attributes on SubValues?

SubValues, as discussed in a previous question, are declared as follows ...
1k views

### Difference between variables and functions

Forgive me if this question is very basic; I've learned Mathematica mostly by example. In most programming languages, there is a clear distinction between variables and functions: variables hold ...
239 views

### I want to compute the derivative of Black and Scholes option

Good evening to everybody, my question is about computing the derivative of a Black and Scholes option and to draw it. My code is ...
39 views

...
94 views

### Does Mathematica have a method for achieving the same goals that Aspect Oriented Programming does?

I imagine that this question has been asked before, yet I'm not able to find an answer using the form of the question I believe might be asked. Is there a mechanism for duplicating the ...
2k views

### Defining an integer-valued function on an integer domain

This should be an easy question! I want to define a function with domain = the 12 integers {1,12}, with the values f[1]=31, <...
58 views

### How to erase definition introduced by using Set instead of Equal in Solve [duplicate]

When trying to solve a set of equations, I made a mistake by using = instead of ==. Now when I fixed the mistake, the equation ...
887 views

### Generating assignments and transforming code inside held forms when generating code

I have been playing with slightly above trivial code manipulations in Mathematica. I thought Mathematica would be great for this kind of work because of rule replacement and expression manipulation, ...
8k views

### Nested If statements

When I do this: Apply[(If[#2 == what, "yay", If[#2 == whoops, "nay"]]) &, {-5, what}] I get: yay But when I do this: <...
518 views

### NDSolve memory usage [closed]

I am trying to solve numerically a system of linear ODEs with some quickly varying driving functions. The basic command is: ...
281 views

### Syntax f[x_][y_]

Need to understand the principle of the distinction between f[x_,y_] and f[x_][y_] It seems also that z[x_, y_][a_, b_, c_][α_, β_] := a (x + y)^b + c/(α-β) ...
160 views

### Clearing Problem with DSolve [duplicate]

Consider: This is a classic mistake (using a single equal sign) that has been discussed on Mathematica Stack Exchange before. I know that Clear[Derivative] will cure the problem. However, consider ...
66 views

### How to use the symbols in SystemPrivate? [duplicate]

Looking at Names["SystemPrivate*"] gives: I'd really like to use and look at the code for some of these symbols, e.g. ...
86 views

### How can PowerExpand be made to evaluate the ArcTan form that takes two arguments?

Consider c = Cos[phi]; s = Sin[phi]; ArcTan[c, s] // PowerExpand ArcTan[s/c] // PowerExpand which yields ...
51 views

### Creating an indexed set of functions with the indices in the function names [duplicate]

As the titles describes, I want to create a list of functions like the following, where the indices are not in the argument slots: ...
244 views

### Measuring Temp on a cubical using heat equation with Neumann and Dirichlet boundary conditions

I'm trying to solve 3D heat equation to understand how the temperature varies with time on cubical. i have mixed boundary conditions: Dirichlet on the bottom surface (constant Temp) Neumann on all the ...
114 views

### Pattern for a function of say 2 variables [closed]

How can I specify a pattern for an expression f for which say f[x,y] returns a value, ie is defined as a function taking two ...
154 views

### NDeigensystem returns error due to mesh discretization when calculating vibrations of a cantilever

There was an transcription error in the code I provided in a previous post: https://mathematica.stackexchange.com/questions/105713/ndeigensystem-returns-complex-non-hermitian-error-for-the-...