Am I seeing a particle orbiting a Morris-Thorne Wormhole?

I tried to calculate the time-like geodesics of the Morris-Thorne Wormhole $ [1]$ , $ [2]$ , $ [3]$ for redshift function $ \Phi(r) = 0$ and $ b(r) = \sqrt{r_{0} r}$ . But I don’t know for sure if all the plots that I made are correct.

So, the metric is:

$ $ ds^2 = -e^{2\Phi(r)}dt^2+\Biggr\{ 1-\frac{b(r)}{r}\Biggr\}^{-1}dr^2+r^2[d\theta^2+sin^2(\theta)d\phi^2]\tag{1}$ $

And the plots are:

enter image description here

enter image description here

The various spheres are the 2-spheres due to spherical symmetry of the metric, and the central sphere is the sphere of the radius $ r_{0}$ , therefore is the throat.

My doubt is:

Am I seeing a particle orbiting the throat of a Morris-Thorne Wormhole? In other words is it correct to say that the particle approches from infinity, orbits the throat and returns to the same universe?

$ $ * * * $ $

$ [1]$ LOBO.F.S.N; Exotic solutions in General Relativity,arxiv:0710.4474v1, 2007

$ [2]$ LOBO.F.S.N; Wormholes, Warp Drives and Energy Conditions,Springer, Vol.189, 2017

$ [3]$ VISSER.M; Lorentzian Wormholes, Springer, AIP Press, 1995

Appendix: Mathematica code:

