10
votes
2answers
195 views

Why doesn't a Composition[] hold its arguments and what can be done about it?

Now that Composition (also RightComposition) has shorthand syntax I am more inclined to use it, however what I feel should be ...
0
votes
1answer
44 views

Combining functions - is this a case for Piecewise?

I have a function $Eb1$ which was the subject of a question I asked recently - you can see it here on stack exchange. Now, in that example it's specified between a boundary $r_n$ and $r_o$ where $r_o ...
0
votes
1answer
77 views

Getting “Null” output from package?

I have a script written to test a package as follows: ...
1
vote
1answer
69 views

Sort lists of vertices {indegrees, outdegrees} by indegree

in = VertexInDegree[F]; out = VertexOutDegree[F]; I want both in and out to be ordered by in. Example: graph has nodes a,b,c with indegrees 1,2,0 and outdegrees ...
2
votes
1answer
107 views

Matrix exponential MatrixExp[] vs Sum[MatrixPower[]] doesn't match?

I might be an idiot, but I cannot get the manual expansion of e^At to match the MatrixExp[A t] result. For example, I have the following: ...
0
votes
3answers
74 views

Half kth term if n is even and k=n/2?

I am trying to write a function which will perform the equation in the attached image. So far, I have: ...
1
vote
2answers
125 views

How to evaluate Modules in a notebook from another notebook?

I would like to create a notebook populated with several modules and be able to evaluate these modules by running a separate notebook. I have attempted several uses of the ...
0
votes
1answer
78 views

Normalize equation in NDSolve?

I have numerically solved and plotted the solution to the Mathieu equation using NDSolve successfully, as below: ...
0
votes
1answer
83 views

Populating an array with outputs of a function [closed]

I have searched, but didn't find much help on my issue. I have an optical physics problem that I'm working on .. ...
5
votes
2answers
363 views

Multiply each element of an array by another array?

I would like to multiply an array by each element of another array, and am having a lot of trouble finding a built-in or automated method of doing. Here is an example of what I'd like to achieve: ...
0
votes
0answers
41 views

Using Table[ ] vs using Do[Append [ ] ] [duplicate]

Is it generally better/faster to use the Table function over using Do[Append []]? For example, I have this piece of code: ...
0
votes
1answer
73 views

How to write series of Do[ ]'s with a single Table[ ]?

Edited to provide more information (sorry I don't know how to format matrices here) I would like to replace: m = 4; ...
0
votes
2answers
119 views

How to display output as symbols?

I have this piece of code which populates a matrix following different rules depending on row and column number: ...
0
votes
1answer
162 views

Please explain this code (contains Append, Do, Coefficient)

I am a graduate student using a past student's Mathematica program. Will someone please explain to me exactly what this piece of code is doing? Specifically the ...
0
votes
0answers
20 views

Incorporating Built-In Function Options/Parameters into Shorthand [duplicate]

Shorthand syntax provides an alternate way to apply functions and, in many cases, improves readability. A simple example would be ...
1
vote
0answers
69 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 ...
6
votes
3answers
416 views

Difference between @ and @@

I am confused by the commands @ and @@. From the documentation, I learnt that @@ is the ...
2
votes
2answers
217 views

Writing a function that returns a (usable) function

I am trying to create a function that returns Arnold's Cat Map of size n iterated k times. I can get something out of the Function command, but I can't figure out ...
4
votes
1answer
440 views

What do the hashtags represent in the result of Solve, and how should I use them? [duplicate]

There is a function that I'm trying to get the inverse of. My function is a simple polynomial: Tn[T_] := 4/9 T^3/Tc^2 + 5/9 T Now I tried to find ...
29
votes
5answers
880 views

Why is there no PositionFunction in Mathematica?

Too often I have seen the programs of inexperienced users greatly slowed by using Position in an iterative fashion, when far faster would have been to compute a ...
3
votes
2answers
311 views

Why does the first derivative of a piecewise continuous function have discontinuities?

I have this piecewise continuous function which is also continuously differentiable over time : ...
8
votes
1answer
427 views

What is the difference between prefix/postfix notations and map?

I am new to Mathematica and just experimenting with the different programming constructs. I have been looking at Map and how to evaluate a function for a list of ...
10
votes
2answers
272 views

Functions that remember their values

Can someone explain what is going on with the following ... func[y_] := func[y] = (Print["Hello world !!!"];) func[1] Hello world !!! ...
28
votes
3answers
622 views

Parentheses in pure functions: # & vs. ( # &)

I've been using Mathematica for years, and over time I have developed the habit of using: Select[data, (# == 1 &)] instead of ...
9
votes
1answer
798 views

What is the difference between Set and SetDelayed?

I have a problem with defining a function and most of time I get confused by Set or = and ...
5
votes
2answers
475 views

Evaluating an If condition to yield True/False

I would like to decide whether an option passed to my custom function has the value Automatic or something else. This is my attempt: ...
2
votes
3answers
432 views

Output of plots from within Do[ ] Command

I am wondering why the following does not plot the way it's written and exactly how does the Do[] function operate? I think I could be using it incorrectly. ...
6
votes
5answers
282 views

Is it possible to insert arguments into functions when they're used like Function@ or //Function?

Is it possible to insert arguments into functions when they're used like Function@ or //Function? Sometimes I need to do this, but then I have to return to the standard function usage: Function[] ...
10
votes
2answers
103 views

Functions in a different context are replaced with infix forms of their namesake in System`

So, in an attempt to help out Fabian with his question, I did what I often do, and created a new symbol in the Pillsy` package that I could play with. Since it was ...
7
votes
3answers
302 views

Why can't D[] be used in place here? [duplicate]

Possible Duplicate: General::ivar is not a valid variable when plotting - what actually causes this and how to avoid it? Beginner question: Why can't I use ...
7
votes
2answers
264 views

What's the purpose of the Unique function?

As the title says: What's the purpose of Unique? I understand that it generates some unique symbol, but when and for what is it to be used? Are there applications ...
51
votes
2answers
2k views

Flatten command: matrix as second argument

One thing I could never wrap my head around is how Flatten works when provided with a matrix as the second argument, and the Mathematica help isn't particularly ...