Possible Charged Particle Field

Page 12 of 22 Previous  1 ... 7 ... 11, 12, 13 ... 17 ... 22  Next

Go down

Re: Possible Charged Particle Field

Post by Nevyn on Thu Sep 13, 2018 12:57 am

What I will do is change the current SimpleChargeProfile class to take in an array of values to use in the constructor, instead of it using the constant CHARGE_DENSITY. The default will still use that constant, but it will allow us to override it if we want to.

I will then create a template, which will be commented out, of the classes that would be needed to create a new version. Then you can copy that template code, paste it outside of the comment and tailor the class names and the code in them for your specific needs. I will thoroughly document it to help you see what needs to be done and why.

The cdm.js file is getting quite large and cumbersome to work in. I think I will create another JS file to store the implementations and leave the abstract classes in cdm.js. This way, we can keep related implementations in the same file so that they are kept separate from all of the other implementations. I might create a template JS file that contains the main structure of a complete implementation to make it easier to create new ones.

I also want to change the name of the CDM module. It is currently called ChargeInteractionModel, which is just too much to type. Lazy? Maybe, but I find it a pain to work with. This will effect the test.html file, not cdm.js even though that is where the change will be made.

It is good to refactor your code once in a while to make it more readable and maintainable.
avatar
Nevyn
Admin

Posts : 1356
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Thu Sep 13, 2018 1:06 am

Airman wrote:Two body 03. Two protons with an initial vertical separation of 10, the bottom proton is rotated 90 degrees about the x-axis. I don’t recall the bottom proton also picking up an x-spin before.

I saw this a few version ago. I did not add it in there, and was wondering why you did. When I fixed the spin bug recently, I noticed that it went back to normal behavior. Well, it didn't spin, at least. Not sure what caused that. I'll check it again if you are still seeing it. I thought it had fixed itself.

Airman wrote:Four Body 01-04 are all interesting.

I think these scenarios work better after the spin fixes.

Airman wrote:Proton Stack 03 - three protons in a vertical column, is definitely ‘broken. Involving the overlap collision error.

Yeah, not sure what is going on there. I expected them to bounce off, but it seems the attraction is overriding the bounce.
avatar
Nevyn
Admin

Posts : 1356
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Thu Sep 13, 2018 9:03 am

Jared Magneson wrote:I'm curious about the spikes though - they look great and can be a useful tool I'll likely import to my video style if that's okay. But could they be made to match the charge profiles of the proton and neutron? I don't know much about that. It looks like they're pretty uniform currently.

Also, what about transparency in the shaders? Would it be useful or possibly to turn the charge transparency down a bit, say 75% or something, as a visual reference? To emulate the field instead of implying (perhaps) discrete particles?  Just an idea!

I have created a way to visualize the charge profile of a particle. It isn't quite what you mentioned, but it works fairly well. It would be great to render the charge field as a fog, or gas, but that is extremely expensive and could not be done for an arbitrary number of particles. What I have done, is to create a sphere that samples the charge field of a particle and applies a color to each vertex to represent the value at that point. Red indicates repulsion and blue indicates attraction.



You can create it at any distance from the particle. I tried to create multiple spheres at different radii, but it didn't work. There is also a problem in the way I have created the geometry that causes a weird problem when you zoom inside of the sphere. It works from the outside though, and that is actually the only way it should render but it seems ThreeJS is not listening to that setting.

There is a new menu called Graphics that contains some switches to enable/disable various parts of a particle. The spikes are disabled by default now and you have to turn them on if you want to see them. None of these settings are saved so if you refresh the page or go to a different scenario then it will revert back to the defaults.
avatar
Nevyn
Admin

Posts : 1356
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Thu Sep 13, 2018 6:17 pm

I also updated my site with the new version: https://www.nevyns-lab.com/mathis/app/cpim/test.html
avatar
Nevyn
Admin

Posts : 1356
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Fri Sep 14, 2018 9:36 am

I've made a few improvements to the charge calculations and they seem to work better. Having the ChargeProfile sampler to visualize the charge field is helping a lot. I can see the results of the math and where it breaks down.

