22
votes
0answers
350 views

What is the difference between a .wl package and a .m package?

In Mathematica 10.x, one now has both .wl Wolfram Language Packages and .m Wolfram Mathematica Packages. What's the ...
0
votes
0answers
84 views

Solving a second order ODE numerically

I am trying to solve the following second order linear ODE numerically (for small w, say) y''[x]+ D[f[x],x]/f[x] y'[x]+ w^2/(x^2 f[x])^2 y[x] == 0 where, ...
3
votes
3answers
369 views

intersection between polygon. Algorithm to check it [closed]

I'm working on an algorithm which should check if two polygons, described by their vertex coordinates, are: one inside the other, are intersecting or are separated image below describe this three ...
4
votes
2answers
101 views

Parsing tab delimited file

Problem Description I have my data arranged in a tab delimited file and I'm trying to parse/access certain parts of it. As an example, I'd like to extract the number of points and the sampling ...
4
votes
2answers
141 views

How to be more efficient/faster with this MatrixExp-vector multiplication?

I am looking for expertise that helps to improve speed of the code below. First, a little bit of background: There is some system of differential equations $\dot{\vec{m}}(t)=S(t)\vec{m}(t)$. In order ...
1
vote
1answer
81 views

Is it possible to avoid the singularity problem of a 2nd order differential equations by restricting the solution range?

I would greatly appreciate your help in implementation of Mathematica for solving a 2nd order differential equation expressing some important engineering problem. Apparently, this equation has no ...
4
votes
2answers
130 views

Two overlapped spheres with boundary lines

How can I have two overlapped spheres given by ...
1
vote
2answers
98 views

Converting Units in formula

I have the following formula ...
5
votes
2answers
327 views

Smallest element distance between two lists

I have a problem, where I generate two lists of points, and I want to see which points are the closest. If I just want to find which ones are exactly the same, I can use ...
3
votes
1answer
81 views

How to use patterns to return non-overlapping sequences of consecutive elements from an array

Let me first describe the data structure I'm looking at before describing my question. I have an array of nx3 elements with a data-generating process such that each row has the format: {previous ...
2
votes
0answers
81 views

MySQL insert statement over remote server is extremely slow. How can I speed it up?

I need to insert values to a remote MySQL server. However it is extremely slow compared to a local MySQL server. This is my timing for the local MySQL server ...
3
votes
1answer
66 views

Cannot get Mathematica to recognise Vertex Weights of Graph

I am using Mathematica Version 8.0 I've tried variations of the following commands, in order to assign the weight $1/k$ for vertex $k$, for a graph defined on {1,2,..,n} via the edge rule $$(k,k') ...
-4
votes
3answers
85 views

x² function (0-3) to solve the Riemann integrate [closed]

x² function (0-3) to solve the Riemann integrate the range What is it that Mathematica code? Please show me the steps
-1
votes
2answers
93 views

The prime numbers between 1 and 100 [closed]

I'm new on this and the help seems not as helpful on this particular subject The prime numbers between 1 and 100 mathematica show steps
2
votes
1answer
43 views

IntervalSlider MinIntervalSize dependent on another control

I would like to achieve the effect of the DynamicModule below using a Manipulate. Several of my attempts failed. I could not get MinIntervalSize to recognize the dynamic variable. Is is possible to ...
1
vote
3answers
240 views

Command like “find” in Matlab [closed]

Is there a command working exactly like Matlab's find? I know that Pick might work, but I just want to give a logic condition ...
6
votes
4answers
277 views

Iterating a rational function

I'm reading about iterating rational functions. I'm given $$R(z)=\frac{3z-2}{2z-1},$$ then the author makes the statement: "Then(by induction), $$R^n(z)=\frac{(2n+1)z-2n}{2nz-(2n-1)}.$$ Is there a ...
7
votes
2answers
316 views

How can I find solutions for this equation?

I have a function cxyz[s1, e1, s2, e2], and I want to find at least one set of {s1, e1, s2, e2} for which the function's output ...
0
votes
1answer
48 views

Assumption that a parameter is real [duplicate]

I'm making some calculations, where I use the command Conjugate[f[x]]. In the function f[x] appears a parameter J, which is Real. How can say mathematica that it should not take the Conjugate of J? ...
1
vote
2answers
195 views

How to speed up a For-loop [closed]

My code is the following: ...
1
vote
1answer
52 views

Problems with solutions obtained from Reduce

I am solving a problem using Reduce, and having a difficulty with understanding the answers I obtained. I was solving ...
3
votes
1answer
111 views

How to specify the plot region for ListPlot3D?

Now I'm trying to solve a PDE and the solving domain is not regular, suppose it is a map. I used the finite element method to solve it and every nodes' value have been got, and now I want to use ...
2
votes
1answer
83 views

How can I create a chart like CandlestickChart, but for non-financial data with something other than dates as the abscissæ?

I'd like to create charts reporting on Monte-Carlo experiments using something like a candlestick chart: four figures for each run with a varying parameter, eg min, mean - σ, mean + σ, max of the ...
1
vote
0answers
62 views

Multivariate Path Construction using Sobol numbers

I am sharing my code,which I have tried to perform as per the instruction mentioned below. Please correct it so that I could get my output. Instruction: Use the first m dimensions of the Sobol vector ...
2
votes
1answer
45 views

