2
votes
3answers
2k views

How to remove ConditionalExpression from output

I need define the function with parameter so I could directly generate a power series expansion. The problem is that in some cases ConditionalExpression appears in output. Here is my code: ...
4
votes
1answer
72 views

What options need to be set for Simplify to perform a certain manipulations similar to FullSimplify?

Simplify performs algebraic transformations and is fast, while FullSimplify tries a wide range of transformations involving ...
0
votes
1answer
30 views

EdgeForm with Graphics

I want my figure to have an edge and I am playing around with EdgeForm[Thick], putting it in different places. My figure is: ...
31
votes
7answers
5k views

How to avoid returning a Null if there is no “else” condition in an If contruct

I need to use If but with only one option that is if "a" then do "b", else do nothing. So I wrote If[a,b] but the problem is ...
19
votes
2answers
518 views

Specifying non-conflicting PlotTheme options

A bug or limitation in 10.0.0 affects a few of these examples; it was resolved in 10.1.0. I am trying out Mathematica 10 on https://programming.wolframcloud.com. ...
45
votes
1answer
1k views

Is it possible to define a new PlotTheme?

In version 10 one can define, say, $PlotTheme = "Scientific" Which changes the appearance of all plots. This is fantastic because on the one hand I can have nice ...
3
votes
1answer
203 views

How to enforce mathematica to analytically evaluate roots?

I am interested in simplifying expressions involving HeavisideTheta. A simple example could be: HeavisideTheta[1 + x - x^2 + x^3] The best I can achieve is with ...
0
votes
0answers
56 views

Small difference between large numbers [on hold]

I would like to calculate the difference of the two large numbers, which are close together. See here my (sorry, quite long) code: ...
7
votes
2answers
215 views

How can I construct a recursive pattern guard?

I am modelling binary trees in Wolfram Language by writing them as three-element lists, like so: binTree = {nodeVal, leftChild, rightChild}. It does not yet matter ...
0
votes
1answer
61 views

Binomial Regression where n > 1

I am not well versed in Generalized Linear Models, but am trying to use this approach to model some discrete data. I have binomial data where the sample size for each observation is the same size, ...
0
votes
1answer
50 views

Obtain constant from DSolve [on hold]

