Need equation for incrementing number

Need equation for incrementing number

Postby ZeroX4 » Thu May 02, 2024 9:18 am

So i need some equations for adding some number that will increase over time to another number

To explain my issue imagine i have some value (lets call it MyNumber) that starts from 0 and goes to 100 then resets back to 0
Where i am constantly adding 1 to it
I can loop it like that to cycle trough some range
I learned i could set it to cycle trough 0 to 200

And now i could do [tex]100-MyNumber[/tex] and so i would it would still add from 0 to 200 and reset
But it would start from 100,99,98,97,,2,1,0,-1,-2,,,,,-97,-98,-99,-100 and then back to 100
Now i could also go with
[tex]100-(MyNumber-100)[/tex]
And i would get it going from 200 to 0 then looping back to 200 and going to 0 again over and over
So i reversed the process of adding 1 to MyNumber and now it is subtracting 1 from my number

BUT now i can go with
[tex]100-(abs(MyNumber-100))[/tex]
Where abs returns value as absolute so no negative numbers basically removes -minus sign
And so i would get it going from 0 to 100 and drop back to 0
So 0,1,2,3,4,,,,98,99,100,99,98,97,,,3,2,1
And that is how instead of it going one way or another
I made it increase to its peak then decrease (yeah i lost half of it but i could simply x2 now)

Now i could shove in there [tex]100/100*MyNumber[/tex]
And here my problems starts
Imagine it is as climbing on the stairs

All that is done to MyNumber while it loops from 0 to 200 by constantly adding 1 to it
Where only thing that changes is result

And my general problem is not with how it works cause it works perfectly
My problem is with adding 1 to it
So imagine we add 1 each sec so its 100 sec one way and 100 other way
What i would wish to do is be able to manipulate evenly how much is added to MyNumber on both ways
I was able to achieve one part of it
Where it starts slowly and gradually decrease over 100 and then again start gaining speed by
[tex]1+(MyNumberCurrentValue/some number)[/tex]

And it is like starting at lowest speed (1/s) and the longer it goes the more it adds per second
Where when it reaches 100 it starts dropping amount of how much is added since MyNumber also starts to lose value

And i would wish to reverse that process
And do other things

To illustrate it
I wish to be able to do this
Image
Or this
Image

Or both
Any ideas are welcome
User avatar
ZeroX4
 
Posts: 1
Joined: Thu May 02, 2024 8:20 am
Reputation: 0

Re: Need equation for incrementing number

Postby Guest » Fri May 10, 2024 6:24 am

It seems like you're exploring various equations to manipulate a variable, MyNumber, which increases from 0 to 100 and then resets back to 0, while adding 1 to it constantly. You've already experimented with equations that affect how MyNumber changes over time.
To address your concern about manipulating how much is added to MyNumber evenly on both increasing and decreasing sides, you can try using a function that adjusts the rate of change dynamically. One approach is to use a sinusoidal function to modulate the rate of change over time. This function would gradually increase the rate of change as MyNumber goes from 0 to 100, and then decrease it as MyNumber decreases from 100 back to 0.
Here's an example equation incorporating a sinusoidal function to modulate the rate of change:
Rate of change=sin(π⋅MyNumber/100)
This equation will smoothly vary between -1 and 1 as MyNumber goes from 0 to 100 and back to 0, effectively modulating the rate of change symmetrically on both sides of the cycle.
You can then use this rate of change to adjust how much is added to MyNumber at each step. For example:
MyNumber=Old MyNumber+Rate of change
This equation will ensure that the rate of change increases from 0 to 1 as MyNumber goes from 0 to 100, and then decreases back to 0 as MyNumber decreases from 100 back to 0.
You can further tweak the equation to suit your specific requirements, such as scaling the rate of change or adjusting the phase of the sinusoidal function. Experimentation with different functions and parameters can help you achieve the desired behavior for your system.

In working through this mathematical problem, it's clear that precision and accuracy are key. For those seeking assistance or guidance with such calculations, I will suggest you to try mathsassignmenthelp.com that can be incredibly valuable. Also, you can contact them at +1 (315) 557-6473.
Guest
 

better quality

Postby Guest » Tue Mar 18, 2025 9:37 am

The **Math10 Forum** is a great resource for discussing mathematical concepts and problem-solving strategies. Check out https://www.resumefolks.com/ for expert resume assistance.
Guest
 

Re: Need equation for incrementing number

Postby GeradHum » Thu Jun 05, 2025 12:27 pm

You can control the increment speed by using a function that changes over time, like this:

Let MyNumber go from 0 to 200 repeatedly (MyNumber % 201).

Use a speed factor based on MyNumber, for example:

python
Copiar
Editar
speed = 1 + (MyNumber / 100) # speeds up as MyNumber increases
To reverse or modify speed, use functions like:

python
Copiar
Editar
speed = 1 + ((100 - abs(MyNumber - 100)) / 100) # speeds up then slows down
Then add speed each step instead of just 1, and reset MyNumber when it passes 200.

This way you can smoothly control how fast MyNumber increases or decreases over the cycle.

User avatar
GeradHum
 
Posts: 52
Joined: Tue Apr 25, 2023 4:18 pm
Location: England
Reputation: 5


Return to Equations



Who is online

Users browsing this forum: No registered users and 6 guests