1
vote
0answers
66 views

GraphHighlightStyle with multiple datasets

I am trying to highlight several subgraphs of a graph using the following command: ...
0
votes
1answer
66 views

Removing numerically vanishing complex part within NDSolve

I am using functions that are only well-defined for real values (e.g. HeavisideTheta) within NDSolve. Internally ...
3
votes
1answer
71 views

Why does Thread FileDate give an error message?

I tried for example Thread[FileDate[FileNames["new*", "h:\\temp\\", 1]]] It gives FileDate::fstr: File specification ...
2
votes
2answers
198 views

Iteration problem

I am trying to write a simple program - perform f1 as long as t is smaller than 800. t is ...
0
votes
0answers
65 views

Formatting numbers for sending to the WolframAlpha[] function

I have a function that gives me a number of meters; how do I attach "meters" to it and send it to WolframAlpha? The function generating the result isn't a unit-aware calculation or anything: ...
24
votes
6answers
7k views

Even Fibonacci numbers

Today, I found the Euler Project. Problem #2 is Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: ...
5
votes
1answer
429 views
8
votes
3answers
458 views

What is wrong with my expression for compiling?

Following code was translated from a snippet matlab code. Without compiling it worked slowly. I want to compile it, but am getting a numerical error. How do I compile this in a correct way? ...
3
votes
2answers
164 views

String pattern matching & replacement

I would like to find all occurrences of a full stop "." followed by a capital letter in a string and have these replaced with a "; ". How do I do this in Mathematica? e.g. ...
0
votes
0answers
106 views

Manipulating local or external variable within NDSolve

