20 votes
Accepted

An efficient way to translate a triple for-loop from Matlab to Mathematica

Okay, let's focus on this snippet: ...
Henrik Schumacher's user avatar
18 votes

The Lotka-Volterra predator-prey model

The dimensional phase-space plot The analysis of the predator-prey model is incomplete without the phase-space plot. So, here it is, ...
zhk's user avatar
  • 11.9k
12 votes

For Loop and Sum

Anyone asking you to write For loops in Mathematica for such a problem is a dolt. Nevertheless, here's how you might do that: ...
High Performance Mark's user avatar
11 votes
Accepted

Particle moving on curve which is the intersection of a surface and a plane

You can use MeshFunctions to visualize the intersection. The following is one way to parametrize curve. ...
ubpdqn's user avatar
  • 58.3k
11 votes

How to plot trajectories of the Rossler System

You could try NDSolve then ParametricPlot3D ...
Nasser's user avatar
  • 135k
10 votes

Area of volume of revolution

r = ParametricRegion[{r Cos[ϕ], Sin[ϕ] r, Sqrt[28 r]}, {{r, 0, 21}, {ϕ, 0, 2 π}}] Area[r] 49/2 π (14 Sqrt[3] - ArcSinh[...
Rom38's user avatar
  • 5,099
10 votes

How to solve Laplace transform question for a system in Mathematica

...
rmw's user avatar
  • 1,765
9 votes

Plotting the solutions of $y' = -\frac{\cos y}{\sin x}$

This is just a suggested amendment to JasonB's answer. It wasn't clear to me that it deserves a separate answer, since it deals with side issues tangentially related to the OP's question. It's easier ...
9 votes

Find the square root using a recursive formula

...
Bob Hanlon's user avatar
  • 149k
8 votes
Accepted

Plotting Graph of Zeno paradoxes

You'll learn more trying to understand the following code than by programming silly Do[ ]s ...
Dr. belisarius's user avatar
8 votes
Accepted

How do I plot a Laplace transform?

Copying your exact code ...
nufaie's user avatar
  • 1,081
7 votes

Exercise using Sort

Using your code, let me make it clear by introducing an auxiliary function that sums the exponents in an expression ...
halirutan's user avatar
  • 112k
7 votes

Plotting the solutions of $y' = -\frac{\cos y}{\sin x}$

I may not be understanding the question correctly, but if you wish to show the stream field under solutions, perhaps this is a method: ...
Jason B.'s user avatar
  • 67k
7 votes

How can I make a pretzel shape using Bézier curves?

You can use a LocatorPane to edit the control points (at least in 2 dimensions) and see the curve change in real time: ...
Niki Estner's user avatar
  • 35.9k
7 votes
Accepted

Plot: 2D potential vortex embedded in 2D uniform flow

...
David G. Stork's user avatar
7 votes
Accepted

Strange determinant result

Det[{{0, 1/v, 0, -k12/v^2}, {0, 0, 0, -1/v^2}, {k12, k01, 0, 0}, {1, 1, 1, 0}}] (* k12/v^3*) Laplace ...
Ulrich Neumann's user avatar
7 votes

How to check whether Laguerre polynomials are orthogonal?

Integrate[LaguerreL[i, x] LaguerreL[j, x] Exp[-x], {x, 0, Infinity}, Assumptions -> Element[{i, j}, Integers] && j > i > 0] 0 ...
kglr's user avatar
  • 378k
7 votes

Euler's method initial value problem — how should I plot the solution?

Euler's method to solve, plot, and compare to known solution: $y^\prime = te^{3t}-2y, \quad y(0)=0, \quad 0 \le t \le 1. $ ...
mjw's user avatar
  • 2,046
7 votes

Adams-Bashforth method implementation code review

There are typos in the code, and after minor correction we have ...
Alex Trounev's user avatar
  • 41.2k
6 votes

Check homework integration in Mathematica

As noted, Boole[] is the go-to method for older versions of Mathematica. Now, thanks to version 10's support for regions, one can easily enter ...
6 votes
Accepted

Poisson point distribution

This question was largely dealt with in the comments. I post this for illustrative purposes (but mainly fun): The following shows use of PoissonProcess and its use ...
ubpdqn's user avatar
  • 58.3k
6 votes
Accepted

Use Select to filter a dataset's sublists

dataq[Select[AnyTrue[#c, EvenQ] &]]
Quantum_Oli's user avatar
  • 7,839
6 votes
Accepted

Numerical approximation using trapezoidal formula

The error for the trapezoidal rule is So in your case: ...
Dr. belisarius's user avatar
6 votes

Implicitly defined curve

First find the y values like Carl Woll proposed. ...
Akku14's user avatar
  • 17.2k
6 votes
Accepted

Rationalize number

Use Minimize with a condition that avoids the divergence to $-\infty$: Minimize[{f[x], x > 5}, x] {(-5 + 2 Sqrt[5] +...
Marius Ladegård Meyer's user avatar
6 votes
Accepted

Area of volume of revolution

It seems that f[x] is evaluating to a number. Probably you Set an OwnValues for ...
rhermans's user avatar
  • 35.9k
6 votes
Accepted

Infinite While loop

The crux of the matter is how n is changed on each iteration. Math Consider a multi-digit integer $n = a_1 a_2 a_3 \ldots a_N$, where $a_k$ is the $k$-th digit of ...
NonDairyNeutrino's user avatar
6 votes
Accepted

Analyze stability of equilibria using Routh-Hurwitz conditions

There are "modified Routh-Hurwitz criteria" that work directly on the Jacobian matrix that I prefer and don't seem very well known (Fuller 1968). Here's a function I wrote that uses them for up to ...
Chris K's user avatar
  • 19.4k
6 votes

How can I animate two beads each sliding on its own frictionless rail?

If there are no restrictions on r, x, then the solution is ...
Alex Trounev's user avatar
  • 41.2k

Only top scored, non community-wiki answers of a minimum length are eligible