n = Length[coords]; a = 0; r0; \[CapitalPhi][r] = 0; B[r] = (Sqrt[r*r0]);  tt = -(Exp[     2*\[CapitalPhi][       r]   ]); rr = (1)/(1 - ((B[r])/(r))); \[Theta]\[Theta] =   r^2; \[CurlyPhi]\[CurlyPhi] =   r^2*(Sin[\[Theta]]*Sin[\[Theta]]); t\[CurlyPhi] = 0; metric = {{tt,     0, 0, 0}, {0, rr, 0, 0}, {0, 0, \[Theta]\[Theta], 0}, {0, 0,     0, \[CurlyPhi]\[CurlyPhi]}}; metric // MatrixForm inversemetric = Simplify[Inverse[metric]]; inversemetric // MatrixForm christoffel :=   christoffel =    Simplify[Table[     1/2*Sum[inversemetric[[i,          s]]*(D[metric[[s, j]], coords[[k]]] +           D[metric[[s, k]], coords[[j]]] \[Minus]            D[metric[[j, k]], coords[[s]]]), {s, 1, n}], {i, 1, n}, {j,       1, n}, {k, 1, n}]] listchristoffel :=   Table[If[UnsameQ[christoffel[[i, j, k]],       0], {ToString[\[CapitalGamma][i, j, k]],       christoffel[[i, j, k]]}], {i, 1, n}, {j, 1, n}, {k, 1,      j}] TableForm[    Partition[DeleteCases[Flatten[listchristoffel], Null], 2],     TableSpacing -> {2, 2}] geodesic :=   geodesic =    Simplify[Table[\[Minus]Sum[       christoffel[[i, j, k]] coords[[j]]' coords[[k]]', {j, 1, n}, {k,         1, n}], {i, 1, n}]] listgeodesic :=   Table[{"d/d\[Tau]" ToString[coords[[i]]'], " =", geodesic[[i]]}, {i,     1, n}] TableForm[listgeodesic, TableSpacing -> {2}]  max\[Tau] = 750; ivs = {0, 0, 0.088}; ics = {0, 6.5, \[Pi]/2,    0}; r0 = 1; computeSoln[max\[Tau]i_, ivsi_, icsi_] :=   Block[{ivs, ics, i, \[Chi], tmp, soln}, ics = icsi;   ivs = Join[{\[Chi]}, ivsi];   op1 = Table[coords[[i]] -> ics[[i]], {i, 0, n}];   tm = metric /. op1;   tmp = ivs.(tm.ivs); \[Chi]slv = Solve[tmp == uinvar, \[Chi]];   ivs[[1]] = Last[\[Chi] /. \[Chi]slv];   op = {Derivative[1][t] -> Derivative[1][t][\[Tau]],      Derivative[1][r] -> Derivative[1][r][\[Tau]],      Derivative[1][\[Theta]] -> Derivative[1][\[Theta]][\[Tau]],      Derivative[1][\[CurlyPhi]] -> Derivative[1][\[CurlyPhi]][\[Tau]],      t -> t[\[Tau]],      r -> r[\[Tau]], \[Theta] -> \[Theta][\[Tau]], \[CurlyPhi] -> \ \[CurlyPhi][\[Tau]]};   deq = Table[     coords[[i]]''[\[Tau]] == Simplify[geodesic[[i]] /. op], {i, 1,       n}]; deq =     Join[deq, Table[coords[[i]]'[0] == ivs[[i]], {i, 1, n}],      Table[coords[[i]][0] == ics[[i]], {i, 1, n}]];   soln = NDSolve[deq, coords, {\[Tau], 0, max\[Tau]i}]; soln] uinvar = \[Minus]1; sphslnToCartsln[soln_] :=   Block[{xs, ys, zs},    xs = r[\[Tau]] Sin[\[Theta][\[Tau]]] Cos[\[CurlyPhi][\[Tau]]] /.      soln; ys =     r[\[Tau]] Sin[\[Theta][\[Tau]]] Sin[\[CurlyPhi][\[Tau]]] /. soln;   zs = r[\[Tau]] Cos[\[Theta][\[Tau]]] /. soln; {xs, ys, zs}] udotu[solni_, \[Tau]val_] :=   Block[{x\[Alpha], u\[Alpha]},    x\[Alpha] =     Table[coords[[i]][\[Tau]] /. solni, {i, 1, n}] // Flatten;   u\[Alpha] = D[x\[Alpha], \[Tau]];   x\[Alpha] = x\[Alpha] /. \[Tau] -> \[Tau]val;   u\[Alpha] = u\[Alpha] /. \[Tau] -> \[Tau]val;   u\[Alpha].((metric /.         Table[coords[[i]] -> x\[Alpha][[i]], {i, 1, n}]).u\[Alpha])] coordlist[\[Tau]in_] :=   Table[ToString[coords[[i]]] <>     " = " <> {ToString[coords[[i]][\[Tau]in] /. soln // First]}, {i, 1,     n}]  soln = computeSoln[max\[Tau], ivs, ics];  xyzsoln = sphslnToCartsln[soln]; Join[{"Final Coordinates:"}, coordlist[max\[Tau]]] // TableForm Join[{{"", "", "", "u.u values"}},    Table[{"\[Tau]=", ToString[i], "->", udotu[soln, i]}, {i, 0,      max\[Tau], max\[Tau]/5}]] // TableForm {Plot[Evaluate[    Table[coords[[i]][\[Tau]] /. soln, {i, 1, n}]], {\[Tau], 0,     max\[Tau]}, AxesLabel -> {"\[Tau]", "Coordinate"},    PlotLegends -> {"t", "r", "\[Theta]", "\[CurlyPhi]"},    PlotRange -> {0, 30}],   Show[ParametricPlot[    Evaluate[{xyzsoln[[1]], xyzsoln[[2]]} // Flatten], {\[Tau], 0,      max\[Tau]}, AspectRatio -> 1, PlotStyle -> Gray],    Graphics[{Red, Circle[{0, 0}, 2]}]]}  Shape FUNCTION;  (1)/(((r)/((Sqrt[r*r0]))) - 1)  Integrate[(1)/(((r)/((Sqrt[r*r0]))) - 1), r]  max\[Tau] = 2000; ivs = {\[Minus]0.08, .035, .0359}; ics = {0, 2, Pi/4, 0.2}; xyzsoln = sphslnToCartsln[computeSoln[max\[Tau], ivs, ics]]; angle = ParametricPlot3D[    Evaluate[Re[xyzsoln] // Flatten], {\[Tau], 0, max\[Tau]},     AxesLabel -> {x, y, z}, DisplayFunction -> Identity]; sphhoriz =    SphericalPlot3D[{1, 2, 3, 4}, {\[Theta], 0, Pi}, {\[Phi], 0, 2*Pi},     PlotRange -> {{-10, 10}, {-10, 10}, {-30, 30}},     BoxRatios -> {1, 1, 1}, PlotTheme -> "Classic", BoxRatios -> 2,     Mesh -> None, PlotStyle -> Opacity[0.2]]; sphhoriz2 =    SphericalPlot3D[{1, 2, 3, 4}, {\[Theta], 0, Pi}, {\[Phi],      0, (3/2)*Pi}, PlotRange -> {{-10, 10}, {-10, 10}, {-30, 30}},     BoxRatios -> {1, 1, 1}, PlotTheme -> "Classic", BoxRatios -> 2,     Mesh -> None, PlotStyle -> Opacity[0.3]]; Show[angle, sphhoriz, DisplayFunction -> $  DisplayFunction,   PlotRange -> {{-10, 10}, {-10, 10}, {-10, 10}}] Show[angle, sphhoriz2 , DisplayFunction -> $  DisplayFunction,   PlotRange -> {{-10, 10}, {-10, 10}, {-10, 10}}] 

