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

learn more… | top users | synonyms (1)

4
votes
1answer
92 views

Determining the range of parameters that yield real values for a certain NIntegrate form

I have specified just one set of $s$ and $g$ values that yields a real value for the NIntegrate below. It is possible that some $s,g$ combination can give rise to ...
2
votes
1answer
44 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 ...
1
vote
2answers
174 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, ...
1
vote
1answer
92 views

NDSolve fails for certain choices of parameters and solve range

I'm trying to solve a pair of coupled ODEs with NDSolve. I know roughly what the solution should look like (both should give periodic functions, pi/2 out of phase, the amplitude of which damp towards ...
1
vote
0answers
42 views

Error when extending 1-dimensional PDE to 2 dimensions

I want to calculate how magnetic flux is trapped in a superconductor near the interface superconductor/vacuum. This problem already was solved analytically by J. Pearl for cylindrical symmetry (if ...
9
votes
2answers
349 views

FEM: Nicer Element Shape for Spherical Region

I'm trying to generate a mesh for later use in the Finite Element Method of the DSolve command. It is basically a parallelepiped with a spherical indentation. I'm ...
6
votes
1answer
239 views

Optimizing Monte Carlo simulation of a Pred-Prey model

My assignment and code As part of an assignment for one of my classes, I'm trying to run a "massive" Monte Carlo simulation in Parallel on the follow model: ...
3
votes
1answer
63 views

How to implement something like NMaximize[ NMinimize [ f(x,y) , {x} ], {y} ]?

Title says it all, really. I want to find some set of values for which a function of those values can't be made larger than a certain number, when some other values (on which that function is also ...
0
votes
0answers
45 views

How to deal with matrices involved in system of SDEs?

This question is in continuation of the the previous posts Solving Stochastic differential equation and Fast Simulations with Compile. What I want to do is numerically solving the epidemic model which ...
3
votes
3answers
101 views

Solving determinant of a Kronecker product of matrices gives a numerical error - why?

I am doing the following steps (code at the end of the post): I start with a 2x2 matrix (smatrix), which is a function of a single variable (u2). I want to set the determinant of this matrix ...
3
votes
1answer
108 views

Bad numerical approximations

I'm trying to do some calculations here, but for some reason Mathematica starts using numerical approximations that are no good for my work. Specifically: ...
6
votes
3answers
86 views

Numerically integrating a list-valued function [duplicate]

I want to NIntegrate a List valued function foo[x] which is only defined for numerical ...
-1
votes
1answer
99 views

Navier–Stokes equations [closed]

how write Stokes equation in mathematica? the Stokes equation is in in this link http://en.wikipedia.org/wiki/Navier-Stokes_Equations
5
votes
2answers
221 views

how to solve ODE with boundary at infinity

y''[x]-x y[x]==0 y[0]==AiryAi[0], y[infinity]==0 the analytic solution to this ODE is the Airy function y[x]=AiryAi[x] if I ...
1
vote
0answers
148 views

Problem with NDSolve in Mathematica 9 / 10

I'm having trouble by solving the following differential equation in Mathematica 9 and 10, where the code works fine in version 7: ...
2
votes
1answer
116 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} ...
1
vote
1answer
89 views

Whats the most efficient way to solve an equation numericaly (because it has no analitical solution)