I need to extract constant C[1] from expression which I get when solve equation. i.e. DSolve[y'[x]==1/(2x),y[x],x] In result Mathematica gives me this one ...
4
votes
1answer
66 views

Split/unmerge merged cells in notebook file

I have merged cells in a Notebook file. Is there a way to split such a merged cell group back to single cells, in each of them being one command?
1
vote
0answers
53 views

Custom Head for Encapsulation

Often when I'm writing a project in Mathematica, the number of arguments I must provide to functions spins out of control. I need a sort of object-oriented encapsulation approach. I've already had a ...
0
votes
1answer
80 views

Solving recursion equation with two parameters

I am trying to solve the following recursion equation, a(l,m)=l*a(l,m-1)+a(l-1,m) with initial condition; a(l,m)==0 if l=0 , a(l,m)==1 if m=1 I am trying to solve it ...
7
votes
1answer
215 views

How to integrate Mathematica with other software

Mathematica is a fantastic platform for Mathematical analysis, physics, quantitative finance and most realms of scientific work. However, it doesn't serve well for general purpose programming, in ...
6
votes
2answers
151 views

Reject diverging solution of NDSolve

I'm trying to numerically simulate a spring system with complex stiffness. In essence systems of the form $x''(t)+ (a+ ib) x(t)=0$ For this simple example an analytic solution is easy to find. The ...
4
votes
1answer
140 views
+50

Confirming conservation laws for complex valued functions

Consider the nonlinear Schrödinger equation (I would like to do this for a more complicated set of equations, but to gain understanding I'll consider this simplified case) $$A_t+iA_{xx}+i|A|^2A =0,$$ ...
4
votes
0answers
75 views
0
votes
0answers
154 views

contour plot (cartesian) using spherical coordinates postions

Let´s say that I have a data in the following configuration: { Lat, Long,distance, energy}-> lat, long -> galactic coordinates, distance unit - parsecs (3.2 ly) energy unit- ergs. I need to plot ...
3
votes
2answers
97 views

Find the area of a contour surface plotted by ContourPlot3D

I am looking for a way to find the surface area of a contour from ContourPlot3D. Here is an example where I might like to find the area of the contour surface to ...
1
vote
1answer
117 views
0
votes
0answers
42 views

Plotting complicated function with not exactly defined angle [on hold]

I want to plot the time-averaged electric energy density near the focus according to Boivin and Wolf. Now I have my three intensities. I am very new to Mathematica and my problem is that I can't ...
0
votes
1answer
74 views

How to efficiently compile this function? It involves a 3-index Table [on hold]

Consider a 2-dimensional lattice with LxL sites. Each site has 4 neighbors, and we can then define a function (called below ...
1
vote
1answer
43 views

A single point moving at different speeds through different regions on a plot (Manipulate)

I've been working on this for a while with little success. I have a point (that needs to be connected to a Manipulate control in some way), that moves up the plot ...
4
votes
0answers
79 views
+50

NMinimize with NIntegrate (crash in symbolic evaluation, memory leak)

This is a "common" problem from what I've seen, but with a different spin. I have a function I use often that finds a fit of an expression to another expression with some free parameters (e.g. for ...
0
votes
1answer
49 views

Interpolating a function of many variables

I am trying to interpolate a function of 5 variables $$f[m,M,k,v,w]$$ by creating a 5D table of $n$ values in each dimension. ...
1
vote
1answer
61 views

What is the meaning of the lists of numbers in the FullForm of a compiled function?

For example, f = Compile[{{x, _Real}}, x]; FullForm[f] has this output: ...
12
votes
1answer
436 views
3
votes
1answer
52 views

Assign values to parameters from a list/Matrix using GUI

Assume there is a list like: ma={{L1,r1},{L2,r2}}; I want to convert the ma to a GUI which asks me about the values of ...
8
votes
1answer
570 views

Importing Excel Spreadsheet containing Array Formulas

Has anyone had any success with importing an Excel Spreadsheet holding an array formula into Mathematica? The Syntax I'm using is ...
0
votes
1answer
55 views

Evaluate NDSolve within NDSolve

So I am attempting to solve a differential equation which includes a differential equation (i am not sure if this why my code is giving problems). I am pretty sure that everything is as its supposed ...
17
votes
3answers
1k views

Why does Mathematica use [[ ]] notation for array indexing?

I am confused by why Mathematica uses [[3]] to get the 3rd element, or [[i,j] to get the i,j-th element of a 2D array. This ...
2
votes
0answers
30 views

How to get simultaneous eigenvectors of commuting matrices? [duplicate]

So let's say there are two square matrices A and B that commute (AB-BA=0). This implies that there must exist some complete set of vectors that are eigenvectors of both A and B. Is there any way to ...
1
vote
1answer
33 views

Can I rely on the ordering of the adjacency matrix? [on hold]

Suppose I have created a Graph[{1,2..n}, {1->3, etc}], and I take the adjacency matrix of that graph. Can I rely on the fact that the i-th entry in the graph is the i-th node in the matrix? Or maybe ...
4
votes
1answer
194 views

Why don't the arrowheads show for this directed graph?

It's very weird, but the first graph is shown as undirected (dots connected by lines, not arrows. The second is shown as directed, with arrows. I'm using the cloud version of Mathematica. ...
0
votes
2answers
31 views

How to get Complement function working in a For loop? [on hold]

I've been working on a piece of code that will delete small components from a nested uneven matrix (n pages, n rows, 3 columns), by deleting the pages with less than ~30 rows. However, I've notice ...
1
vote
0answers
54 views

How to freeze and test a list of programs?

I have a list of problems for my students and I'm trying to use the new v10 feature TestResults like so: ...
1
vote
0answers
43 views

Does a matrix need to be rationalized when calculating MatrixExp? [on hold]

I have a sparse matrix, L, and need to calculate its exponential, MatrixExp[L t], where t is ...
0
votes
0answers
52 views

OLS Estimation - Computational results vs. calculation by hand [on hold]

I calculated the OLS estimators for a data set by hand using $$\hat\beta=(X^TX)^{-1}X^Ty$$ If I check my results with Mathematica I get different results. I'm quite sure that I didn't make any ...
6
votes
1answer
87 views

Calculation of 2D FFT for an image

I am trying to obtain 2D FFT of an image. From the 2D FFT, I wish to calculate the amplitude of the FFT averaged over a circle vs the distance in pixels by varying the radius of the pixels which is ...
3
votes
0answers
51 views

Simple ways to implement vector dilation

Suppose we have a singly connected but not necessarily convex polygon. Something like shape = CountryData["Chad", "Coordinates"]. Is there a simple way to ...
1
vote
0answers
35 views

DSolve -> no results

I am trying to solve a system of differential equations. ...
1
vote
1answer
36 views

Generation of list of values for small gap among values

I need to run a loop as Table[expr,{i,imin,imax,di}] where I want di to be as small as order of ...
2
votes
2answers
56 views

Export NDSolve results

I can see the correct result of my NDSolve when I plot them with large PlotPoints. ...
4
votes
2answers
50 views

Building up a sequence dealing with a complex recursive scheme

Suppose I have multiple lists, the first one contains 2 elements, the next one 4 elements, the next one 8 elements, and so forth. Let these elements be labeled as Gij where i refers to the list it ...
2
votes
1answer
29 views
0
votes
1answer
78 views

How to solve the following fourth order partial differential equation including Laplacian

I wish to solve the following fourth order partial differential equation including Laplacian with the boundary conditions with the initial conditions ...
0
votes
0answers
29 views

rgb2ycbcr and ycbcr2rgb performing twice on same image gives different answers? [on hold]

I converted an image from rgb to ycbcr using rgb2ycbcr. Then converted back to rgb using ycbcr2rgb. Again converted the resulting image from rgb2ycbcr. But in the first and second rgb2ycbcr ...
0
votes
1answer
219 views

Integration of linked PDFs over probability simplex

I'm trying to integrate the following expression: f[a1,p1+p2+p3+p4]*f[a2,p2+p3+p4]*f[a3,p3+p4]*f[a4,p4] Where ...
0
votes
1answer
135 views

Solving differential equation with initial conditions

I want to solve the following differential equation with initial conditions: ...

15 30 50 per page