How do I run LibGDX’s Particle Editor in Netbeans?

I am trying to run the Particle Editor that comes with LibGDX in Netbeans. The gdx-tools-1.9.10.jar file shows up in my dependencies, and I can see all of the packages and class files inside it:

gdx-tools-1.9.10.jar

Normally, when I want to run a file, I open the file by double-clicking it in the "Projects" panel, right click anywhere in the file, and then click the "Run File" option. However, when I use the same process to try to run a class file in gdx-tools, the "Run File" option appears to be grayed out:

Run File (Shift+F6)

I have also tried using the Shift+F6 shortcut, with no effect. Just as a sanity check, I did also make sure that the class file I am trying to run has a main method:

main method

I have also tried running the Particle Editor from the command line (I’m using Windows). I navigated to the gdx-tools directory using the following command:

cd C:\Users\<user>\.gradle\caches\modules-2\files-2.1\com.badlogicgames.gdx\gdx-tools.9.10\<hash> 

I then tried to run the Particle Editor using the following command:

java -cp gdx-tools-1.9.10.jar com.badlogic.gdx.tools.particleeditor.ParticleEditor.class 

And the result is simply:

Error: Could not find or load main class com.badlogic.gdx.tools.particleeditor.ParticleEditor.class 

How do I run the Particle Editor? I would prefer to be able to run it in Netbeans, but I would be happy to get it to run at all. I am using LibGDX 1.9.10, Netbeans 8.2, and Java (JDK and JRE) 8u111 on Windows 10. I installed LibGDX using their setup app found here.

How to play the particle effect of a parent object without playing that of its child object?

In my game, when one of the enemy’s body parts is hit by a bullet, I want that body part to play a particle system effect where blood splashes out. Some of the body parts are nested inside of each other (foot is a child of lower leg, and lower leg is a child of thigh, so on…). This is unavoidable because I’m using bone animations. The problem is that if I play the particle effect of one object, it will also play the particle effect of all of its children as well. Is there a solution to this?

enter image description here

private void OnTriggerEnter2D(Collider2D other) {     if (other.CompareTag("Enemy"))     {         other.GetComponent<ParticleSystem>()?.Play();     } } 

Why does changing Texture of Particle System using Material Property Block changes texture, but Particle System is still emitting old texture?

I try the code in Start, checking in Editor shows new texture, but Particle System still emits old texture. The script works for SpriteRenderer, but not ParticleSystem. I tried to Play/Stop emission – no difference.

    ParticleSystemRenderer renderer = gameObject.GetComponent<ParticleSystemRenderer>();     MaterialPropertyBlock materialPropertyBlock = new MaterialPropertyBlock();     renderer.GetPropertyBlock(materialPropertyBlock);     materialPropertyBlock.SetTexture("_MainTex", texture);     renderer.SetPropertyBlock(materialPropertyBlock); 

