6
votes
0answers
88 views

Exporting a compiled function for later use

I compiled a function then used it in NMinimize. The computation took 19 seconds. Then, I exported this compiled function and restarted MMA and imported this ...
0
votes
0answers
54 views

Making a list of terms ordered by product order

I have some expressions f,g,h that are elements of a symmetric tensor algebra. The expressions are generated by a basis ...
5
votes
3answers
202 views

difficulty abstracting the OptionValue pattern

I am building lots of functions that use Options and OptionValue and wanted to reduce the redundancy in the expressions that ...
0
votes
0answers
40 views

Simplifying Products In Mathematica [on hold]

I have, amoungst many others, the function: Kbox[n_, r_] = ((n - r)*r)!/ Product[Product[(r - i + 1) + (n - r - j + 1) - 1, {i, 1, r}], {j, 1, n - r}] ...
6
votes
5answers
272 views

Find patterns in a list

again, I have a list like this: ...
3
votes
1answer
105 views

Bad numerical approximations

I'm trying to do some calculations here, but for some reason Mathematica starts using numerical approximations that are no good for my work. Specifically: ...
7
votes
0answers
30 views

Proper EdgeForm setting so boundary appears entirely within shape

I have two neighboring (complicated) polygons that I want to be displayed with thick boundaries, however the two shapes border one another, and as EdgeForm places the line centered upon the polygon's ...
2
votes
1answer
93 views

FindFit with parameters which are simultaneously in initial conditions

I have RLC circuit. I would like to find R and L by using FindFit, but L is in initial condition and I have problem with it. Could you help me ? ...
1
vote
1answer
45 views

How to factorise a variable out of an indefinite sum?

(I should start by saying I'm a total beginner with Mathematica, so if the answer needs code I'll need it spelled out quite clearly, the learning curve for this is proving steep!) Basically what I am ...
1
vote
1answer
24 views

Dealing with dynamic tables [on hold]

Making dynamic vector variables is difficult in Mathematica. For example: X=Table[ToExpression["x" <> ToString@i], {i, 0,4}]; X[[2]] Yields x1. However, if ...
5
votes
3answers
115 views

Creating Correlation Table (and Working) With Missing Data

I am working with data that contains missing values (I have several variables (across the columns) and several observations (across the rows) in an excel spreadsheet). Example of the data structure: ...
2
votes
0answers
35 views

How to apply Gaussian kernel to smooth density of points on 2D (algorithmically) [migrated]

I have a set of points on a 2D surface and need to build a heatmap. However, I also need to smooth out the density/distribution by applying some sort of kernel (Gaussian kernel, for example). I Know ...
3
votes
0answers
43 views

Bandpassing EEG's using Mathematica's Bandpass Function

Let's say we have an EEG signal approximated using a fractional Brownian motion: ...
2
votes
2answers
95 views

Plot help with axes coordinates

Plot[{4 - 2 y, (5 + y)/3}, {y, 1, 10}] How do I make Mathematica tell me the coordinates for cuts with the y-axis, other than just looking at it?
2
votes
2answers
62 views

Table with dynamic iterator

I would like to make a Table whose iterator has a dynamically updated endpoint, i.e. Table[i,{i,1,Dynamic[n]}] Is this possible? Here is the context: ...
10
votes
3answers
86 views

How to limit number of user-defined messages issued per evaluation

I have written code such that if it runs into a particular function, a warning message is issued. However, it is common for the program to call this function several times in a single evaluation, but ...
3
votes
1answer
72 views

Use Style on list elements

I have a list like this: list = {0, 0, 0, 1, 1, 1} I want to color all the 0's in red, but I dont want to count through all the elements, like in my solutions, ...
4
votes
4answers
211 views

implement the ZOH in mathematica [on hold]

well I'm trying to implement the ZOH in Mathematica, but I can't. Take a look, this is my script: ...
-1
votes
0answers
59 views

Trying to solve a trig identity [migrated]

Given $\sin 2x+\sin x=1$, find the value of $\cos 2x+\cos 4x$. I know $\cos 2x+\cos 4x \implies 1-2\sin^2x+1-2\sin^22x$, but didn't get the answer.
2
votes
1answer
42 views

How to pick out terms in a linear equation with a positive coefficient?

