Questions on the numerical functions of Mathematica, implementing numerical methods and numerical computing with Mathematica.

learn more… | top users | synonyms (1)

3
votes
0answers
176 views

LeastSquare Solution for the Continuous Time Lyapunov Equation

I have been working with a problem which involves solving the continuous time Lyapunov equation $$A R + R A^\top = G$$ for the symmetric positive definite matrix $R$. Here $A$ is real, invertible ...
2
votes
4answers
277 views
2
votes
2answers
412 views

Unexpected result of summation

I wrote small module that gives me incorrect output-set, it should be a single number! I don't understand what went wrong. This is the form of summation used: $$\frac{1}{2} (b-a) \sum_{i=1}^n ...
2
votes
2answers
234 views

Position function not always retuning an answer even with no apparent problems

I'm having some problems with Position. Sometimes it will give an empty list instead of the actual position of the element I am looking for when that element is ...
2
votes
2answers
153 views

A problem about function N [duplicate]

Toady,I have a problem about N,described as below: For example N[1/3, 5] (* ==> 0.33333*) and ...
2
votes
1answer
240 views

Different Poincaré maps for same Equation

I've seen the Wolfram Poincaré example. I'd like to modify this sample in order to have a list of Poincaré maps. In the example the event is captured only when ...
2
votes
1answer
2k views

Forcing FindRoot to return only real solutions

FindRoot documentation reports that if the equation and the initial point are reals, the solutions are searched in the real domain. However, in the following case I ...
2
votes
2answers
417 views

Quickly differentiate and evaluate a function of several variables

How can I differentiate a function with respect to several variables and evaluate it at the same time ? I want to specify also the variable index that I want to differentiate and the number of times I ...
2
votes
2answers
363 views

Plotting several numerical solutions plus the analytic solution of ODE in one plot

I want to be able to plot several numerical solutions of an ODE plus its analytical solution in one plot in order to see how the numerical solutions converge towards the analytical one w.r.t. the ...
2
votes
1answer
47 views

Improving working precision of LegendreP[n,x]? [duplicate]

I was trying to evaluate N[LegendreP[5,0.1]] The cell gives me: N[LegendreP[5,0.1]]=0.178829 However I wanted more ...
2
votes
1answer
400 views

How to solve simultaneous equations faster with Compile?

I have large 6x6 matrix Uwhich is a multiplication of 15 rotational matrix. All of the elements are Sin\[theta] and ...
2
votes
1answer
92 views

How to determine Fixed Point of a function? [closed]

A function is defined as f[x_]=Sqrt[1-x^2]. How can I determine the fixed point of f? I've tried this: ...
2
votes
1answer
162 views

Area between Contours in ContourPlot

I feel slightly foolish for asking this because I am so close, but I'm having trouble, so I will anyway. I asked this question two days ago regarding finding the lengths of contours. Now, I'd like to ...
2
votes
2answers
171 views

How to solve this numerically?

May I ask what is the best way to evaluate ...
2
votes
1answer
122 views

Decomposing a diagonal positive real matrix

