|
-
Mar 20th, 2009, 03:09 PM
#1
Thread Starter
Member
Algebraic expression
okay, so, I'm not got at all with coding in VB 08 and I need help!
I'm was trying to figure out the amount of "charge" my iPod touch can hold from it's original state.
I used y = Ce^(kt) to model it.
Here it is:
ln(%/100)/(ln(4/5)/400)=c
The variables are % and c
% = the percent of change you are aiming at multiplied by 100 (i.e 50% = .5*100 = 50, so the percent without the percent sign)
c = how many charges it will take to reach that capacity percent
Now with than and simple algebra you can figure out when your battery reach a desired capacity.
How I got the formula:
First, things I assumed:
1. Battery capacity exponentially decreases
2. Battery capacity goes from 100% to 80% in 400 charges
OK, here is the math stuff:
y = Ce^(kt)
or
% = Ce^(kc)
Plug In the info we know
80 = 100e^(kc)
80 = 100e^(k400)
(80/100) = e^(k400)
ln(80/100) = k400
(ln(80/100)/400) = k
again
% = Ce^(kc)
% = 100e^((ln(80/100)/400))c
%/100 = e^((ln(80/100)/400))c
ln(%/100) = ((ln(80/100)/400))c
ln(%/100)/(ln(80/100)/400) = c
80/100 simplifies to 4/5
ln(%/100)/(ln(4/5)/400)=c
SOURCES:
Charge Cycles
A properly maintained iPod battery is designed to retain up to 80% of its original capacity at 400 full charge and discharge cycles.
http://www.apple.com/batteries/ipods.html
ALL HELP APPRECIATED!!!
-
Mar 21st, 2009, 12:47 PM
#2
Re: Algebraic expression
 Originally Posted by Ohfoohy
okay, so, I'm not got at all with coding in VB 08 and I need help!
ALL HELP APPRECIATED!!! 
What kind of help? You haven't told us a thing about what you want done. If your looking for some code to do that it's very simple.
Code:
Dim Percentage As Decimal
Dim Charges As Decimal
Decimal.TryParse(PercentTextBox.Text, Percentage)
Charges = Math.Log(Percentage / 100) / (Math.Log(4 / 5) / 400)
chargeLabel.Text = Charges
-
Mar 21st, 2009, 08:59 PM
#3
Thread Starter
Member
-
Mar 21st, 2009, 11:31 PM
#4
Thread Starter
Member
Re: Algebraic expression
How would I display the answer?
-
Mar 21st, 2009, 11:56 PM
#5
Re: Algebraic expression
 Originally Posted by Ohfoohy
How would I display the answer?
Make a Label named chargeLabel, a TextBox named percentTextBox, and a button named calcButton.
Double click the calcButton in designer mode to view the Click Event and put that code in. The very last part, chargeLabel.Text = Charges, will display the answer inside the chargeLabel.
-
Mar 22nd, 2009, 12:12 AM
#6
Thread Starter
Member
Re: Algebraic expression
Just as I suspected! Thanks!
-
Mar 22nd, 2009, 12:01 PM
#7
Re: Algebraic expression
 Originally Posted by Ohfoohy
Just as I suspected! Thanks!
No problem, post if you have any more questions about the program.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|