So, I think the problem that Im having is simple but, still, Im not sure on how to do it. I have an equation with no analitical solution: $a_1 \sin \left(2 \theta \right)+a_2 \sin \left(2 ...
1
vote
2answers
117 views

Higher derivative [closed]

Is there more efficient way to rewrite this code in order to compute 2nd and higher derivatives of r=sqr{x^2+y^2+(z-a)^2}? ...
1
vote
1answer
64 views

How to solve the warning problem and obtain real roots without imaginary part?

I am trying to solve a equation with Newton's method via FindRoot, and the codes are: Define the functions: ...
1
vote
1answer
44 views

How to get only the real solutions of an equation? [closed]

Is there any simple way to get only the real solutions of the eq. x^3-1=x? I've tried: Solve[x^3-1==x,x] But it gives the complex ones, too. I have Mathematica ...
2
votes
1answer
85 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: ...
35
votes
2answers
1k views

Numerically solving Helmholtz equation in 2D for arbitrary shapes

I would like to solve the Helmholtz equation with dirichlet boundary conditions in 2 dimensions for an arbitrary shape. (for a qualitative comparison of the eigenstates to periodic orbits in the ...
17
votes
1answer
182 views

BitShiftRight produces incorrect results in Version 10

With Mathematica 10 for Mac, BitShiftRight works properly on lists of up to 100000 numbers, but appears to give incorrect results when threaded over lists of 100001 ...
2
votes
0answers
69 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}, ...
14
votes
1answer
283 views

How can I mend this broken heart?

Try to evaluate the following code: ...
0
votes
0answers
67 views

Plotting Geodesics in Kerr

I'm interested in plotting the trajectories of null geodesics near a rotating black hole (given by the Kerr solution) which involves a system of first order differential equations. Some Context (not ...
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
102 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
85 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: ...
1
vote
0answers
52 views

on convergence in optimization [closed]

I am trying to solve a nonlinear programming problem using FindMinimum solver on Mathematica. When I execute, it is printing FindMinimum::eit: "The algorithm does not converge to the tolerance of ...
2
votes
2answers
148 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 ...
0
votes
0answers
69 views

NMinimize gives an obvious wrong value

I'm trying to minimize a function of 2 lists of the same lenght, but for now the first list has one element, the second is constant. Essentialy, this baffles me: ...
1
vote
1answer
47 views

How to make a discretized NMinimize more precise

I am using Mathematica for physics research and I want to minimize a Hamiltonian equation with respect to two variables (I have also discretized the problem). I have a single constraint. When I plot ...
0
votes
1answer
68 views

Find exact value

I want to know exact x'[t] value where z[t]=0 I know approximate x'[t] value is 107 but I cannot find how to find exact x'[t] value ...
4
votes
1answer
182 views

Using NDSolve to solve Equation of Motion in cylindrical coordinates

I have a set of coupled differential equations which represents the equation of motion of a particle in cylindrical coordinates with the following Hamiltonian: $$ H=\frac{1}{2m} \left( p_r^2 + ...
1
vote
1answer
82 views

FindRoot with vector functions

I'm trying to solve a system of non-linear equations with FindRoot, and I get the answer, but also a ...
0
votes
0answers
34 views

NIntegrate Issue: Changing integration limits makes calculation time extremely long

After a long time developing some code in mathematica and finally getting it to work, I have unfortunately encountered an odd problem: When I change the limits of integration (and shift the function ...
1
vote
0answers
61 views

Solve set of non-linear equations with least-squares-fitting - constrain results?

I'm trying to solve a set of functions to determine the material properties from a set of measurement values. (To set up this method I just want to fit my model with some already calculated data). My ...
0
votes
1answer
190 views

how to solve second order nonlinear coupled differential equations using NDSolve with hyperbolic function

i have to solve some solitons scattering through this coupled equations. i need to get two different graph, but still the graph did not come out. and also the equations quite complicated containing ...
0
votes
1answer
131 views

Is this function convex?

How can I determine convexity of the function f = Log[ x, 1 + (x^a - 1) (x^b - 1)/(x - 1)] with the parameters $a,\,b$ belonging to the interval $(0,1)$ in ...
6
votes
3answers
311 views

RK4 Gravity Simulator

I have the following RK4 solver which splits the two 2nd order ODEs, used to calculate x and y positions under the influence of a gravitating body where $$x''(t)=\frac{G m ...
2
votes
1answer
133 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 ...
1
vote
0answers
51 views

How to find a scaling parameter in matrix inversion process by MMA?

I simply would like to find the inverse of a given matrix $A$ by the iterative method $X_{k+1}=X_k(2I-AX_k)$ using $X_0=\frac{1}{\sigma_{max}^2}A^*$. An example is as follows ...
5
votes
3answers
206 views

Numerical evaluation of a sum

I am trying to compute numerically NSum[(-1)^n/n^3, {n, 1, Infinity}]. Of course, using first Sum would work here, but often ...
0
votes
1answer
113 views

Solving for the time-evolution operator in a periodically driven system

I am looking at the Hamiltonian $$H(t)=\begin{pmatrix} 0 & e^{i\Omega t}\\ e^{-i\Omega t}& 0\end{pmatrix}$$ I am trying to solve for the unitary operator $U(t,0)=\mathcal{T}\exp(-i\int_0^t ...
0
votes
2answers
153 views

find the real root

I have the following equation: \begin{equation} (y-1)^{b1} - C~~ y~~ \exp(a x)=0 \end{equation} where $a, b$ are real constants, $C$ may be a complex number. I need to find the real solution of the ...
0
votes
1answer
76 views

Numerical vs Symbolic Integration: Loss of precision

I am trying to integrate the following expression over the time interval $0\leq t \leq \text{period}$. ...
1
vote
1answer
138 views

Runge-Kutta 2nd Order ODE Solver

Suppose I have a 2nd order ODE of the form y''(t) = 1/y with y(0) = 0 and y'(0) = 10, and ...
0
votes
1answer
98 views