All Questions

78 views

My code of plotting a two-variable function is too slow [closed]

I have a code in which my complicated function to be plotted is F(x,p). I would like to graph it for 5 values of p equal to 10^7, 10^8, 10^9, 10^10 and 10^11 for x values between 0.01 and 0.99. All ...
191 views

Workbench 2.0 was an extremely useful tool for Mathematica Developers. I received an early release of Workbench 3.0 to work through debugging issues encountered with Mathematica 10 and Workbench 2.0. ...
379 views

What is primary, function computation or function application?

What is the order of computations here? g[x_]:=x^2; f[x_]:=Sqrt[g[x]]; Map[f, Range[100]] Does this code first get $f(x)=x$ and then gives its values or for ...
51 views

Dynamic check box with import!

Here what i am trying to do: I have a list of the names of excel files, for example s={"red carpet.csv","red box.csv","black carpet.csv","black box.csv"}; i am ...
469 views

Problem with FindRoot applied to functions

I am having difficulty with the error "is not a list of numbers with dimensions..." when using FindRoot (and other numerical routines in Mathematica) to solve equations numerically when the argument ...
58 views

Enormous and unclear output when using Solve

After running for about 30 minutes the program yields the below-given unclear output (of course I didn't copy the whole output, only a small part of it). So it explicitely gives 3 possible solutions ...
131 views

The inverse Fourier transform of a rather complex function

I am using Mathematica 7.0 and trying to find the Fourier transform of a rather complex function g. The function g is defined by ...
77 views

Using the string Match with options! [duplicate]

Here is what I want to do: I have a list of strings for example s={"red carpet","red box","black carpet","black box"} I want to use something like ...
903 views

Mathematica style guide?

I encountered this site today https://code.google.com/p/google-styleguide/ regarding the programming style in some languages. What would be best programming practices in Mathematica, for small and ...
97 views

Selecting values over lists for discrete inputs in NDSolve [duplicate]

I'm currently trying to simulate a step response in a simple tank system with NDSolve. I would like it to start at say time 2 (the precise time is not important). ...
116 views

Wrong generalized eigenvalues of large numeric matrices

I've been working on a toy model of a variational method of a Hamiltonian H with an overlap matrix S. The point is that when H and S are small enough, Mathematica gives the correct eigenvalues (≈ ...
120 views

TransformedRegion, RegionPlot broken in 10.0.2.0?

After having had trouble applying TranslationTransform to a simple region like so ...
487 views

Graphics3D: Objects with holes

In a recent project, I found out that there is a big limitation when using Graphics3D to construct objects - it lacks the ability to construct objects with holes in ...
162 views

No legends in parametric plot

plotting some descibing functions, I wondered why I don't get any legends in my plot. The describing functions (and options): ...
222 views

Checkerboard background on plot (potentially using prolog)?

Currently I have a plot of a complicated function with gridlines turned on. Is there a way to shade a checkerboard pattern of alternating colors between adjacent grid cells? So far, I have tried ...
26 views

why i cannot get appropriate number with my custom precision? [duplicate]

why i cannot get appropriate number with my custom precision? In[25]:= N[(1 + Exp[-30])/(1 + Exp[-29.9]), 1000] Out[25]= 1. I expect to see a few digits after ...
127 views

How can I change variable passed to a function? [duplicate]

Sometimes I'd like to make a function, which would take an argument "by reference" instead of usual "by value". This is semantically similar to what e.g. AppendTo ...
124 views

How to avoid complex terms in the results given by Integrate?

As shown by In1, integrating Sqrt[x^2 - 1]/(a + x^2) (1/x) returns a result with a complex terms; however, after I make a ...
184 views

Unknown option PlotJoined->True [closed]

I am learning Mathematica (10.0) and tried the following code: ...
66 views

For Loop in Mathematica {n, factored form of x^(n)-1} for 95<=n<=105

I am new to mathematica. I am trying to write a for loop to print out {n, factored form of x^(n)-1} for 95<=n<=105. I have followed the directions of another for loop, and gotten the following ...
128 views

Prevent a sum from simplifying? [duplicate]

Basically, I want to prevent a sum from cancelling or summing together the individual summands and just display them separately next to each other. Example: ...
47 views

Summimg peculiar nestings

I have some lists with peculiar nestings: ...
136 views

How in Mathematica, would I define a function that takes arguments much like one would in an object orientated language

I would know how to write a function in object orientated language, just I don't know how to do this in mathematica, in an OOP I would define a function like this: ...
84 views

Solving a complicated system

Could anybody please make a suggestion how can I implement this program which attempts to solve $2$ dimensional complex system of equations? My computer is not able to solve... After 3 hours the ...
52 views

how can I manage the characters encoding of retun value from FetchURLWithHeaders?

I have retrieved a file from a web server by means of the FetchURLWithHeaders function. The retun value from FetchURLWithHeaders should contains the substring SCHØNHEYDER but instead I find ...
56 views

How to query W|A, to get a list of asymmetric, bicubic and $3$-edge colorable graphs? [closed]

I'm interested in finding graphs with certain properties, like the smallest cubic bipartite asymmetric graph. While working on a related graph-theoretic problem, concerning edge-colrings, I came along ...
210 views

Why can AppendTo modify a referenced list in-place but Part cannot?

Part, AppendTo, PrependTo, AddTo, etc. allow in-place modification of a list, but only Part requires that the list be referenced through a simple symbol, e.g. the following all does what you'ld ...
93 views

How to obtain numerical answer for equation containing integration

Could some one tell me how to obtain numerical value of $a$ and $b$ from equations below: $$\frac{1+exp(b)}{1+exp(0.9a+b)}=0.95$$ $$\int_{0}^{\infty} \frac{1+exp(b)}{1+exp(a x+b)}=1$$
111 views

I have a histogram representing the PDF (probability density function) of an unknown discrete RV. The histogram is asymmetrical. Is there a known way in Mathematica to increase/decrease the variance ...
33 views

Testing for a vector of all reals [duplicate]

I want to test if an expression is a vector of all reals. I defined RealVector[expr_]:=VectorQ[expr,NumberQ[#]&&(Head[#]===Real)]; Trying this on ...
559 views

Finding all sublists or substrings of a given list/string

Given a list or string, how do I get a list of all (contiguous) sublists/substrings? The order is not important. Example for lists: ...
52 views

Retrieve Options from function other than graphics objects

We can retrieve information about used Options for Graphics via: Options[Plot[Sin[x], {x, 0, 1}], "AspectRatio"] (* {AspectRatio -> 1/GoldenRatio} *) even if ...
129 views

calculate missing values, Interpolation

I've following data: ...
128 views

How to make $a1**a2** \cdots **an=0$ for a given $n$?

In order to optimize my computation and save memory, I'd like to modify NonCommutativeMultiply so that for a given $n$ one has $a1**a2** \cdots **an=0$ for any $a1, a2, \ldots, an$. To make it ...
179 views

Localising OptionValues

The documentation on OptionsPattern leaves me with some unanswered questions. From the example section: ...
180 views

How to properly apply NumericQ or s.th. similar here? - NDSolve inside NMaximize

I wrote a function that numerically solves a given Schrodinger equation and returns replacement rules to obtain the time evolution operator. It looks and is used as follows: ...
72 views

How to put a fixed sized frame around traditional form expression

The height of a 2D form of a polynomial changes depending on the existence of exponents, fractional coefficients, etc. For use inside a Manipulate, I would like to ...
301 views

Equivalent of Matlab's uigetfile in Mathematica

I was wondering if there an equivalent of the "uigetfile" Matlab function to use it in Mathematica. To be more precise, I want to read many Excel files and I don't want to type a static path; ...
105 views

Testing for a vector of reals [closed]

Suppose I define: RealVector[expr_]:=VectorQ[expr,NumberQ[#]&&Head[#]===Real)]; Then: ...
130 views

User Input Through Dynamic

For my application, I am using Dynamic functionality to make a number of input fields through which a user can enter numbers. I then take these numbers and place them as the entries in a dynamic ...
232 views

accessing elements of nested list

I have a list of the form: toy = {{a, {b, c}}, {d, {e, f}}, {g, {h, j}}, {k, {m, n}}}; and would like to create the list ...
112 views

Finding x when sin(x) = -.758 [closed]

I'm not understanding how to find all the angles for when sin(x) is equated to a negative decimal can someone explain to me how to find it..? So far I came up with 49.288 degrees, and 229.288 degree. ...
255 views

Inconsistent image sizing with Grid and Row?

Can anyone explain why Row and Grid don't size the image correctly and consistently to 300 ...
523 views

How to create a Disk with smoothly changing coloring?

I want to have a disk. But this disk shouldn't have a fixed color; instead, I'd like it's color to fade smoothly. Until now, I came up with two ideas how to achieve this. Idea #1: ...
168 views

How to sample only odd numbers in the domain of a table for list plot [closed]

The following code samples $k$ points around a circle at integer values starting from $0$: ListPlot[Table[{2 Sin[(2*y/x)*π*n] , 2 Cos[(2*y/x)*π*n}], {n, 0, k}] I ...
59 views

How to Fold (FoldList) this in a more compact (efficient) way?

Example code: x = Table[something[i], {i, 5}] Table[Fold[f1[#1, f2[#2, a], a] &, x[[i]], {c1, c2, c3}], {i, Length[x]}] This above is just an example. I ...
148 views

Incorrect use of Scaled causes crash

Bug introduced in 8.0 and fixed in 10.1.0 While playing with Scaled, I made a syntax error which caused a crash instead of an error message ... Do you get the ...
98 views

Applying the square root of operator on polynomial functions

I am trying to apply an "operation" on polynomial functions: apply the operator \$(\frac{\partial f}{\partial x}-y\frac{\partial f}{\partial z})^2+(\frac{\partial f}{\partial y}+x\frac{\partial ...