I am wanting to save and use the value of a variable within NDSolve[] but without that variable being part of the equation itself. Code below (ODE for the Leaky ...
0
votes
0answers
107 views

Smoothing a function

NDsolve gives me a solution to a certain NL PDE. I want to evaluate the rate of exponential decay of the maxima of the solutions in time. So, I plot ...
10
votes
1answer
255 views

Parse website data that requires interaction with a form (POST)

I want to analyse Chilean elections data available in the official website. What I have returns the data for president (numbers are strings, to be parsed later). ...
19
votes
5answers
484 views

How to split list into disjoint lists?

I wonder if there is any simple way to split a list into its disjoint sublists, e.g. from list={{a,b},{e,f},{b,c},{c,d},{f,g,h}} get a result ...
0
votes
0answers
43 views

is there a way to speed up rule replace? [duplicate]

I am currently doing calculation with 7 parameters, each parameter set corresponding to a value. And I store the data in the format as a list of rule, like following ...
-2
votes
3answers
286 views

Plotting DSolve results

I am attempting to make a plot of the solution an ODE. I want to plot the solution using PolarPlot, x is the polar angle in ...
2
votes
2answers
226 views

import a list of replacement rules

I have a text file with a set of replacement rules, of the form x^3y^2 -> 4, xy^2 -> 2, ... for example. I'm having some issues trying to figure out ...
6
votes
2answers
339 views

NDSolve Plotting issue

I am trying to solve a system of ODEs with one extra boundary condition. ...
1
vote
1answer
89 views

Problem with importing a JCAMP-DX IR spectrum file

I wrote a little function to import JCAMP-DX electron ionization or mass spectral files from the NIST webbook web site (e.g. mass spectrum of hydrogen chloride at ...
-1
votes
3answers
1k views

How do I determine the maximum value for a polynomial, given a range of x values?

I need to determine the maximum value for y = a x^2 + b x + c, where I know the coefficients and the upper and lower x values. ...
3
votes
1answer
201 views

Making multiple sideways histograms/bell curves around temporal data

I don't quite remember what this type of plot is called, but here is the idea: I have some data which is indexed by time, and I want to look at the evolution of the distribution of that data as time ...
5
votes
1answer
212 views

Shortest polygonal path

I'd like to find the shortest distance between some points (every point must be visited), such as between these 3 points: ...
2
votes
2answers
255 views

Covariance of a P x M x N matrix

I have a stack of tiff files. When imported to Mathematica, they form a $P \times M \times N$ matrix, where $P$ is the number of single images in the stack, $M$ is the number of horizontal pixels and ...
0
votes
1answer
135 views

Fitting a function

I defined and evaluated a function Max2[t_?NumericQ] := Log[Abs[-1 + First[Maximize[sol1[[2]][x, t], 0 <= x <= L, x]]]]; Now, I expect this to be close to ...
25
votes
7answers
2k views

How to draw a spring?

I am new to Mathematica and have recently been exploring graphical animations. So I was experimenting with simple concepts in periodic motion and hence wondered how can I draw a simple spring? Is ...
0
votes
4answers
95 views

Seek a quick way to bring standard order back to original after Complement [duplicate]

the Complement gives result in standard order. But that's not what I want. I want it to keep the original order. say I have a list ...
2
votes
2answers
184 views

Limit of a complex function

Can someone show me how to find the limit of a complex function? Example: z1 = 3 + 4*I some_function[z] = z * z1 Set-up: ...
1
vote
1answer
754 views

Why do I get an error message when for this type of recursion?

When I type the following code: mus[] = 0; mus[x__] := First[List[x]] + mus[Rest[List[x]]] What one would think would happen is that if, ...
0
votes
1answer
155 views

Why the result by hand is different from the command “DSolve”?

Yesterday,I use the Mathematica to solve a Differential Equation by the command DSolve: DSolve[y''[x] + 2 y'[x] + 5 y[x] == x Cos[x], y[x], x] {{y[x] -> E^-x ...
8
votes
2answers
318 views

Impact Crater Simulation

I have been trying to model crater formation on a given planetary surface - $500\,\textrm{km}^2$. The locations of impacts are random, however, if an impact is within $30\,\textrm{km}$ of another, the ...
1
vote
1answer
167 views

Why is `NMinimize` trying to evaluate my function analytically instead of numerically?

I have been having some trouble with NMinimize. I am trying NMinimize[f[x], x] where f is ...
0
votes
1answer
200 views

Passing lists to functions in a manner that works like pass-by-reference in other languages?

Is it possible to use a list as a variable, i.e., to pass it by reference to a function? In particular, I have a two-dimensional array and a function to get one element specified by its position: ...
1
vote
1answer
239 views

General form of a linear transformation

Let $v_1 = \begin{bmatrix} 2 \\ -1 \end{bmatrix}$ and $v_2=\begin{bmatrix} 1 \\ -1 \end{bmatrix}$ and let $A= \begin{bmatrix} 3 & 2 \\ -2 & 1 \end{bmatrix}$ be a matrix for $T\colon \Bbb ...
0
votes
1answer
96 views

How can I find the derivative of a combinatorial expression? [closed]

I want to differentiate the following equation: n = (nchoosek)*p*(1 - p)^(n - k) After differentiating my result is: ...
1
vote
1answer
122 views

Connected components of a graph

I am trying to find the number of connected components of numerous named graphs within Combinatorica. The obvious answer seems to be: ...
2
votes
1answer
342 views

Find fit for complex function for smooth derivatives

I need to fit my data dropbox of the form {x,y} because I need the fit function for further derivative calculation. My derivative curve should be smooth. I tried ...
2
votes
2answers
144 views

Long run time for older code that ran fast in older versions

The following code block is in Trott's Guidebook for Programming. The associated notebook says that this and a few other routines ran in a matter of seconds. I killed it after half an hour. I am ...
0
votes
1answer
123 views

How to remove quotation marks from a generic InputField

I need to use an InputField with a generic dynamic variable (not restricted to be Number or String or whatsever) and I don't want to see the quotation marks in the case the input is a string. Here is ...
5
votes
7answers
418 views

How to find the longest matching sublists in a list

Given a list of 2D points, i.e. {p1, p2, ..., pn} the list may contain equal points, i.e. pi = pj. In this case it may also be true that a sublist of ...
1
vote
1answer
459 views

Solving a nonlinear system of recurrence equations

I am having two problems regarding Mathematica, and both of them are happening because it does not accept such inputs: ...
1
vote
1answer
135 views

Exporting a Table of Graphics into Individual Files [duplicate]

The command Table[Polt[Sin[k x],{x,1,10}],{k,1,30}] generates a list of graphics. I want to export each list item as an individual jpg file, named according to ...
1
vote
3answers
208 views

Getting an equation of particular curve

How can I get an equation of the similar shaped curve? I've tried to get it like y = a + c x^2 + d x^3: ...
1
vote
1answer
189 views

Problem with manipulation and plot

I want to make my function trace the hypotrochoid through one period of its motion and trying to change the color of the trace, color of the radius, and change the color of the dot on it so I can view ...
5
votes
1answer
99 views

Odd colourization for FourierParameters. UI bug?

The Mathematica UI colourizes the FourierParameters in the following ...
4
votes
1answer
125 views

Timing Total crashes kernel

Here is a simple test function test[n_] := Module[{i = 0}, Total[Nest[{++i, #}&, {0}, n], -1]] On my system V9.0.1 running OS X 10.6.8 and with a clean ...
2
votes
1answer
99 views

How to update package?

when I use `<< PhysicalConstants`` I get the message like :General::obspkg: PhysicalConstants is outdated... see the Compatibility Guide for more infomation... The question is how to update it? ...
2
votes
1answer
372 views

How to get the quantity of Physical constants?

I need to get the quantity of gravitational constant: QuantityMagnitude[GravitationalConstant] why this is not work? Already load the ...
2
votes
4answers
683 views

ListPlot multiple datasets over same x-values

Is there a better way to enter my data into a list plot? ...
10
votes
2answers
316 views

How to get the distance of Jupiter from the sun?

I am aware of the command AstronomicalData["Jupiter", "Distance"] from which I can get the distance between the earth and Jupiter. Is there any way to use ...
1
vote
1answer
74 views

Find the point that holds a given property

I have a normal distribution with mean 106, and a standard deviation of 8. I'm being asked to find the point that has the property that 25% of these values have this value or lower. What I've ...
2
votes
1answer
345 views

How to make a 3D-Plot from 2D-interpolated data

I have data of the form {x,y} for different concentrations. Therefore I added the concentration as z, resulting now in ...

15 30 50 per page