7
votes
1answer
376 views

Returning a value from a Module

In the following simple example MyMod := Module[{i}, Do[ Return[1], {i, 3} ]; Print["test"] ] I expected the module to exit on ...
0
votes
1answer
127 views

NDSolve in exact points - nonlinear equation (Degrees and Radians confusion)

I found solutions of two nonlinear equations, but I have three small questions. First I am in confusion because of initial value. The system is mechanical and unknown ϕ is an angle, which I set to ...
2
votes
1answer
70 views

Is It Possible To Replicate Tab Stop Behaviour (or Even PageFooter Behaviour but in Regular Cell)

I am trying to insert a (text) cell into a notebook that replicates the behaviour of tab stops in MS Word, for example. Put differently, I have two strings and I want the one string to align on the ...
4
votes
1answer
216 views

Sample of the random times at which the random walk crosses the boundary

I defined a security boundary for a random walk: ...
2
votes
1answer
104 views

nonlinearnodelfit with a matrix as weights

I have to fit a non linear model to my data and I am trying to use nonlinearmodelfit. The problem is that I have systematic errors, so the ...
8
votes
6answers
714 views

Alternating sum

A frog is at the bottom of a 30 metre well. Each day it climbs 5 metres up the side, but it then slips back 3 metres each night. How long does it take to reach the top of the well? Is there an easier ...
8
votes
1answer
460 views

Exporting EPS figures with dashing from ListPlot

I am having difficulties exporting EPS figures. If I use the LineLegend option to create a dashed or a dot-dashed line, it seems ok in Mathematica 9.0 e.g.: But the problem came out when the ...
0
votes
1answer
91 views

How to get diagonal matrix D from matrix multiplication of $s^{-1}$, P, and S

I am multiplying three matrices that should give me a diagonal matrix but instead of zeros for the other entries I get very small numbers. Can someone explain what is going on here and how I can fix ...
3
votes
4answers
354 views

Base 2 Tick Labels for ListLogLogPlot

I am using ListLogLogPlot and would like to express the x-axis tick labels in powers of 2 instead of the default powers of 10. Does anybody have experience with ...
2
votes
2answers
180 views

list of vectors with prescribed sum