I'm trying different ways to generate the CHARGE_DENSITY values so that I can generate larger arrays. The larger the array the smaller the angle from equator to pole that each value in it represents. It sets the precision of the emission. I'm using different equations to calculate the values and trying to get some curves into the way the values increase and decrease in size. For example, I'm using a sine function to generate values between -1 and 1 which provides pretty good accelerating and decelerating slopes.
avatar
Nevyn
Admin

Posts : 1356
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by LongtimeAirman on Fri Sep 14, 2018 4:49 pm

.
Hey Nevyn, it’s impossible to keep up with you, I haven’t seen your latest changes yet. I’m wrapped up in my current effort of cleaning up the Sphericals group programming, particle placements, vertex radials, and edge lines. I want to change the orientations of each so as to ensure the poly’s top center face, above the center proton will be parallel to the y-plane. Right now, for the three Spherical group configurations (6, 12 and 20), above the central proton’s north pole is either an octahedron vertex, icosa mid-edge or dodeca mid-edge. Plenty of exercises in programming and spatial thinking. I’m still using Cartesian coordinates, but I’ll be more than happy to switch to polar coords, as with initSpinTest.

With respect to your latest post, I know what you’re talking about. Here’s a quote from an old post of mine - a dual lobed charge profile:
LongtimeAirman on Sat Oct 17, 2015 3:49 pm
http://milesmathis.forumotion.com/t128-simple-orbiter-2#976
.

LongtimeAirman
Admin

Posts : 1037
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Fri Sep 14, 2018 6:17 pm

I have refactored a lot of stuff. This will make it difficult for you to merge your changes in. I suggest you create a branch from wherever you currently are and commit to that. Then we can try to sort it out.

I pulled a lot of the code from cdm.js out into their own JS files. This makes it easier to work on and find things. That shouldn't impact you too much, but the changes to test.html will. All I have changed in there is to rename the module from ChargeInteractionModel to PIM. You could try to make that change on your own code before you commit it. Just replace all occurrences of ChargeInteractionModel with PIM. Oh, it also now imports the new JS files, but that should merge in easy enough.

Let me know if you have any trouble. I should have coordinated this with you to avoid these issues, sorry.
avatar
Nevyn
Admin

Posts : 1356
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Fri Sep 14, 2018 6:21 pm

The initSpinTest function doesn't really use polar coordinates, it just uses trigonometry to rotate points around. All coordinates are still cartesian.

Once you have the latest code changes, have a look over the scenarios. I think some of them work better now that the charge field is more precise and accurate. Unfortunately, it didn't fix any of the spin reversals, but it has affected them.
avatar
Nevyn
Admin

Posts : 1356
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by LongtimeAirman on Fri Sep 14, 2018 8:31 pm

.
The screen goes black - RADIUS is not defined.
Ok, I'm looking. Here's a fat bug. I have the CP (default) precision and ran through the unmoveable set everything looked the same.  Running Unmoveable - ArrangeAboutY configuration. When I switch precision to icosa precision, the screen goes black. My Firefox console reads.

THREE.WebGLRenderer 88 three.js:21191:3
ReferenceError: RADIUS is not defined[Learn More] charge-point-engine.js:416:7
.

LongtimeAirman
Admin

Posts : 1037
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Fri Sep 14, 2018 8:37 pm

Sorry. Fixed that.
avatar
Nevyn
Admin

Posts : 1356
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by LongtimeAirman on Fri Sep 14, 2018 11:50 pm

.
Looks good Nevyn. I ran some of the simulations' current and previous versions side by side. The current version always ran at a slightly higher fps number. It’s hard to be certain, but I believe your changes have significantly sped up the action, the action also seems smoother. I can see increased acceleration when approaching proton poles.

By running collision test 03 I can see that the proton emissions are now slightly stronger; previously, maybe one (or none) of the protons on the left surface didn’t experience a collision, now there are five or six protons left stationary after their emissions turned back the approaching neutrons.

The Charge profile graphic effect works nicely, especially when used with Charge emission.

Since the Charge axes graphic effect need not be on, please let the user know which Precision button is currently selected (or in effect).

