9
votes
9answers
169 views

Count the sequences in an array

Is there a short and easier way to count number of sequence in a list? Let's say I have three lists: list1 = {0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0} ...
0
votes
1answer
12 views

Draw a vector with mathematica

at the risk of being trivial I would like to draw the vector $\vec{AB}$ where $A$ an d $B$ have the coordinates $(1,1,1)$ and (1,-1,2) respectively.
2
votes
1answer
27 views

Contourplot fails to plot x==0 if plot range is from 0

The simple command ContourPlot[x == 0, {x, 0, 1}, {y, 0, 1}] fails to plot the line x==0. However If I add a small buffer it ...
6
votes
3answers
290 views

String matching balanced pairs of braces

I am trying to extract from a string in Mathematica all instances of \newcommand{ABC}{DEF} Where ABC and ...
2
votes
0answers
39 views

Graph, overlapping vertexlabels

The graph I create is based on more then 1000 different word-combinations. A example looks like this: text = {{word, word1}, {word1, word2}, {word1, word3}, {word,word4}, {word,word5}, ...
0
votes
0answers
34 views

NDSolve : Solve a single variable-coefficient ODE as series of constant-coefficient ODEs

I have a manipulator equation of the form: $M(q){q''} + C(q,q')q'+G(q) = {0}$ where $M, C$ are $6$ x $6$ matrices, and $G, q$ are $6$ x $1$ vectors and $q$ a function of time. ...
6
votes
2answers
156 views

Curvature Application

I found these amazing animations at https://courses.engr.illinois.edu/tam212/avt.xhtml#avt which I think will be wonderfully useful when teaching multivariable calculus next semester. I've started to ...
3
votes
2answers
37 views

How to control when NDSolve is called inside Manipulate

Let's say I have a function which returns the resulting function of a differential equation solved by NDSolve: ...
0
votes
1answer
49 views

Assigning values to variables with subscripts

I'm wondering if there is a way to assign values to variables with subscripts. I have the following Manipulate function: ...
2
votes
3answers
42 views

Infinite Expression Error NDSolve

I'm trying to figure out why I am consistently getting an infinite expression error when I'm trying to solve this DE using NDSolve. Any help will be appreciated. ...
1
vote
2answers
43 views

Extracting Points points from 3DPlot MeshFunction

I am trying to extract the points from the mesh lines of a 3D plot. (Not my actual function.) ...
3
votes
1answer
59 views

Using function to transform a list

I have a list like that: {{Integer,String},....}, integer ranges from 1 to 900 and String "I" to "IV". And I need to find which pair of {x,y} each sublist is related to, so i can get a new list like ...
1
vote
1answer
84 views

Are variables always assumed to be real in Jordan Decomposition?

If you give the Input in Mathematica 9.0 (Student Edition) JordanDecomposition /@ ({{1, #}, {#, -1}} & /@ {i, I}) Mathematica gives you two completely ...
1
vote
1answer
31 views

Increasing Plot3D speed when plotted function is Eigenvalue

This is probably a really simple fix, but I'm fairly new to Mathematica and am not sure how to do this properly. I know that trying to plot eigenvalues directly can be computationally expensive, so ...
3
votes
2answers
42 views

Keeping a plot fixed as one parameter changes in Manipulate

In the following code I'm plotting the contour $f(x,y)=0$ as well as the family of lines $y=mx$: ...
2
votes
3answers
107 views

Mathematica's ViewPoint versus MATLAB's View command

Here is a bit of code borrowed from Parametrize a circle as a tube?. ...
3
votes
2answers
283 views

How to numerically integrate this integral

I am unable to do this definite integral in Mathematica 9. Is there any command so that I can get the numerical value of the above integration? Code: ...
2
votes
1answer
100 views

Solving a system of weird equations

I'm trying to have Mathematica solve a system of equations for a friend's work in Computer Vision. I'm essentially going in blind to this and am not very familiar with Mathematica syntax, so would ...
6
votes
2answers
200 views

How to simplify only the lowest level of a nested expression

I have a large expression that takes forever to simplify if I apply FullSimplify[...]. The expression has lots and lots of brackets that luckily already groups ...
0
votes
0answers
10 views

Probability clarification [migrated]

Consider the reading habits of the X class. If we know that 30% of the class students read USA Today daily, 40% read Salt Lake Tribune daily and 10% read both of them daily, what is the percentage of ...
2
votes
2answers
31 views

Join data imported in different variables [on hold]

I've imported data from Excel into several variables and I would like to join all data in one "big" variable. I seem to have a problem when one variable contains numerical data... ...
1
vote
0answers
49 views

Improve speed of evaluating a sum over four indices

I am trying to implement the Fox-H function with several variables as sum of residues. I have arrived at the following function; ...
0
votes
1answer
51 views

Removing imaginary and negative results from Solve

I have been trying to solve a series of equations that I know have real positive values for the unknowns (they all have real world analogues and they are not linked to a frequency domain) but despite ...
1
vote
2answers
36 views

Deleting a line from a file

I'm writing a Mathematica script that writes output to a file every 10min as backup. However, I'd like it to overwrite the previous content so as not to use to much storage. Is there a function for ...
-1
votes
0answers
60 views

NonlinearModelFit errors and precision

For this problem, I use a data set, which I've made available here. ...
0
votes
0answers
33 views

Character Encoding Method

I want to identify the character encoding of a text imported by Import method by example. I would like something similar to ...
10
votes
0answers
147 views
+100

Implicitly defined compact complicated surface

A Seifert surface for the (3,4) torus knot is defined by the intersection of $S^3 \subset \mathbb{C}^2$ with the set $\arg(z^4-w^3)=0$. The boundary is at $z^4=w^3$ and this is the torus knot. Here ...
1
vote
0answers
54 views

Saving a plot after using the drawing tool

This might seem very obvious but I'm on the verge of losing all the annotations I've made on a graph because I can't figure a way to save it after using the drawing tool to add a few extras to the ...
6
votes
3answers
162 views

Limit of Nested Radical $\sqrt{1+\sqrt[2!]{2^2+\sqrt[3!]{3^3+…}}}$

I want to find limit of infinite nested radical $\quad \quad \sqrt{1+\sqrt[2!]{2^2+\sqrt[3!]{3^3+...}}}$ but I don't know how to define this expression in Mathematica. How can I define it and ...
3
votes
2answers
74 views

Positioning axes labels

I need to change the position of my axes labels such that the y-axis label is in the middle and parallel to the y-axis. I'd also like the x-axis label to be in the middle of the x-axis rather than ...
5
votes
1answer
172 views

Need help with the Lagrange multiplier method

Well I am new to Mathematica and got really stuck solving this problem. In class, I was ask to use the Lagrange multiplier method to find the maximum and minimum value of $f(x,y) = x^2+y^2$ which ...
6
votes
2answers
122 views

Import data from excel and store it permanently in notebook

I am trying to write the code for doing the following: by clicking a button, import specific data from an Excel file which I select through a dialog window; input a name for the imported data set ...
15
votes
5answers
757 views

How to make a Line[] with no end?

I'm trying to do this: In this graph, the secant points are aproximated in order to become the tangent, it seems I need some kind of function which plots a line based on two points and it's points ...
8
votes
0answers
66 views

Dataset vs an association of associations

Associations with a record structure (e.g., a flat table) can be organised in one of two main ways. First as a list of associations, which is also used in the case of Mathematica's data set ...
13
votes
4answers
479 views

How to plot Ramanujan's continued fraction in Mathematica?

I want to plot Ramanujan's continued fraction: $$R(q)=\cfrac{q^{1/5}}{1+\cfrac{q}{1+\cfrac{q^2}{1+\ddots}}}$$ but I do not know how to define this function in Mathematica. How do I define and plot ...
0
votes
1answer
49 views

Plotting the tangent of a curve [duplicate]

I'm new to Mathematica and this is probably child's play for most people, but I wanted to know how to plot the tangent of the function below at the point e=1/4 : ...
-3
votes
0answers
32 views

measure theory : Lebesgue measure [on hold]

let E subset of the IR ..if m*(E)=0 then m*(E^2)=0 E^2={ x^2 : xεΕ } can you give me a hint please? Blockquote
0
votes
0answers
23 views

Reset Options to Default [duplicate]

It is straightforward to set the options of a given predefined function. E.g., SetOptions[ Interpolation, InterpolationOrder->1] I would like to know if there ...
3
votes
1answer
26 views

Manipulate with a function as a parameter

I'm trying to make a Manipulate command to plot the contour lines of a function of two variables $f(x,y)$. I think I should use the "InputField" option somehow, and I thought of something like this: ...
1
vote
0answers
21 views

How to access timings of each individual test in a TestReport?

I want to know how long each VerificationTest took to complete in the test report, so see which one was the longest and do some statistics on them: ...
11
votes
1answer
410 views

What function generates random numbers in a compiled function?

I am writing a simulation for 2D random walk. I wrote several version of code, and found that the speed is like this (fastest to slowest): C++, Mathematica compiled procedural code, Mathematica ...
11
votes
2answers
4k views

Equation of a line that is tangent to a curve at point

A common problem in the derivative section of calculus texts is "find the equation of the line that is tangent to the curve $y = \ldots$ at the point $P$." To find the line that is tangent to $y = 2 ...
0
votes
0answers
26 views

NDSolve There are fewer dependent variables, {V[S,t]}, than equation

I am trying to solve the BlackScholes PDE for Barrier option. It works fine for european barrier, but errors out on american boundary condition ...
0
votes
0answers
26 views

R^2 values for piecewise regression

So I've used NonlinearModelFit on a Piecewise function and gotten a nice little piecewise regression. This is what my code looks like: ...
7
votes
0answers
83 views
1
vote
2answers
72 views

Ask about the variable and constants in partial derivative in a loop

EDITED I have a function in a list like : func={2(x^2)+x*y+3(y^2)}; I want to have a UI that ask me which parameter (x or y) is a variable in a ...
2
votes
2answers
115 views

MaxValue of a periodic function

I want to find the maximum of a periodic function on the interval [-Pi,Pi]. What I tried is the following: ...
8
votes
1answer
91 views

Reference to multiple stylesheets

I need to set StyleDefinitions for a notebook in such manner so I can provide references to multiple stylesheets: ...
1
vote
1answer
50 views

Multiplying three matrices does not give expected form [on hold]

I'm having lectures on analytic geometry. I've learned that there is an associated matrix multiplication for a quadratic form: $\quad \quad \left( \begin{array}{ccc} x & y & 1 \\ \end{array} ...
10
votes
5answers
197 views

Tidy form of numbers with errors using ScientificForm

Say I've computed something and got a number 0.02112398 with a computed error: 0.000331 Formatting it with ScientificForm[0.02112398 \[PlusMinus] 0.000331] gives ...

15 30 50 per page