I would like to 'decompose' a diagonal positive real matrix $E$ of rank $D$ onto $\sum_{i=1}^{D}c(i)N^i$: $$E = \left( \begin{array}{ccc} 0 & & & \\ & a & & \\ ...
2
votes
1answer
202 views

Mathematica 7: Problems when evaluating Fourier inside a ParallelTable

after I got such a great response for my first question on this site, I'm very encouraged to asked my second one! So here it is, very generally: To speed up a "row-wise" (i.e. 1D) operation on a ...
2
votes
1answer
194 views

Numerical comparisons of matrices

I have a matrix which should be equal to a null matrix. However due to the numerical precision, a brutal equality test with a matrix initialized with zeros does not work. How should I perform the ...
2
votes
2answers
190 views

How do I feed data points into an equation to solve NUMERICALLY?

I start with this equation and solve it numerically for $z(x,y)$ in the range $1 < x < 5$ and $1 < y < 5$: $$ \frac{3}{xyz} - 2x - 3y - 5z = 0 $$ Then using the data points of $z$ above, ...
2
votes
1answer
84 views

NIntegrate Warning / Error Messages

I am doing: NIntegrate[Sin[Exp[(x^4)]], {x, 2, Infinity}, PrecisionGoal -> 12] It prints out a host of warnings, but also shows the results as: ...
2
votes
1answer
128 views

Fourier Transform Help

I'm trying to do a Fourier Transform of the following Data, but I'm completely stuck. Here's what I've done so far: ...
2
votes
1answer
163 views

Numerical errors/inaccuracies in ProductLog

Context In cosmology, a fairly accurate model to describe the gravitational potential, $\psi(r)$ of dark matter halos is given by $\psi( r)=\log(1+r)/r$. ...
2
votes
4answers
174 views

Padding and formatting within BaseForm

I find using BaseForm to be a little tricky. For example, if you use BaseForm and then do some additional operation all the numbers turn back into base 10, so you have do BaseForm as the "last step". ...
2
votes
2answers
141 views

Incorrect numerical derivative of function that uses FindRoot

I am trying to plot the derivative of function g[x] below where g[x] is defined as the root of another equation. However, I am ...
2
votes
1answer
94 views

Use Mathematica to determine the falling law

We have a one-variable equation $\rho(R)$ where ρ = (14656.4+277.526*R^2)/(45.9225+R^2)^{5/2} + 0.370036/(R*(0.25+R)^3) This equations describes the evolution of ...
2
votes
1answer
117 views

How can I reduce computation time while still obtaining a good approximation for my function?

I am new to any CAS (and Mathematica, for that matter) and new to StackExchange too, so forgive me and correct me on any mistakes. I have this function: $J_p=\sum_{m,n=1}^{\infty} ...
2
votes
1answer
106 views

Mathematica unable to solve equation numerically while Wolfram|Alpha can

I want to solve the following equation 2 x == Sinh[x] Mathematica is unable to do so ...
2
votes
1answer
143 views

Euler's method for a 2nd order ODE

This is my first post on this site. Also, I'm new to Mathematica. I'm trying to solve my first problem with Mathematica. It's about solving a 2nd order differential equation. I dont have the explicit ...
2
votes
1answer
41 views

Results of ArgMax as a function of a parameter with InterpolatingFunctions

I would like to obtain a function and its derivatives, where the function is defined as the solution to a maximization problem. The obvious approach ...
2
votes
1answer
122 views

Read C-formatted hexadecimal numbers?

I have a lot of 32-bit numbers in hexadecimal symbolized as they are in C (for example, 0x1230abde). How can easily read these in Mathematica?
2
votes
1answer
240 views

How to make Mathematica try harder to perform symbolic comparisons?

(I suspect this question is a duplicate, but I didn't find a sufficiently similar question with an answer to it.) I'm having trouble with comparisons of symbolic ...
2
votes
2answers
302 views

Strange Behavior of NDSolve

I am trying to evaluate the following ODE numerically: ...
2
votes
1answer
686 views

Plot FindRoot for non-trivial function

I would like to plot the results of FindRoot over certain range of inputs. I tried to do this with the code: ...
2
votes
1answer
290 views

How can I handle curve singularity in this NIntegrate integration?

Yesterday I asked a question about the non converging integral. Woods told me that it is due to the function which has a singularity along a line which passes through the integration region. (Why ...
2
votes
1answer
178 views

Computing derivatives of a moment generating function

Dear Mathematica users, I'm trying to compute higher order derivatives of a moment generating function and then evalutate them in 0 (in order to get some moment conditions for a GMM estimation). ...
2
votes
1answer
86 views

Numerical evaluation of ChebyshevT

When I evaluate the following Chebyshev series of the first kind in two different ways, I get two very different results: ...
2
votes
1answer
158 views

Numerical Integration with Variable Parameters

So I want to numerically compute the integral of a long complicated expression over a specified domain (in this case an ellipse). I know how to use a Boole function to sample within the ellipse, but I ...
2
votes
1answer
75 views

Convert Integer to Numeric with Replacement rules

I have a long list of triples, each looking something like {AGO, 1988, 2345.23}. Some of these, however, have an integer in the third spot, like this: ...
2
votes
1answer
234 views

Animated Wave Propagation using Fourier & InverseFourier

This is a continuation off of previous help on the first part of my project: fourier issue arising from input miscommunication Now I want to go one step further in the current code. Here's the code ...
2
votes
1answer
134 views

Strange behavior when replacing variables by numerical values [duplicate]

I have a rather complicated function with parameters {a, b, c, d, e, f, k}, and I'd like to know its behavior as a function of k alone given other parameters, so I try the following code: ...
2
votes
1answer
455 views

Tutorial for basic numerical methods for PDEs

I'm afraid this is probably not going to be a "good" question, but I'd like to use Mathematica to learn about basic numerical schemes for solving pdes. For example, I'd like to compute the solution of ...
2
votes
1answer
748 views

How to solve equations self-consistently

I want to solve the following equation self-consistently. So, H.u = e.u {{1, d}, {d, 1}}.{u1, u2} = e.{u1, u2} I guess an initial value for ...
2
votes
1answer
511 views

intersection between two curves in Mathematica

I have two curves (drawn from points) in a plane, one is drawn with ListLinePlot and the other drawn with ParametricPlot. How ...
2
votes
1answer
641 views

NDSolve runs out of memory

I need to solve a second order ODE numerically. The ODE depends on two parameters (a,b). Things work fine when 'a' is small, but for large 'a' the solutions are oscillating rapidly and Mathematica ...
2
votes
1answer
86 views

Finding a root of a parameterized integral

I have a function given as a parameterized definite integral: f[a_] := Integrate[BesselJ[0, x - a] BesselJ[0, x + a], {x, -∞, ∞}] I suspect it has a root near ...
2
votes
1answer
63 views

Why is left NumberPadding always applied in NumberForm?

I would like to display numbers like 9.0001 and 10.0001 in the fixed-width form of xx.xxxx. ...
2
votes
2answers
80 views

Forcing RecurrenceTable + NIntegrate to evaluate lazily

I have a recurrence relation that grows exponentially if expressed in closed-form. I need to integrate this function. If I plot it, I think Mathematica evaluates the recurrence numerically at every ...
2
votes
1answer
212 views

How can I numerically solve for fractional functions and fractional derivatives?

I would like to plot fractional functions. Say $f=(\sin)^{1/2}(x)$. By that I mean that $f(f(x)) = \sin(x)$. Similarly I can define a half-derivative to be an operator such that $H[H[f(x)]] = ...
2
votes
1answer
247 views

Problem with Covariance Matrix Output in NonlinearModelFit

I am running NonlinearModelFit based off of some simulated data and trying to fit to a function with more than one parameter. Eventually, I would like to fit to 5 ...
2
votes
0answers
70 views

How to handle infeasible points in FindRoot?

I am calling FindRoot[f[x,y],{{x,xInit,xMin,xMax},{y,yInit,yMin,yMax}}] where for some points {x,y}, ...
2
votes
0answers
63 views

Complicated output from simple Eigenvalues problem

I have code that uses Eigenvalues on matrices of various sizes. But the output of what should be a very simple problem, namely finding the eigenvalue of a 1x1 matrix, is overly complicated. ...