Basically I have a really large output which looks like a long linear equation $AAA-BAA-CAA+DAA+...-ZZZ$ And I only am concerned about those terms that have a positive coefficient (i.e. a plus in ...
7
votes
2answers
258 views

When must I use the Return function?

In a comment to my answer to this question, QuantumDot asks, "Where can I find more information on when I must use the 'Return' function?". I found this too deep a question to be answered by leaving a ...
3
votes
1answer
67 views

What is the order of execution of Animate?

I used to think the execution order of Animate is the same as For until I find: ...
3
votes
2answers
88 views

Trying to solve simultaneous equations based on format found on official website [closed]

$\def\1{x_1}\def\2{x_2}\def\3{x_3}\def\f{f(\1,\2,\3)}\def\bs{\bigskip}\def\b{\begin{pmatrix}}\def\e{ ...
3
votes
1answer
79 views

How to combine Plot and GeoGraphics?

I want to combine this map as "background" of this combined plot. How can I do it? The documentation doesn't show any similar demonstration. ...
7
votes
3answers
155 views

Change appearance of ConvexHullMesh

I'm struggling to understand the behaviour of ConvexHullMesh (or rather the non-behaviour). I have a polynom p ...
4
votes
2answers
103 views

Adding a thick curve to a regionplot

Suppose we have the following simple RegionPlot: ...
0
votes
0answers
85 views

How do I set up conditions at infinity?

I having trouble with this equation: $$ -\frac{(2 m \text{U0}) \Psi (\rho ,z) \left(1-e^{-\text{} \left(\frac{z}{d}\right)^2-\left(\frac{2 \rho -(r+R)}{R-r}\right)^2}\right)}{h^2}+\frac{\partial ...
6
votes
2answers
187 views

How to get rid of the blank areas around alphabetical images?

I attempt to test the mean graylevels of the alphabets "W" and "Z". I used the following code to create the images of them. ...
4
votes
0answers
88 views

Is there a relatively quick way to solve my integer-valued equation?

This is a very simple problem. It can be solved by nested Forloops that exhaustively test every possible case, throwing out all non-solutions. Find all the ...
4
votes
1answer
147 views

How to find the integer solution number of a linear system with inequalities?

I have the following system with mixed equality and inequalities defined as: ...
6
votes
3answers
804 views

How to get the mean color of an artwork?

I got a piece of artwork in dimension of 20x20 pixels. I attempted to divide it into a 5x5 array of elements each of a smaller size of 4x4 pixels, and would like to find the mean color of the ...
3
votes
1answer
72 views

How to combine objects from different .obj files?

I got a screw .obj model with the head diameter of 2cm, and a board .obj model of 10cmx10cmx4cm in dimension. I would like the ...
0
votes
2answers
80 views

Higher order eigenvalue problem [closed]

Does anybody know some ideas, references or something like these to solve such third order eigenvalue problem using Mathematica: $\Psi'''(x) + (1 - 4x^2) \Psi'(x) - 6x\Psi(x) = E \Psi(x)$
4
votes
1answer
50 views

Tools for Importing/working with SEED seismographic data in Mathematica?

Do you know if exist a library or a package in order to import and work with SEED Seismographic data in Mathematica?
5
votes
3answers
140 views

Prevent iterator name from being confused with symbol passed into function body

I have a massive amount of code with lots of Table and Sum inside a Module. Each with their ...
4
votes
1answer
71 views

Mathematica 10 crashes when kernel is quit from MenuItem

I'm actively developing a large codebase that I load every time I use Mathematica. I frequently quit my kernel and reload the codebase to incorporate new changes. I've created a custom menu by editing ...
1
vote
1answer
88 views

Under what conditions does Mathematica give a natural antiderivative when integrating?

Natural antiderivative is defined as follows, using Fourier transform: $$f^{(-1)}(x)=\frac{i}{2\pi}\int_{-\infty}^{+\infty} \frac{e^{- i \omega x}}{\omega} \int_{-\infty}^{+\infty}f(t)e^{i\omega t}dt ...
10
votes
4answers
248 views

What is the correct way to use specific rule for specific pattern match when parsing an expression?

update: Thanks for the answers below. But I noticed they do not handle the following special cases: lis=1 and lis=z , ...
0
votes
0answers
55 views

How to find roots of a general 4th order polynomial equation [closed]

I have a fourth degree equation with 3<b<4 (if that helps): ...
2
votes
0answers
49 views

Error when using EquationTrekker

I just got to know EquationTrakker because I need to do phase graphs for my classes. When I load it ...
0
votes
0answers
33 views

Replacement with list element works, but yields error [closed]

random = {42}; c[1] /. c[i_] -> random[[i]] The above yields 42 as expected, but also gives this error: ...
8
votes
2answers
167 views

Keep Mathematica from simplifying functions with a specified Head

I want to run Simplify and/or Refine on various expressions, but keep it from touching anything that contains a specific ...
4
votes
1answer
81 views

Optimizing a function containing a complex exponential

I've noticed the following significant different in performance for different formulations of the same function: ...
6
votes
3answers
135 views

Isolating string characters

I have the following string: ...
7
votes
0answers
116 views

Can code optimize code?

Are there functions, programs or packages that deal with optimizing mathematica code i.e. re-writing ineffecive or convoluted code. -This question has haunted me since I joined SE. The background for ...
0
votes
1answer
39 views

Ivar error with Fit inside Plot

I'm trying to plot this Plot[Fit[med,{1,x},x],{x,0,10}] Why this doesn't work? I find out that if I do ...
0
votes
0answers
53 views

What methods does Solve use?

Could you tell me which method that Solve applies to solve linear and polynomials equations?
5
votes
1answer
94 views
7
votes
1answer
163 views

How can I only draw outer common tangent to two circles?

I have code worked for drawing common tangent lines to two circles(http://en.wikipedia.org/wiki/Tangent_lines_to_circles), now I want to delete the inner common tangent lines, how? ...
7
votes
1answer
129 views

How to find the positive region of this function?

I'm new-ish to Mathematica and I'm using it to learn the basics of derivative trading (for fun not for trading!). I've defined a simple function to calculate the pay off of a trading on a call. I have ...

15 30 50 per page