Tagged Questions
11
votes
3answers
204 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
90 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
308 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
322 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
216 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
113 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
212 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
290 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
270 views
4
votes
2answers
186 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
191 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
341 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
381 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
134 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 ...