7,272 reputation
11545
bio website
location
age
visits member for 2 years, 7 months
seen 40 mins ago

Jul
17
comment What is the right way to write a function that includes other functions?
Now that you've clarified the question: You're overcomplicating this! You can just write it the way you wrote it in math: b[x_] := 10 x; w[x_] := s + b[x]; c[x_] := x^2; u[x_] := w[x] - c[x]
Jul
16
revised how to create a slope field in mathematica?
edited tags
Jul
16
comment Issue with PieChart3D in Version10. Is it Mac specific?
I'm running Mathematica 10 on Mac OS X 10.9.4 (64-bit) and I'm afraid I do not see this problem...
Jul
16
comment Does FindFit support complex numbers or doesn't it?
@seismatica: In principle it is equivalent to minimize the total squared error or the square root of it, because the square root function is monotonic. However, from a numerical optimization perspective, it is better to minimize the total squared error directly, because it is smooth, quadratic, and generally well-behaved, while its square root is not as nice. That might be why the fitting is slow to converge when the square root is taken.
Jul
15
comment Infinite expression encountered when simplifying ArcTan sums although the result is finite
For what it's worth, the value of $\tan^{-1}x+\tan^{-1}(1/x)$ is not simply $\pi/2$ but $\begin{cases}\pi/2&\text{if $x>0$}\\-\pi/2&\text{if $x<0$}\end{cases}$
Jul
15
comment Fitting fractional complex data with NonlinearModelfit
Here's why NonlinearModelFit on complex data sometimes works and sometimes doesn't: mathematica.stackexchange.com/a/54876/484
Jul
15
comment Does FindFit support complex numbers or doesn't it?
@seismatica, halirutan: NormFunction -> (Re[#].Re[#] + Im[#].Im[#] &) seems to work better.
Jul
15
comment Does FindFit support complex numbers or doesn't it?
@Alexey: Ah, thanks for the link. I hadn't looked at that question carefully before; it does look like a duplicate. Although none of the answers there have realized why FindFit works in some cases but not in others, as Jens's answer here explains.
Jul
15
accepted Does FindFit support complex numbers or doesn't it?
Jul
15
comment Does FindFit support complex numbers or doesn't it?
The strangeness is that FindFit can determine the appropriate norm function in some cases but not in others.
Jul
15
asked Does FindFit support complex numbers or doesn't it?
Jul
15
comment How to make a discretized NMinimize more precise
The first thing I'd try is to increase MaxIterations.
Jul
14
revised How to find valleys of data using new function in V10 PeakDetect
edited tags
Jul
13
comment How can I modify the interval of the function Image[]?
Rescale[..., {-1, 1}] doesn't work for you?
Jul
13
comment How to construct a polyhedron from its vertex graph?
Slightly off-topic, but can you verify whether this sentence of the Wikipedia article is incorrect? "For a Tutte embedding, assigning attractive forces of equal magnitudes to all edges makes the forces cancel at all interior vertices..." But for the vertex to be the barycenter of its neighbours, the forces have to have magnitude proportional to the length of each edge instead.
Jul
12
comment Backsubstituting solution into FindRoot and Plot
Perhaps this should be a new question?
Jul
12
revised Backsubstituting solution into FindRoot and Plot
put the plots back
Jul
12
comment 3D Plot from 3 Polynomial Equations
You can do sol0 = Solve[f0[λ0, y0, y1, x, k] == 0, λ0] and sol0 = Solve[f0[λ0, y0, y1, x, k] == 0, λ0] to find the values of $λ_0$ and $λ_1$ that satisfy $f_0 = 0$ and $f_1 = 0$ respectively. Then substitute them into $f_2$ via sol2 = f2[λ0, λ1, x, k] /. sol0 /. sol1 // Flatten to get something that only depends on $x$, $k$, $y_0$, and $y_1$. However, there are apparently eight different solutions each to $f_0 = 0$ and $f_1 = 0$, so you'll end up with 64 possible values of $f_2$.
Jul
12
comment Why does FindFit seem to have trouble fitting exponential data?
Is the only difference between FindFit and NonlinearModelFit the fact that the latter provides more statistical information, or is there anything deeper than that?
Jul
12
comment Why does FindFit seem to have trouble fitting exponential data?
Try providing a reasonable initial guess: fit = FindFit[data, model, {{a, Last@Mean[data]}, {k, 1/First@Mean[data]}}, t]