Community RSS Feed
http://community.wolfram.com
RSS Feed for Wolfram Community showing any discussions in tag Physics sorted by activeSolve a coupled second order differential equations of two variables?
http://community.wolfram.com/groups/-/m/t/1511565
Hello friends!!
I want to solve coupled two second order and one first order differential equations of two variables
and want to plot 3D graph. My code is attached and it is giving errors.
Kindly help me to remove the errors.shivi sv2018-10-14T15:01:18ZOutput error
http://community.wolfram.com/groups/-/m/t/1511197
I am new to Mathematica and still learning the language. I have question involving a mass -spring system and need to solve a second order ODE for multiple points at multiple times but can't write it properly. Please help the question and code written is attached.![enter image description here][1]Areeb Qureshi2018-10-14T14:37:36ZSpeed up evaluation of this integral?
http://community.wolfram.com/groups/-/m/t/1508724
I am trying to evaluate the integral
$$ \int_0^{2\pi}\frac{D_{11}^2+2D_{12}^2+D_{22}^2+D_{33}^2}{1+e\cos x(t)}dx $$
Where $D_{ij}$ are third derivatives wrt $t$ as defined below.
a[psi_] := k1/(1 + e*Cos[psi]);
d[psi_] := p1/(1 + e*Cos[psi]);
D11 = D[a[x[t]]*(Cos[x[t]]^2 - 1/3), {t, 3}];
D12 = D[a[x[t]]*Cos[x[t]]*Sin[x[t]], {t, 3}];
D22 = D[a[x[t]]*(Sin[x[t]]^2 - 1/3), {t, 3}];
D33 = D[-a[x[t]]/3];
To do this I have written the input
Assuming[Element[k1, Reals] && Element[e, Reals] &&
x'[t] == p2/(d[x[t]]^2) && Element[p2, Reals] &&
Element[p2, Reals],
Integrate[(D11^2 + 2*D12^2 + D22^2 + D33^2)/(1 + e*Cos[x[t]])^2, {x[
t], 0, 2*Pi}]]
This is taking a very long time to evaluate (has been running for hours), is it OK to specify to *Mathematica* that I have the condition $\dot{x}=\frac{p_2}{d(x(t))^2}$ in this manner? How could this be sped up?
This integral arose in the study of the loss of energy of an orbiting mass due to gravitational radiation.tom ri2018-10-12T18:24:18ZSubdividePoints
http://community.wolfram.com/groups/-/m/t/1511449
MIT's [MPB](https://mpb.readthedocs.io/en/latest/) and [MEEP](https://meep.readthedocs.io/en/latest/) programs have a very interesting function called **interpolate** (and a variant **kinterpolate-uniform**), which basically creates points between a set of points, working like the Mathematica's `Subdivide` function.
Unfortunately `Subdivide` does not work with more than two vectors, subdividing only the endpoints. We can easily extend this behavior with the new functions:
SubdividePoints[pts_List?MatrixQ, n_Integer] := Block[{pt},
pt = Flatten[Table[
pts[[i]]*(1-t) + pts[[i+1]]*t
, {i, Length@pts-1}, {t, Subdivide[0,1,n+1]}]
, 1];
pt = Delete[pt, Position[Norm /@ Differences@pt, 0]]
]
And the another one for a uniform coverage.
SubdividePointsUniform[pts_List?MatrixQ, n_Integer] := Module[{L, m, pt},
L = (Norm /@ Differences@pts);
m = Round[L/Min[L/n]];
pt = Flatten[Table[
pts[[i]]*(1-t) + pts[[i+1]]*t
, {i, Length@pts-1}, {t, Subdivide[0,1,m[[i]]+1]}]
, 1];
pt = Delete[pt, Position[Norm /@ Differences@pt, 0]]
]
A simple example of usage would be creating points in the Brillouin zone of a square:
pts = {{0,0}, {1,0}, {1,1}, {0,0}}/2;
SubdividePoints[pts, 3] // ListPlot
SubdividePointsUniform[pts, 3] // ListPlot
![img][1]
[1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=2018-10-14_134741.png&userId=845022Thales Fernandes2018-10-14T16:49:39ZSimulate the motion of the Earth around the Sun based on Kepler's Law?
http://community.wolfram.com/groups/-/m/t/1500089
I am using Mathematica 10.3. I want fo perform a computational analysis of the motion of the Earth around the sun based on Keplerâ€™s laws.
Here is my code so far.
eulerStep[{t_, state_List}, h_, f_List] := {t + h,
state + h Through[f[{t, state}]]}
solveSystemEuler [{t0_state0 _}, h_, n_Integer, f_List] :=
NestList[eulerStep[#, h, f] &, {t0, state0}, n]
midptStep[{t_, state_List}, h_, f_List] := {t + h,
state + h Through[
f[{t + 1/2 h, state + 1/2 h Through[f[{t, state}]]}]]}
solveSytemMidPt[{t0_, state0_}, h_, n_Integer, f_List] :=
NestList[midptStep[#, h, f] &, {t0, state0}, n]
L = 1/2 m (x'[t]^2 + y'[t]^2) + GMm/Sqrt[x[t]^2 + y[t]^2];
D[D[L, x'[t]], t] - D[L, x[t]] == 0
D[D[L, y'[t]], t] - D[L, y[t]] == 0
xdot[{t_, {x_, vx_, y_, vy_}}] := vx
vxdot[{t_, {x_, vx_, y_, vy_}}] := -x/(x^2 + y^2)^(3/2)
ydot[{t_, {x_, vx_, y_, vy_}}] := vy
vydot[{t_, {x_, vx_, y_, vy_}}] := -y/(x^2 + y^2)^(3/2)
start = {1, 0, 0, 1};
fcns = {xdot, vxdot, ydot, vydot};
orbit = solveSystemEuler[{0, start}, 0.01, 800, fcns];
<< Statistics`DataManipulation`
xypts = Column[Column[orbit, 2], {1, 3}];
ListPlot[xypts, PlotJoined -> True];
Running the program gave the following error messages.
![enter image description here][1]
Please help me to fix my code.
[1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Capture.JPG&userId=1499975Senlau Minto2018-10-08T03:45:10ZOutput the numerical expression of a function?
http://community.wolfram.com/groups/-/m/t/1508874
I am a Mathematica beginner working on a problem in the area of quantum mechanics. I adapted [this][1] source code (also attached below) to work with the problem I'm trying to solve. At present, the graphics produced by the code tell me most of what I need to know, but I would like to know how to get Mathematica to output the numerical expression for the wavefunction \[Psi][x].
If someone can take a look at the source code I attached (my own code is quite similar save for a few numerical modifications) and illuminate how to get a numerical expression for Psi, I'd be quite grateful.
I am sure there is a simple solution to this that my lack of Mathematica knowledge is preventing me from seeing. My apologies if this seems like a stupid question, but any help would be greatly appreciated.
Edit: I also posted this question to the Mathematica Stack Exchange forums, and I did not properly link the cross post, which can be found [here][2].
[1]: https://demonstrations.wolfram.com/QuantumWellExplorer/
[2]: https://mathematica.stackexchange.com/questions/183731/how-can-i-get-a-numerical-value-from-a-functionSebastian Perez2018-10-12T23:57:15Z