0
votes
0answers
53 views

Switching ArcTan argument from a sequence to a list

The objective is to determine the angle formed by the line connecting two points in the plane, say p and q. The ...
2
votes
1answer
79 views

How to handle Indeterminate TimeConstrain

I have to use Timeconstrained[aux] first for avoid some bigs calculation that dont need and it use a lot of time of calculate, so i can't do this. ...
1
vote
1answer
50 views

Multiple lines in an If statement [on hold]

What I am wondering is how do you perform multiple lines when using the If statement. I know the following is not proper Mathematica code, but how would I do this in Mathematica? ...
0
votes
0answers
30 views

Turning something into a form that can be used as C code [on hold]

I have a function F[x_]:= SOMETHING and I want to use it in a C code. Is there any easy way of doing this? Examples For functions like Log or sqrt, it could use the math library, for special ...
6
votes
2answers
2k views

Formatting Ticks and FrameTicks labels with a function

Is there a convenient way to format tick labels? In this example I would like to use the default Mathematica tick intervals, but simply convert the X axis labels to strings with "s" added. As you ...
4
votes
4answers
412 views

How to create a thick spiral then extract the coordinates from the image?

I can plot a thin spiral using just: $ r=\frac{\theta }{2 \pi };$ PolarPlot[theta/2 Pi,{theta,0,2 Pi}] but is there a way to plot a spiral that has actual area ...
2
votes
1answer
135 views

Where I can find the CD version of Stan Wagon - “Mathematica in action” 3rd ed. book?

I've just started my license and I need the code to focus on implementing my programs. I can't make the code in the book run. Can anyone help?
0
votes
1answer
38 views

NDsolve with discontinuous non-numeric PDE coefficients

I want to solve the heat diffusion equation with variable thermal conductivity. So I have the following code ...
14
votes
2answers
709 views

How to get grid lines at all (log) tick marks in Version 10?

In Version 7 using GridLines -> Automatic (or All) would put a grid line at every log-spaced tick mark: ...
1
vote
2answers
58 views

How to tell Mathematica that a limit converges to a product of two variables

I have looked through the manual and Im simply just stuck trying to make Mathematica solve this: ...
5
votes
2answers
170 views

Labels strangely rendered in PDF

I'm new to Mathematica so I apologize if this is obvious to answer. Anyway, using the following code (most of it is extraneous, to make the plot look the way I want) I plotted the Morse potential, ...
1
vote
1answer
124 views

Having trouble translating Matlab `fsolve` into Mathematica

I searched the site and found that someone said FindRoot is equivalent to fsolve, however, without proper options, ...
16
votes
4answers
728 views

How to define a recursive pattern?

I want to translate this recursive syntactic definition into a Mathematica pattern1: $$ \mathtt{x}: \begin{cases} \text{Null}\\ \{\textit{integer}, \mathtt{x}\} \end{cases} $$ In other ...
1
vote
0answers
25 views

Method used by NMaximize with a binary linear problem

I'm using Mathematica 7's NMaximize to solve a linear programming problem with thousands of 0/1 integer variables, thousands of linear constraints and a linear target. I suppose I could use ...
1
vote
1answer
38 views

How to change the position of the PlotLabel? [duplicate]

PlotLabel positions the label on top of the plot by default. I would like to put it below the plot. How can I do that? Thank you.
1
vote
1answer
45 views

Change only tick labels while keeping default ticks [duplicate]

Consider the following Plot3D (although the same question might be asked for the 2D case) ...
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
70 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
49 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
65 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
214 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
150 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
137 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
74 views
0
votes
0answers
151 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
115 views
0
votes
0answers
41 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

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
41 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
77 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
51 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
54 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 ...

15 30 50 per page