Tagged Questions
12
votes
3answers
221 views
Accessing list elements by name
First, a bit of a long introduction to my problem:
I only have a few weeks of Mathematica experience. I am creating a mathematica application that calculates some material properties of steel based ...
0
votes
1answer
95 views
Stubborn Output: Returning the value from the wrong subroutine [closed]
Problem:
I wanted to program these 2 subroutines shown below and each was to return a function expression:
AnIntegrand[n0_] :=
Module[{n = N[n0]},
Return[6 t^2 Cos[2*n*t*Pi]];];
...
10
votes
3answers
337 views
How to modify function argument?
Usually in programming languages, function arguments are normal local variables, which can be modified.
Is this not true in Mathematica?
...
6
votes
4answers
343 views
Pure Functions with Lists as arguments
Assuming I have two function:
example 1:
add[{x_, y_, z_}] := x + y - z
add[{1, 3, 5}]
If use pure function,I know I can write it as :
...
0
votes
2answers
91 views
How to obtain a smaller-sized output from Solve
I am solving a system of 15 simultaneous linear equations using Solve. On running the code, I get a message saying "A very large output was generated" with options ...
0
votes
1answer
266 views
Loops and subroutines [duplicate]
Possible Duplicate:
Alternatives to procedural loops and iterating over lists in Mathematica
I am new to Mathematica and not familiar with functional programming. In particular, I have no ...
1
vote
1answer
115 views
Problem with function as an argument
I want to write a function like the following:
s[u_, v_, x_, val_] := u[val]/NIntegrate[u'[x] v[x] + u'[x] v'[x], {x, 0, 1}]
So I can evaluate something like
...
2
votes
1answer
217 views
Cournot Equilibrium
I'm trying to determine reaction functions of a Cournot equilibrium for $n$ firms using the same optimal condition, using the fixed point method.
This is the method I'm using:
...
2
votes
5answers
294 views
How to leave function unevaluated programmatically?
Is it possible to write a function in such manner, that it can be either evaluated or left unevaluated?
This is a general question. Sample below is just a sample. No need to find solution for this ...
4
votes
3answers
277 views
4
votes
2answers
190 views
How can I use Max[] in a function that is passed a list not find the max of the list
For most functions in Mathematica, passing them a list will call the function on each element of the list. For example:
...
4
votes
1answer
195 views
How to organize and run functions?
I am very new to Mathematica. I thought I would try it out for my first assignment in my computer science class. Until now I have only used C-base languages including C#, Java, Objective-C, and ...
6
votes
2answers
378 views
Pass function or formula as function parameter
I can write either
Integrate[x^2, {x,0,3}]
or
f[x_] = x^2
Integrate[f[x],{x,0,3}]
and get the same computation. Suppose I ...
9
votes
1answer
396 views
(Non-Convex) Polygon Union and Intersection Functions [duplicate]
Possible Duplicate:
Intersecting graphics
Back in 2009 I posted a question in comp.soft-sys.math.mathematica looking for a function which generates the union of two (not necessarily convex) ...
2
votes
3answers
136 views
Using Nest inside NestList
I need results like this:
{Cos[Cos[x]], Sin[Cos[Cos[x]]],Cos[Cos[Sin[Cos[Cos[x]]]]],
Sin[Cos[Cos[Sin[Cos[Cos[x]]]]]], ... }
I've tried to use ...
13
votes
3answers
185 views
How to keep some of the results of the NestList
I'm using some iterative arithmetics to calculate wave propagation with the help of NestList. I have to use a small step size for iteration to guarantee the accuracy, which lead to too much data (e.g, ...
8
votes
1answer
375 views
GeoDirection and GeoDistance Memory Leaks: How to Recover the Memory?
The functions GeoDirection and GeoDistance have memory leaks. To see this, run the example functions below and watch as the Physical Memory Available in the Windows Task Manager, Performance tab, ...
6
votes
2answers
195 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 ...
39
votes
2answers
775 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 ...