When one wishes to leave the Charge axes on, it is very inconvenient to have to reset the precision (?), then turn on the charge axes, in that order, whenever one changes the scenario.

Refactoring eh? Given all the changes involved in creating your new break-out documents, I believe your re-launch went very well.
.

LongtimeAirman
Admin

Posts : 1037
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Sat Sep 15, 2018 5:45 pm

LongtimeAirman wrote:Looks good Nevyn. I ran some of the simulations' current and previous versions side by side. The current version always ran at a slightly higher fps number. It’s hard to be certain, but I believe your changes have significantly sped up the action, the action also seems smoother. I can see increased acceleration when approaching proton poles.

The forces are definitely smoother. Once I could see the charge profile, I saw that it wasn't working quite as well as it did in my head (funny how that happens). Improving the math to control the equator to pole calculation helped immensely. It is also the increased precision of the charge emission. Using the generated values (using sine at the moment) I am generating 100 values. That is 100 division in 90°, so each value represent 0.9°. The best thing about that precision is that it doesn't include an increase in time to process. We could have 1000 values and it would be just the same.

LongtimeAirman wrote:By running collision test 03 I can see that the proton emissions are now slightly stronger; previously, maybe one (or none) of the protons on the left surface didn’t experience a collision, now there are five or six protons left stationary after their emissions turned back the approaching neutrons.

That does work better now. I hadn't looked closely at the collision scenarios because I didn't want to see those ugly collisions. I was only thinking about the first 2 scenarios and forgot that the third was a bit different.

LongtimeAirman wrote:The Charge profile graphic effect works nicely, especially when used with Charge emission.

I love that ChargeProfile sampler! It is helping so much, I wish I had thought of it sooner. It is always good to find a way to visualize the math, if you can.

LongtimeAirman wrote:Since the Charge axes graphic effect need not be on, please let the user know which Precision button is currently selected (or in effect).

Good idea. Not sure how to do that at the moment.

LongtimeAirman wrote:When one wishes to leave the Charge axes on, it is very inconvenient to have to reset the precision (?), then turn on the charge axes, in that order, whenever one changes the scenario.

Yes, that is annoying, so I have fixed it up and it saves it to the URL.
avatar
Nevyn
Admin

Posts : 1356
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Sat Sep 15, 2018 6:02 pm

I have changed the way the Precision menu is built and added a * next to the currently active precision.

Updated my site with the latest changes too.
avatar
Nevyn
Admin

Posts : 1356
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Sat Sep 15, 2018 6:06 pm

And made it use bold text too.
avatar
Nevyn
Admin

Posts : 1356
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by LongtimeAirman on Sat Sep 15, 2018 6:21 pm

.

Sorry Nevyn, I’m getting errors trying to Push or Pull – an incomplete merge (?), after committing the dodecahedron. You can see the neutrons accelerate very smartly (clear curving paths!) at and then away from the central proton in this scenario.

Anyway, the uncommitted errors aren’t mine, I left enough of the change so that you can see that. Is this change a merge product? Please tell me what line to go to and what to Pull/push next, I re-cloned over a problem similar to this previously.
.

LongtimeAirman
Admin

Posts : 1037
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Sat Sep 15, 2018 6:43 pm

You should be able to pull my changes with rebase turned on on the dialog box. This will get my changes and merge them on top of your changes.

You may need to Abort the previous pull in the Action menu. Unless you only did a Fetch, then you won't have to do anything other than pull with rebase.
avatar
Nevyn
Admin

Posts : 1356
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by LongtimeAirman on Sat Sep 15, 2018 7:01 pm

.
_You have not concluded your merge (MERGE_HEAD exists).hint_ Please, commit your changes before merging.fatal_ Exiting because of unfinished merge_

I had fetched and pulled.

Neither of us is the author of the uncommitted changes at the top line in the Sourcetree pic.

Abort isn't an alternative (its greyed out), I tried resolve conflict - restart merge; it asked, am I sure, I said Ok, but nothing changed.
.

LongtimeAirman
Admin

Posts : 1037
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Possible Charged Particle Field

Post by LongtimeAirman on Sat Sep 15, 2018 7:28 pm

.