Let $a\in\mathbb{N}^n$ and $k\in\mathbb{N}\!=\!\{0,1,2,\ldots\}$. How can I efficiently generate the list $$\{(a_1,\ldots,a_k); a_1,\ldots,a_k\!\in\!\mathbb{N}^n\!\setminus\!\{0\}, ...
3
votes
2answers
370 views

Map of Swedish regions?

There have been some questions dealing with how to draw individual US states since such data doesn't come with Mathematica through its CountryData which offers ...
0
votes
1answer
897 views

Plot not working

I am trying to generate a plot for S2[w]. My code is below ...
10
votes
1answer
261 views

Why does the order of arguments in Show influence the result?

I am wondering why there is a difference in the results from evaluating the two expressions, which differ only in the order of the arguments given to Show. When I ...
2
votes
2answers
196 views

Color of first and last point in a graphic

I'm trying to make a graphic of a random walk in 1D, but i want that the first and the last point have a color (in this case the first one red and the last blue), but i dont know what i'm doing ...
3
votes
1answer
361 views

Plotting power spectral density from transfer function

I am new to signal processing. The equations below are given in $LaTeX$. I have the following transfer function (from the Dryden Model) for the two-sided Power Spectral Density: $$S(w) = ...
0
votes
0answers
66 views

How to avoid malicious code when opening & executing notebooks [duplicate]

Is there any way to avoid malicious code when opening and executing entire notebooks automatically? I have written code which opens a large series of notebooks one-by-one, evaluates them in their ...
1
vote
1answer
111 views

How do I produce iterative equations and bifurcation diagrams?

I need to produce orbit diagrams for different values of x for the following equation: f[r_][x_]:= r*x - x^3 I'm fairly new to Mathematica, so I haven't had a ...
5
votes
1answer
534 views

Is it possible to suppress 'Out[xxx]=' without suppressing 'In[xxx]:='?

While I have not exhaustively searched Help/Documentation Center for an answer to my question, I have put forth a yeoman's effort without any success. Does anyone ...
1
vote
1answer
129 views

Problem with numerical integration

I am not very used to do numerical simulations on Mathematica. I have a problem with numerical integration of this function. Is there any way for this calculation? Input: ...
6
votes
2answers
855 views

Random walk on a sphere [closed]

I'm trying to programme a random walk on a sphere with Mathematica. I found this code while I was searching, but I'm not getting results from it. I waited an entire day, but my pc didn't finish ...
2
votes
1answer
702 views

Time derivative of unit vector in spherical coordinates

Is it possible to take a time derivative of a vector given in some curvelinear coordinate system (i.e. spherical)? Mathematica would need to take into account the time dependence of the basis vectors. ...
1
vote
1answer
161 views

About making a fraction “taller” [duplicate]

I encountered 2 problema with displaying formula in text format. The variables in the formula is italic, I want to change them to normal. And the fraction size is too small, I want to make it to ...
0
votes
1answer
112 views

Solutions of cubic equation D>0 or D<0

I have problem to obtain three roots of cubic equation N[Solve[a x^3 + b*x^2 + c*x + d == 0, x], 15] using analytical procedure ...
13
votes
1answer
650 views

Map of Specific US States? (Isolated)

My question here is fairly basic, and I'm sure I'm overlooking something basic. I know about CountryData for creating shapes of entire countries, and it works, to ...
1
vote
1answer
280 views

Factor a Vector

Does there exist a function in Mathematica that simply takes out a common factor from a vector/list of expressions? This seems like such a simple operation that I am surprised that I could not find it ...
0
votes
1answer
103 views

Evaluate integral of a series

I want to evaluate this integral, but it won't work. Does anyone knows why? ...
1
vote
2answers
175 views

Eigenvector Anomaly

I'm trying to compute the eigenvectors for: $$ M = \left( \begin{array}{ccc} 1 & 4 \\ 4 & 100 \end{array} \right) $$ Both myself and Mathematica report the eigenvalues as: $$ \lambda_1 = ...
1
vote
1answer
141 views

Numerically solving an ODE for a parameter

My equation is as follows: sol = ParametricNDSolve[{(f'[r]^2 - 1) f'[r] r == 6.2 (f'[1])^2/1000, f[1] == a}, {f}, {r, 1, 3}, {a}] where the function ...
0
votes
0answers
189 views

Intersection of any triangle with a circle in Cartesian coordinates

I started a notebook dealing with metrics in a triangle and its intersection points by a circle. Up to know I reached the point of having plotted a triangle, a circle with an arbitrary centre and I ...
1
vote
1answer
103 views

Empty plot - Euler's method

The answer from this question helped me use Euler's method. It worked for a simple function, but when the function is more complicated, I get an empty plot. This is my function: ...
5
votes
2answers
459 views

Finding Points of Tangency of a Circle and a Parametric Curve

I have the following Parametric plot Generated from the following: ...
1
vote
1answer
80 views

Forcing contours to close at edge

I have some data that I am plotting with ListContourPlot and I would like my contours to be closed at the edge (closing around the high value region). A simple ...
0
votes
1answer
239 views

Numerical Methods - minimum of a function

Problem: The length of the longest ladder that can negotiate the corner depicted in Figure 2 can be determined by computing the value of theta that minimizes the following function: ...
3
votes
0answers
136 views

Automatically Recording Sound

I was hoping I could recreate a noise cancelling set-up by recording sound from the microphone in my headset or from the computer and play it back in my speakers or headphones with the appropriate ...
0
votes
1answer
112 views

How to save numbers that are in Mathematica messages

I have a program that calls FindDistributionParameters and I get the Mathematica message FindMaximum::eit each time I call the function. The message is FindMaximum::eit: The algorithm does not ...
1
vote
1answer
113 views

Change Ticks in PairedBarChart

I am using the PairedBarChart feature as follows: PairedBarChart[Range[5], Range[5], BarOrigin -> "XAxis"] How can I (i) remove and (ii) change the number ...
2
votes
2answers
79 views

Can I have Mathematica show intermediate forms before final evaluation?

If I have x = 2 and I want to evaluate y = x^2 I would like to the output to show ...
0
votes
1answer
369 views

logplot for negative valued function

I would like to plot the following function Plot[(1/x (0.01/(0.01 + x^2) - (10/(10 + x^2))^2)), {x, 0, 10}, Frame -> True, PlotRange -> All] which is ...
4
votes
4answers
380 views

Efficient method for Inserting arrays into arrays

This is strongly related to the following Questions: Looking for a way to insert multiple elements into multiple positions simultaneously in a list Building matrices by attaching vectors (columns) ...
2
votes
1answer
70 views

Matching a list of sequences with common form

I am trying to find a pattern that matches a list of sequences that share a common form. The sequence form is: 1 followed by zero or more nonzero integers, followed by 0. An example list is: ...
1
vote
0answers
110 views

What is the fastest way to obtain the eigenvalues of a Wishart matrix?

I would like a fast method of creating a sample of random numbers which corresponds to the eigenvalues of a Wishart matrix: For M>N the eigenvalues \lambda_i are given by the jpd Where $K_N$ is ...
0
votes
1answer
204 views

Series expansion of a complex function

How do I expand a function $f(z)$ in a particular region? For example, how would I expand $f(z)=(z^2-3z+2)^{-1}$ in the region $0<|z-1|<1.$? I believe this can be done by the binomial theorem. ...
1
vote
2answers
114 views

How to switch between a binary number as String and a as a list of digits?

I was trying with String Functions and I viewing any posts and have no results I want to know 1.- From cromo33 = Table[RandomInteger[], {i, 1, 33}] cromo33 ...
1
vote
0answers
53 views

How to change default font? [duplicate]

Sometimes even I change the text font from arial to courier new, when a new formula cell is created, things inside become arial again. How to tackle this problem? Furthermore, is it possible to change ...
1
vote
3answers
374 views

Plot with plot markers without using ListPlot

I would like to plot a continuous function with Plot with plot markers as if it were a ListPlot plot. Simple example: I have ...
2
votes
1answer
147 views

Getting cdf content from nice Wolfram info graphic

There is a very nice cdf info graphic on the Wolfram Webpage (http://www.wolfram.com/cdf/uses-examples/infographics-full-example.html). I'd like to have a look at the code as I'd like to do something ...
0
votes
2answers
134 views

The precision of the number

I have problem in Mathematica with unnecessary rounding which is caused by high precision. For example I have value a = 2.052685846*10^-1865, when I make ...
2
votes
1answer
93 views

Why there is no SlotSequence (##) form analogical to #[[ ;; n]]

I'm aware that this may be closed as offtopic but there are people around with "offtopic" knowledge :) So, in List context we can: ...
1
vote
0answers
127 views

How to make Layer Directed Graphs (LDG) in mathematica?

I am wondering if I can make a graph like that somehow: I am new to mathematica, I tried to play with Creating a graph with variable size of vertices and variable thickness of edges . I figured if I ...
1
vote
0answers
70 views

Function behavior based on Head

I'm figuring how to implement a function behavior based on the Head of its argument. I mean ...

15 30 50 per page