Simple spatial grid for particle system

I am going to simulate a particle system, the particles are infinitesimal points which apply forces on the neighbors and I need a fast way of making proximity checks, they are going to have a maximum check radius but not a minimum and will be almost evenly spaced.

The simulation will be very similar to this: https://youtu.be/SFf3pcE08NM

I thought a spatial grid would be the easiest approach for it and I need it to be as cost efficient as possible to matter how ugly it gets.

Is there any optimization I can make on this code?

Is there a way to compute the optimal cell size from the average distance between particles?

_empty_set = set()   class SpatialHash:     def __init__(self, cell_size=0.1):         self.cells = {}         self.bucket_map = {}         self.cell_size = cell_size      def key(self, co):         return int(co[0] / self.cell_size), int(co[1] / self.cell_size), int(co[2] / self.cell_size)      def add_item(self, item):         co = item.co         k = int(co[0] / self.cell_size), int(co[1] / self.cell_size), int(co[2] / self.cell_size)         if k in self.cells:             c = self.cells[k]         else:             c = set()             self.cell_size[k] = c         c.add(item)         self.bucket_map[item] = c      def remove_item(self, item):         self.bucket_map[item].remove(item)      def update_item(self, item):         self.bucket_map[item].remove(item)         self.add_item(item)      def check_sphere(self, co, radius, exclude=()):         r_sqr = radius * radius         for x in range(int((co[0] - radius) / self.cell_size),                        int((co[0] + radius) / self.cell_size) + 1):             for y in range(int((co[1] - radius) / self.cell_size),                            int((co[1] + radius) / self.cell_size) + 1):                 for z in range(int((co[2] - radius) / self.cell_size),                                int((co[2] + radius) / self.cell_size) + 1):                     for item in self.cells.get((x, y, z), _empty_set):                         if item not in exclude and (item.co - co).length_squared <= r_sqr:                             yield item 

Improving particle performance in P5.js

I have modified a particle system to create an effect similar to the one that I want. However, with any substantial amount of particles it performs very slowly on my laptop (around 1.7 fps at the worst when I remove the if statement limiting the creation of new particles). I’m guessing that this is because all the work is on the CPU? Can I batch together the processing somehow?

Demo here.