How to label outputs from Print [closed]

I have problem with Print in Mathematica. The data that I get from it, is not labelled so that I can use it elsewhere, therefore I have got to label them manually. ...
2
votes
1answer
80 views

ColorDataFunctions applied to Tables of Graphics?

I'm trying to make a graphic according to a List, n. n has integer values that go from ...
6
votes
1answer
131 views

Trying to model a system of differential equations for outbreaks

I have this SEIR system of differential equations for modeling pandemics ...
5
votes
1answer
74 views

What does the Combinatorica function: NumberOfPermutationsByType return?

I am using Mathematica 9. If I input: NumberOfPermutationsByType[{2, 2, 1, 1}] Mathematica returns 1/8. I was expecting ...
3
votes
1answer
143 views

Update or Animate an ArrayPlot or MatrixPlot?

I am trying to add new row or column or points to a 2D plot as I keep generating the values. The trick is by using this method I will not be required to store the big array or matrix and will be ...
10
votes
1answer
516 views

Difficulty understanding difference between == and ===

After doing this: ...
2
votes
0answers
43 views

Why does this form of piecewise function cause a general stop message? [closed]

I am currently learning about Mathematica by reading the book Mathematica by Example, 4th Edition. In that book, a piecewise function was defined as follows: ...
4
votes
1answer
75 views
2
votes
0answers
123 views

Animate FromQuarternionTo3DRotation nb file with 4 quarternion values

I have a csv file. Inside the csv file, there are few rows of 4 quartenion values. I would like to animate the quarternion nb in http://demonstrations.wolfram.com/FromQuaternionTo3DRotation/ I ...
10
votes
2answers
169 views

stop notebook evaluation when Assert fails

I would like a notebook evaluation to entirely stop when an Assert fails, without quitting the kernel. Is this possible (e.g., by setting ...
1
vote
0answers
132 views

How can I make a smoothed 3D plot from a list of data? [closed]

I have a list of data points that I would like to turn into a 3D Surface with adjustable degree of smoothing for readability. The data consist of absorption values between -0.01 and 0.01 measured at ...
8
votes
1answer
204 views

PoincareSection for a driven damped pendulum is not generating a Poincaré section at all, why?

So I have the general code from the PoincareSection documentation that is changed up for a Driven Damped Pendulum: ...
1
vote
0answers
41 views

Problem on special functions

What does the symbol PolyLog^{(0,1)}(0,1/e) mean? I know the meaning of the Polylogarithm, but what is that exponent? It happens the same with the Lerch zeta function!! Thanks in advance.
18
votes
1answer
218 views

Defer, Hold, Unevaluated, Inactivate — which one when?

What are some guidelines on which function to select from among the superficially similar functions Defer, Hold, ...
0
votes
1answer
60 views

Getting numerical values from integrated interpolating function [duplicate]

I have a list of data. I integrate them with interpolation. Lets say is the following: InterpolatingFunction[{{0.01, 4.82}}, <>][x] However, is that ...
3
votes
1answer
124 views

Estimated Variance in LinearModelFit

Suppose that lmModel is a linear model which is fit using LinearModelFit. How come ...
2
votes
1answer
72 views

Interpreting Mathematica's expression for a function domain

When I study the domain my function f: f[x_] := 2/(Cos[x]^2) + 1/Log[Sin[x]] FunctionDomain[f[x], x, Reals] I receive the ...
3
votes
2answers
151 views

Efficient and fastest way to execute 4 nested loops

I have a question regarding the use of ParallelDo. I tried to parallelize the following code involving four nested Do loops by ...
5
votes
0answers
114 views

How to implement a Kalman Filter

Below I use low level code to reproduce the example of a Kalman Filter on pages 16-20 found here. First I create the data. ...
2
votes
1answer
92 views

Why must I specify the Global context for a symbol in a private package?

I have written two versions of the function below in a package. When I load the package and call the function, Why does the first version where the variable s has no explicit Context return the long ...
1
vote
0answers
42 views

Piecewise in 2D with quadrants as conditions

I am trying to define a piecewise vector field. Can the condition be of the form I am using (i.e. a quadrant)? I can't also make Piecewise work with more than two ...
4
votes
4answers
106 views

How to force MatrixPlot to differentiate distinct expr?

I thought MatrixPlot can differentiate different expressions in color until I found this: ...
12
votes
2answers
118 views

How can I run a cron scheduled task in Mathematica?

Mathematica doesn't have a built-in Cron scheduler. How can I use scheduled tasks in order to implement one ?
3
votes
1answer
76 views

Who can explain the strange behavior of command “Last”

Situation I use Last to extract the last element of an expression. Let poly=a+b*c+Log[a]+z. Problem When Using ...
1
vote
1answer
73 views

Extract coefficients from trigonometric polynomial [closed]

Suppose I have: f[r_, ϕ_] = C1 Cos[ϕ]r + C3 Sin[3 ϕ] r + C4 Sin[4 ϕ] r^4; How do I extract the coefficient of a chosen trigonometric term, let's say ...
6
votes
2answers
211 views

Speeding up code for lattice generation

Below is a lattice point generation code I write ...

15 30 50 per page