All Questions

Filter by
Sorted by
Tagged with
6
votes
2answers
92 views

Why TimeSeries forecasts the future value poorly?

On a bank account there are many recurring entrance and expenses. I've managed to import some sample data and to plot it. I can see that there is a quite clear recurring trend (one wage is coming ...
1
vote
1answer
46 views

TagSetDelayed for spotting zero derivatives

I am trying to implement my own differential operator, d[arg_, var_], that computes the derivative of arg w.r.t. ...
0
votes
0answers
31 views

Tracing & Modifying a Function (Replace All) [duplicate]

For the function: f[x_Plus] := Apply[Times, x] f[a + b + c] Out[]= abc This is clear, as the Times is applied to the list with Plus head in f. However, when ...
2
votes
1answer
63 views

Problem with numerical evaluation of a Hankel identity

There an identity with the Hankel functions of both types (https://dlmf.nist.gov/10.11 eq. 10.11.4 or http://apps.nrbook.com/bateman/Vol2.pdf pg. 80 eq. 43): $$ \sin\left(\nu\pi\right){H^{(2)}_{\nu}}\...
7
votes
3answers
242 views

Faster way to solve android lock valid patterns

With the password grid shown in the Android home screen, how many valid passwords are possible? The rules for creating a pattern is as follows. We must use four nodes or more to make a pattern at ...
14
votes
1answer
183 views

When does NDSolve parallelize ODE system solving?

I've long believed that NDSolve cannot make use of multiple cores to solve ODE system, but things seem to be different at least since v12. Consider the following ...
1
vote
0answers
41 views

FindFormula: can I change the standard TargetFunctions?

FindFormula seems to have a limited number of TargetFunctions: Possible functions for TargetFunctions are Plus, Times, Power, Sin, Cos, Tan, Cot, Log, Sqrt, Csc, Sec, Abs, and Exp. Is it ...
4
votes
0answers
40 views

Run computation in separate process and kill it after a time limit

I am looking for a solution to run a Mathematica calculation in a separate process (separate kernel) and cancel the computation after a given time. If it cannot be cancelled, then just kill that ...
1
vote
1answer
81 views

How to fit spline through points in $ \mathbb{R^3}$?

I have coordinates of points that represent a curve (for example, helix or centerline of moebius strip) in $ \mathbb{R^3}$. I want to fit a Bspline through these points. How to do this in Mathematica? ...
8
votes
2answers
175 views

How to control the padding below a BarLegend?

BarLegend has an annoyingly large space at the bottom. I can see that this was added to make it line up with the frame of the plot when there is a bottom frame ...
0
votes
1answer
47 views

Using Assumptions [closed]

I’m trying to use Assumptions for the set of variables in a form: $Assumptions = {(k, z) ∈ Reals, (k, z) > 0}; But as a result a receive an errors. What is ...
1
vote
1answer
75 views

unstable results when solve PDE even with great artificial diffusion term added

I try to solve a group of coupled PDEs, the 1-D continuity equation and the dynamic function: $\frac {\partial n}{\partial t}=-\frac {\partial (W n)}{\partial z}$ $\frac {\partial W}{\partial t}=-\...
0
votes
1answer
102 views

2 body orbits around a barycenter

Im attempting to plot a barycentric orbit of the sun and jupiter. Initial Conditions ...
1
vote
2answers
35 views

Manipulation replacements rules from Solve [closed]

Assume the call to the routine Solve[eqn==0,{x1,x2}] returns: {{x1->a1,x2->a2},{x1->b1,x2->b2}} I would like to ...
1
vote
1answer
36 views

ODE solving and NDSolveValue error depending on parameters

Given the two sets of $2N$ equations ...
1
vote
1answer
40 views

Matrix multiplication of function

Suppose I had a 2-by-2 matrix with each entry a function, e.g., {{#1&,#2&},{#1 + #2 &, -#1 + #2 &}} and a vector of functions, e.g.,...
1
vote
1answer
40 views

Gradient of function with arbitrary number of variables

This link answers the question on how to express the derivative of a function with an arbitrary number of variables. However, what if I wanted the gradient? More specifically, if ...
2
votes
1answer
30 views

Taking Out Max List from List of Lists

I have a list like this: L1 = {{500, {x->3, y-> 4, z -> 1}}, {110, {x->11, y->41, z -> 9}}, {750, {x-> 1, y->-1, z->0}}} Is there a ...
0
votes
0answers
18 views

The problem in finding a connected path through square lattice

I have a LxL square lattice. I randomly chose some points on this lattice and take them as my points. I want to find a connected path from left(0) to right(L). Below is my code: ...
0
votes
1answer
33 views

Compiling simple parallel function gives inconsistent results and errors

Im trying to compile the following function: ...
0
votes
2answers
28 views

How to create seperate empty lists assigned to seperate variables

Instead of doing l1 = {} l2 = {} Is there a way to incorporate a loop to make this process faster?
1
vote
1answer
47 views

how to conduct mathematical operations using numerical characteristics attached to vertices

Given a directed graph g: ...
2
votes
2answers
48 views

How to iterate through a lists of lists and delete a certain element?

Say I have a list of lists such as l1 = {{a, 2}, {a, 5}, {b, 3}, {b, 9}} How would I iterate through the list and delete all the lists with the first element b ...
0
votes
0answers
31 views

Mapping a flat unit plane composed of polygons onto a cylinder

I'm looking to map a flat plane composed of triangles onto a cylinder, and then ultimately use a manipulate function to show the plane wrapping into a cylinder. Here is the code I have so far, I've ...
0
votes
1answer
41 views

How do I split up a list of data points into invervals and assign values to those intervals?

So I have a data set for chess and our goal is to plot the difference between the rating difference versus white's win rate. I want to subdivide the x-axis into intervals like (-10, 0) (10,20) (20,30)...
0
votes
2answers
79 views

Verifying that a functions attends values below something

After plotting the graph of $$f(x)=\frac{π}{3\sqrt{2 π}} (\frac{e^{\frac{-x^2}{18}}}{3} + \frac{e^{\frac{-(x - 5)^2}{2}}}{1} +\frac{e^{\frac{-(x - 15)^2}{8}}}{2} ) (1 + x^2)$$ I would like to ...
8
votes
2answers
581 views

return {} when the function is given {}

I have a function taking an array as argument and giving an output. However, sometimes my argument is {} (the empty array), then how can I get an output {} when my argument is {}? Actually, I want the ...
2
votes
1answer
126 views

Grid with equation numbers

Is it possible to have a grid with DisplayFormulaNumbered in mathematica journal stylesheet so i would have something like this
0
votes
0answers
41 views

Solving an equation: Reduce command produces failure message

I am trying to solve the following equation for c: All variables can only take positive values and c>s. I have tried the following code: ...
2
votes
0answers
28 views

Reduce[expr,vars] behavior when vars are not present

It is officially documented that Reduce should be used like Reduce[expr,vars]. However, I've used ...
0
votes
0answers
35 views

Arrange a polynominal

I have a complex polynomial in more than ten line. I want to rearrange it by the power of another polynomial. For example, I have a powers of (1-A(x)/x^2) as a factor in it, and I want to sort the ...
2
votes
0answers
35 views

LaTeX/Markdown in notebook

I know that there is the wonderful MaTeX, which is a third party package, but is there a way to duplicate the Jupyter notebook functionality, where one can have ...
3
votes
2answers
112 views

Find gridlines in image of blots arranged in a grid

I have an image with a grid of equal separations. I would like to detect the lines in this image. I tried with ImageLines in but it does not work. @MelaGo Thank ...
3
votes
3answers
138 views

Interpolation[] gives negative values when all the initial data is positive

I have this data: ...
1
vote
1answer
44 views

Quickly restoring default notebook display color and font

(Not a duplicate. I've checked How to "undo" SetOptions (restore defaults)? and others.) Suppose I change some display options, e.g.: ...
2
votes
0answers
25 views

What kind of performance should I expect out of Eigensystem using FEAST?

I'm numerically solving a time-independent Schrödinger equation using Eigensystem's FEAST method. It takes a lot longer than I ...
0
votes
0answers
34 views

How can I always get one option of coordinates of the points A, B, C, D, and X of the Problem 6 in IMO 2018?

This is the Problem 6 of IMO 2018 https://www.imo-official.org/problems.aspx I use the code at Mapleprimes (with some prepairs) https://www.mapleprimes.com/questions/228162-How-Can-I-Get-One-Option-...
0
votes
1answer
51 views

Abs[]^2 , Conjugate[], ComplexExpand[], and Simplify

I think this is a numeric problem but would like to see where it occurs. I create a complex rational polynomial as follows and make it a function of f ...
2
votes
3answers
58 views

Replace function and its derivatives by zero

If I try to replace the function u0 and its derivatives by zero in the following examplary expression ...
1
vote
0answers
46 views

Defining dilogarithm with branch cut on $(-\infty,1)$

If my logarithms have a branch cut on $(0,\infty)$ then the dilogs constructed from these have a branch cut on $(-\infty,1)$. Is there a safe way to implement this in Mathematica? I tried with ...
2
votes
1answer
60 views

Geometric transform of a plot with legends and title

I'm doing a ternary phase diagram, so I want to plot it in a triangle and not in a square. If I'm doing the transformation with legends it doesn't work, but if I don't put legends it does work. Why ...
0
votes
0answers
38 views

Formatting of exporting

I am writing notes via Mathematica, but when I want to share it with others, there exists two problems. First, if I export it as pdf, there is no word wrapping of math expression: and input code: ...
0
votes
1answer
63 views

Two animations on the same ListAnimate plot

I have a code that produces two lists to be animated using ListAnimate and I want to have these two animations taking place on the same plot but I can't see a clear way to do this and was wondering if ...
5
votes
1answer
586 views

modulo with n instead of 0 without using if-statement

Is there a way to to express the following without using an if statement, but with mathematical operations instead? { 5 if x % 5 = 0, x % 5 otherwise }
0
votes
1answer
66 views

Generalization of code is slower than particular case

I wrote the following Mathematica module: ...
1
vote
2answers
90 views

Creating tables with Do command [closed]

Why when I perform this code am I not producing tables called roots[j], each containing 3 elements which are the roots of the equation? When I type roots[0] for example I get about 100 answers for z ...
3
votes
1answer
71 views

Typing and derivating unevaluated sums

First I would like to get the output of F[x_, y_, k_] := Sum[x^(m - n)*y^m, {n, 0, k}, {m, n, k - 1}] as an unevaluated (symbolic) sum. Then, derivate F ...
4
votes
0answers
97 views

Why does not Rasterize work in SciDraw?

In the documentation, it says " Rasterization is requested with Rasterize->True, and the resolution can be specified through the ImageResolution option. " However, when I try to enable ...
1
vote
1answer
82 views

Correct use of Reap/Sow to optimize the code

I am trying to compare two functions on the end points of an interval. For instance, $f_1(t)=t^3$ and $f_2(t)=t^4$. From my code below I check whether $f_1(t)\leq f_2(t)$ when $t=50$ on $[50, 51]$ ...
0
votes
0answers
26 views

Number of columns in PlotLegends

Is there a way to set the number of columns used in PlotLegends? Found this answer but it is for LegendLayout: LegendLayout ...

15 30 50 per page