I tried rebasing and recceived the error I shared previously. After another thrashing here I am.

True statement, you're the only person I've ever asked directions from.
.


Last edited by LongtimeAirman on Sat Sep 15, 2018 7:44 pm; edited 1 time in total

LongtimeAirman
Admin

Posts : 1037
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Sat Sep 15, 2018 7:35 pm

If you still have those changes in a separate file, or can pull them out easily enough, then it is probably easier to re-clone the repo.

Try to get into the habit of Fetching before committing. That way, you can see if I have pushed any new commits before you add yours, and can pull them down more easily. I am trying to get into the same habit and still forget at times because I am used to working on my own, either as a project (at home) or as a branch (at work).
avatar
Nevyn
Admin

Posts : 1356
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by LongtimeAirman on Sat Sep 15, 2018 8:00 pm

.
Yes Sir.

Ok, I'm back. I'll need to re-enter my latest changes after a bit, I'm a couple of chores behind.

How did you use the charge profiler effect to improve the emission field?
.

LongtimeAirman
Admin

Posts : 1037
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Sat Sep 15, 2018 8:39 pm

Just by being able to see the charge field as it transitioned from equator to pole. I could see where it didn't look right. There were some strange looking edges at the boundary between repulsion and attraction, so I knew the math wasn't working as I thought it should.

The problem was that previously I was only looking at the Y axis and assuming the equator to pole relationship from that, but that doesn't take the extension into the XZ plane (equator) into account. Now it is using trig functions to calculate the actual angle, dividing that by PI/2 to convert it into a value between 0 and 1, and then using that to find the appropriate charge density value in that array (which is now calculated from a sine function).

Note that it only works out 90°, from equator to one pole, and the upper and lower halves are mirrored.
avatar
Nevyn
Admin

Posts : 1356
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Sat Sep 15, 2018 8:41 pm

I'm not sure if I made it clear, but the object used to calculate the charge emission is being used by the sampler, hence why I am calling it a sampler. So the charge profile is a true representation of the charge emission calculations, at some specified radius from the emitter.
avatar
Nevyn
Admin

Posts : 1356
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by LongtimeAirman on Sat Sep 15, 2018 10:23 pm

.
The charge sampler seems like a light bulb.
 
I added the dodeca init20PointSphere03. I also added for-loops to all the spherical particle placements, vertex radials and surface edge line scenarios/functions to make the programming slightly better.  

I think we have a new bug, a very recent change (like today) has strengthened the proton emission TOO MUCH. Neutrons are accelerating into the proton poles almost faster than we can see. Now, in Collision test 03, none of the neutrons can collide with a proton. The energetic proton has broken initSixPointSphere01.  
.

LongtimeAirman
Admin

Posts : 1037
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Possible Charged Particle Field

Post by LongtimeAirman on Sat Sep 15, 2018 10:40 pm

.
Gremlins.

Now things are again working as they were earlier today - the super proton bug is gone. Collision test 03 and initSixPointSphere01 are working 'properly'. I'll keep an eye out and let you know if I see it again.
.

LongtimeAirman
Admin

Posts : 1037
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Possible Charged Particle Field

Post by Nevyn on Sun Sep 16, 2018 12:40 am

I have made some serious changes that are going to effect you because I have totally overhauled the scenario mechanism. The main HTML file was getting way too large and cumbersome to work in. So I have created a more formal idea of a scenario that allows us to use separate JS files for a scenario group. You can have multiple groups per JS file to.

I have created a new branch to house it until you are ready. Let me know when you have all of your changes pushed to GIT and I will try to merge them into the new way of doing things.

Have a look at the branch to get a feel for what I have done. I added a template file that provides the outline of a new scenario file and documentation on what to do inside of it. It is called AddScenarioTemplate.txt and can be found in the new js/scenario folder. This is the folder to put any scenario JS files to keep them together and separate from other files. Makes them easy to find.
avatar
Nevyn
Admin

Posts : 1356
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Possible Charged Particle Field

Post by Sponsored content


Sponsored content


Back to top Go down

Page 12 of 22 Previous  1 ... 7 ... 11, 12, 13 ... 17 ... 22  Next

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum