Tag Info

New answers tagged physics

0

First, let's rewrite the mean value as the sum of the mean values of the scalar products of the single particle relative positions: \begin{align*}r^2_{e2e} & = \left<\left(\sum_{i=1}^{N-1} \vec r_i\right)\cdot\left(\sum_{j=1}^{N-1} \vec r_j\right)\right>\\ &=\sum_{i=1}^{N-1} \sum_{j=1}^{N-1} \left< \vec r_i\cdot \vec r_j\right>\\ ...

4

Example using vector notation: s = NDSolve[{m'[t] == Cross[m[t], {0, 0, 1}], m[0] == {0, 1, 0}}, m, {t, 0, 1}] Plot[Evaluate[m[t] /. s], {t, 0, 1}] s = NDSolve[{m'[t] == Cross[m[t], {Cos@t, Sin@t, 1}], m[0] == {1, 1, 0}}, m, {t, 0, 10}]; ParametricPlot3D[m[t] /. s, {t, 0, 10}]

1

I believe it is not possible to solve this problem with Mathematica in the presented form. Partly because there inconsistencies in the formulation: Plot[-Log[1 - 16 (Abs[x] - 1)^2], {x, 1 - 1/4, 1 + 1/4}] We see that the potential is, in fact, defined on a larger domain [3/4,5/4] An approximate solution can be numerically obtained using a Monte Carlo ...

2

The step function comes on the right-hand side: i[t] /. NDSolve[{i'[t]/c + r i[t] == UnitStep[t], i[0] == 0} /. {c -> 1, r -> 4}, i[t], {t, 0, 5}]; The plot shows the current as the capacitor is being charged: Plot[%, {t, 0, 5}, PlotRange -> All] You can change the input to something else, for example a SquareWave input shows the capacitor ...

5

Perhaps it's overshooting, but I like this way: RC = 4 Vin = 2 s = NDSolve[{It'[t] + (1/RC) It[t] == q[t], It[0] == 0, q[0] == 0, WhenEvent[t == 10, q[t] -> 1]}, It, {t, 0, 30}, DiscreteVariables -> q] Plot[Evaluate[It[t] /. s], {t, 0, 30}, PlotRange -> All]

1

Just start integrating at $t_0$ instead of $0$. If you are hell-bent on getting the integrator to do nothing from $0$ to $t_0$, then use the UnitStep[] function.

Top 50 recent answers are included