// Based on https://github.com/benjaminmbrown/particle-system-repeller  var Repeller = function(x, y) {     this.power = 500;     this.position = createVector(x, y);      this.display = function() {         stroke(0);         strokeWeight(2);         fill(127);         ellipse(this.position.x, this.position.y, 40, 40);     }      this.repel = function(p) {         var dir = p5.Vector.sub(this.position, p.position);         var d = dir.mag();         dir.normalize(); //just want the direction         d = constrain(d, 1, 100);         var force = -1 * this.power / (d * d);         dir.mult(force);         return dir;     } }   var Attractor = function(x, y) {     this.power = 150;     this.position = createVector(x, y);      this.display = function() {         stroke(255);         strokeWeight(2);         fill(127);         ellipse(this.position.x, this.position.y, 40, 40);     }      this.attract = function(p) {         var force = p5.Vector.sub(this.position, p.position);         var distance = force.mag();         distance = constrain(distance, 5, 50);         force.normalize();         var strength = 1 * this.power / (distance * distance);         force.mult(strength);         return force;     } }  function Particle(position, velObj, color) {     this.position = position.copy();     this.acceleration = createVector(0, 0.00);     this.velocity = createVector(random(velObj.xMin, velObj.xMax), random(velObj.yMin, velObj.yMax));     color = color || {r: 0, g: 0, b: 0};      this.lifespan = 255;     this.mass = 5;      this.run = function() {         this.update();         this.display();     }      this.display = function() {         stroke(255, this.lifespan); //gets more transparent as it dies         strokeWeight(2);         fill(color.r, color.g, color.b, this.lifespan);          ellipse(this.position.x, this.position.y, 4, 4);     }      this.update = function() {         this.velocity.add(this.acceleration);         this.position.add(this.velocity);         this.acceleration.mult(0);         this.lifespan -= 1.5;     }      this.isDead = function() {         return this.lifespan < 0.0 ? true : false;     }      this.applyForce = function(force) {         var f = force.copy();         f.div(this.mass);         this.acceleration.add(f);     } }   function ParticleSystem(num, position, velObj, color) {     this.origin = position.copy();     this.particles = [];      this.run = function() {         for(var i = this.particles.length - 1; i >= 0; i--) {             var p = this.particles[i];             p.run();             if(p.isDead()) {                 this.particles.splice(i, 1);             }         }     };      this.applyForce = function(force) {         for(var i = 0; i < this.particles.length; i++) {             this.particles[i].applyForce(force);         }     }      this.applyRepeller = function(r) {         for(var i = 0; i < this.particles.length; i++) {             this.particles[i].applyForce(r.repel(this.particles[i]));         }     }      this.applyAttractor = function(r) {         for(var i = 0; i < this.particles.length; i++) {             this.particles[i].applyForce(r.attract(this.particles[i]));             var p = this.particles[i];             var force = r.attract(p);             p.applyForce(force);         }     }      this.addParticle = function() {         var r = random(1);         this.particles.push(new Particle(this.origin, velObj, color));     }; }  var particleSystems = []; var repeller, attractor;   function setup() {     createCanvas(windowWidth, windowHeight, WEBGL);     setFrameRate(60);     repeller = new Repeller(0, 0);     leftAttractor = new Attractor(0, height / 2);     rightAttractor = new Attractor(width, height / 2);      particleSystems.push(new ParticleSystem(1, createVector(width / 5, height / 2), {xMin: 0, xMax: 2, yMin: -4, yMax: 4}, {r: 0, g: 0, b: 255}));     particleSystems.push(new ParticleSystem(1, createVector(width * 4 / 5, height / 2), {xMin: -2, xMax: 0, yMin: -4, yMax: 4}, {r: 255, g: 0, b: 0}));      // Ones not affected by attractor     particleSystems.push(new ParticleSystem(1, createVector(width / 5, height / 2), {xMin: -2, xMax: 1, yMin: -2, yMax: 2}, {r: 0, g: 0, b: 255}));     particleSystems.push(new ParticleSystem(1, createVector(width * 4 / 5, height / 2), {xMin: -1, xMax: 2, yMin: -2, yMax: 2}, {r: 255, g: 0, b: 0})); }  var numDraws = 0; function draw() {     background(255);     // var gravity = createVector(0.0, 0.1);     translate(-windowWidth / 2, -windowHeight / 2);      for(var i = 0; i < particleSystems.length; i++) {         // particleSystems[i].applyForce(gravity);         particleSystems[i].applyRepeller(repeller);         if(i === 0) {             particleSystems[i].applyAttractor(rightAttractor);         } else if(i === 1) {             particleSystems[i].applyAttractor(leftAttractor);         }         // if(numDraws % 3 === 0 || i < 2)             particleSystems[i].addParticle();         particleSystems[i].run();     }     repeller.display();     numDraws++; }  function mouseMoved() {     repeller.position = createVector(mouseX, mouseY); } function touchMoved() {     repeller.position = createVector(mouseX, mouseY); } 

Any insight as to how to improve this performance is appreciated.

How to perform particle swarm optimization clustering of results obtained from tf-idf vectorizer?

I have a collection of news articles. I have performed tf-idf operations on them. I am using python as programming language so it was just the use of TF-IDF vectorizer function. I now have the document’s tfidf representation. My aim is to cluster news articles using Particle swarm optimization. How can i use the result of tf-idf as input for Particle Swarm optimization? Can anybody provide me a solution or hint towards something?