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

Charge in top plate changes inappropriately #256

Closed
KatieWoe opened this issue Apr 12, 2019 · 30 comments
Closed

Charge in top plate changes inappropriately #256

KatieWoe opened this issue Apr 12, 2019 · 30 comments
Assignees
Labels

Comments

@KatieWoe
Copy link
Contributor

Test device:
Dell and Jordan
Operating System:
Win 10 and Mac 10.14
Browser:
chrome and safari
Problem description:
For phetsims/qa#306, may be connected to #234. When the sim is paused and discharging, moving the capacitors seems to make the amount of charge change. This should not be possible, and steping forward one step causes the charge to jump to the correct amount.
Steps to reproduce:

  1. Charge the plates on the lightbulb screen
  2. Turn on top plate charge bar graph
  3. Pause the sim
  4. Move the wires to connect to the bulb
  5. Step forward and observe charge behavior
  6. Move plates closer together or further away (while still paused)
  7. Observe new charge bar
  8. Step forward and observe

Screenshots:
changingchargeamount

Troubleshooting information (do not edit):

Name: ‪Capacitor Lab: Basics‬
URL: https://phet-dev.colorado.edu/html/capacitor-lab-basics/1.7.0-dev.7/phet/capacitor-lab-basics_all_phet.html
Version: 1.7.0-dev.7 2019-04-10 22:42:01 UTC
Features missing: touch
Flags: pixelRatioScaling
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36
Language: en-US
Window: 1536x722
Pixel Ratio: 2.5/1
WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium)
GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)
Vendor: WebKit (WebKit WebGL)
Vertex: attribs: 16 varying: 30 uniform: 4096
Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32)
Max viewport: 16384x16384
OES_texture_float: true
Dependencies JSON: {}

@arouinfar
Copy link

Nice find @KatieWoe!

Since the published version doesn't have a pause button, it is hard to tell if this bug exists there, but it doesn't look like it.

Definitely looks like charge isn't being conserved here @Denz1994. Moving the plates while the sim is paused should never affect the amount of charge. While discharging, the charge on the plates would exponentially decay.

@arouinfar arouinfar removed their assignment Apr 12, 2019
@Denz1994
Copy link
Contributor

@arouinfar I believe this issue persisted in the published version. You see the change when following the steps without pausing, but it is a lot less apparent.

The top plate charge only updates when the capacitor is connected to the battery. @arouinfar Please double check that this behavior is correct in master.

@Denz1994 Denz1994 assigned arouinfar and unassigned Denz1994 Apr 22, 2019
@arouinfar
Copy link

@Denz1994 master still looks off to me.

When the capacitor is disconnected from the battery, changing its capacitance results in a change in the voltage (Q is conserved and Q = CV). Here, decreasing C results in proportionally increased V.

ConservedQ

Similarly, when connected to the bulb, changing C should create an instantaneous change in V. Here, decreasing C from 1.77 pF to 0.35 pF should have increased the voltage from 1.5 V to 7.5 V, resulting in a larger halo. Instead, the voltage remains 1.5 V, and the charge is instead reduced.
ConservedQ2

If you run into any questions, or would like to discuss over Zoom, please let me know.

@Denz1994
Copy link
Contributor

this.capacitor.discharge( ) was is responsible for updating the inverse relationship between capacitance and voltage, when the light bulb was connected. This function was being called during step() so when the sim was paused this wasn't being handled.

The capacitor now discharges when the plate geometry changes which should maintain conservation of charge. @arouinfar could you confirm in master?

@arouinfar
Copy link

Looks great @Denz1994!

@KatieWoe
Copy link
Contributor Author

KatieWoe commented May 7, 2019

May be connected to #259. As such, will leave up to @Denz1994 on whether this is fixed/whether to close

Denz1994 added a commit that referenced this issue May 8, 2019
@Denz1994
Copy link
Contributor

The changes in #259 should not have affected this, though closely related. This issue should be verified by QA to ensure it is resolved.

@arouinfar
Copy link

Charge is definitely not being conserved in master. For example:

  1. Turn on Top Plate Charge
  2. Charge capacitor (voltage irrelevant)
  3. Disconnect capacitor, and take note of top plate charge.
  4. Change plate separation or area, and the charge changes. This should not happen.

@KatieWoe
Copy link
Contributor Author

KatieWoe commented Nov 3, 2020

I'm not always seeing as much as I saw in #256 (comment), and have some trouble reproducing to that degree for some reason. But even so I get a consistent one time jump when I start to move the plates.

@Denz1994
Copy link
Contributor

The discharge model was simplified in the above commit. Also, the previousCapacitance was being changed as a side effect of discharging but used elsewhere (see updateDischargeParameters).

The steps in #256 (comment) should be verified by QA.

@KatieWoe
Copy link
Contributor Author

Things are looking good in rc.8 so far. Closing for now, but will keep an eye out and reopen if something reappears.

@CliffordH123
Copy link

This has come back for phetsims/qa#616
plateChargeChange
Steps:

  1. Charge plates
  2. Pause Sim.
  3. Switch plates to bulb
  4. Do not un-pause
  5. Change Plate distance
  6. Observe top plate charge graph change

@arouinfar
Copy link

Good find @CliffordH123. Looks like yet another regression @jonathanolson, so I'm wondering if we should pause/cancel this dev test.

@arouinfar arouinfar removed their assignment Mar 19, 2021
jonathanolson added a commit that referenced this issue Apr 8, 2021
@jonathanolson
Copy link
Contributor

@KatieWoe I believe this is fixed in master, can you verify?

@KatieWoe
Copy link
Contributor Author

Adding this to issues to verify on QA board

@brooklynlash
Copy link

Looks fixed on master, Win10 Chrome.

@loganbraywork
Copy link

This appears fixed as of phetsims/qa#640 on Win 10 Chrome.

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

No branches or pull requests

9 participants