Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect sample-point spacing in Transformer screen. #161

Closed
pixelzoom opened this issue Apr 18, 2024 · 2 comments
Closed

Incorrect sample-point spacing in Transformer screen. #161

pixelzoom opened this issue Apr 18, 2024 · 2 comments
Assignees

Comments

@pixelzoom
Copy link
Contributor

pixelzoom commented Apr 18, 2024

Discovered while working on #156.

In Unfuddle#248, the notion of "sample point strategy" was introduced, to prevent incorrect induced EMF in a specific situation. Placing the magnet inside the center of the coil, then moving the magnet vertically would induce a large EMF. This was due to the spacing of the sample points, resulting in sample points movng inside/outside the magnet, and causing a big flux change.

By using more sample points, and spacing the sample points based on the height of the magnet, the number of sample points "inside" the magent would be (roughly) constant, and we would avoid most of this flux change.

We handled this correctly in the Pickup Coil screen, see PickupCoilScreenModel.ts:

      samplePointsStrategy: new FixedSpacingSamplePointsStrategy( barMagnet.size.height / 10 ),

But we did not handle this correctly in the Transformer screen, see TransformerScreenModel.ts:

samplePointsStrategy: new FixedSpacingSamplePointsStrategy( 5.4 ), // same as Java version

The spacing constant 5.4 is not appropriate for the electromagnet's height, and still results in a large change in flux when moving the electromagnet vertically inside the pickup coil. Similar to the bar magnet, the spacing should have been based on the height of the electromagnet, like this:

      samplePointsStrategy: new FixedSpacingSamplePointsStrategy( this.electromagnet.size.height / 10 ),
@pixelzoom
Copy link
Contributor Author

pixelzoom commented Apr 18, 2024

Actually, it looks like this may be a porting error. In TransformerModule.java:

final double ySpacing = _electromagnetModel.getHeight() / 20;
_pickupCoilModel.setSamplePointsStrategy( new VariableNumberOfSamplePointsStrategy( ySpacing ) );

I'm not sure where 5.4 came from, because I don't find it in any of the .java source files.

@pixelzoom
Copy link
Contributor Author

pixelzoom commented Apr 18, 2024

Transformer screen has been fixed in the above commits, and now behaves like the Java version. I've also improved the documentation where samplePointsStrategy is set. So I'll go ahead and close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant