Writing Out Equations with a Modulo Function

In summary: In Excel, MOD() only takes integer arguments.So you want the fractional part of this expression:(280.46646 + (X * 36) + (X * (0.0003032^2)))and then you want to multiply the result by 360. So if your scientific article was using LaTeX, you could write that asY = (280.46646 + (X * 36) + (X * (0.0003032^2))) - \lfloor(280.46646 + (X * 36) + (X * (0.0003032^2)))\rfloor * 360
  • #1
drogerssolar
23
0
Hi,

I'm trying to write out a set of equations I was using in an excel worksheet and am unsure how to represent a modulo function.

For example, is there a proper way to write out the following excel formula in mathematical terms?

=MOD(280.4+X*(36000.7 + X*0.0003032),360) *Where X is a cell containing the variable

Sorry if my question is a bit confusing. I am unsure of how to write this out because typically I wouldn't expect to write a comma in a mathematical equation. Maybe this is a bad assumption.

Thanks for any help.
 
Mathematics news on Phys.org
  • #2
So I took a stab at it. I think that the two vertical bars around a variable or expression means the floor integer. Is this correct?

Z = 280.4+X*(36000.7 + X*0.0003032)

= z - (|z/360| * 360)



or all in one equation:

= z - (|(280.4+X*(36000.7 + X*0.0003032))/360| * 360)
 
  • #3
drogerssolar said:
Hi,

I'm trying to write out a set of equations I was using in an excel worksheet and am unsure how to represent a modulo function.

For example, is there a proper way to write out the following excel formula in mathematical terms?

=MOD(280.4+X*(36000.7 + X*0.0003032),360) *Where X is a cell containing the variable
I believe the conventions is to write the expression and then put '(mod n)' after it, eg
280.4+X*(36000.7 + X*0.0003032) (mod 360)

Sorry if my question is a bit confusing. I am unsure of how to write this out because typically I wouldn't expect to write a comma in a mathematical equation. Maybe this is a bad assumption.
It depends where and how, but commas are typically used to separate arguments in multi-parameter functions or indices in matrix subscripts.
 
  • #4
drogerssolar said:
So I took a stab at it. I think that the two vertical bars around a variable or expression means the floor integer. Is this correct?
No, | | means absolute value. What you want is the greatest integer function, AKA "floor" function, written in LaTeX like this:

\lfloor 512.3 \rfloor

##\lfloor 512.3\rfloor##, which evaluates to 512.
drogerssolar said:
Z = 280.4+X*(36000.7 + X*0.0003032)

= z - (|z/360| * 360)
The above doesn't make sense. The first line sets Z to the expression on the right. The second line claims that the right side of the previous equation is somehow equal to the expression after '=', which is not true.
drogerssolar said:
or all in one equation:

= z - (|(280.4+X*(36000.7 + X*0.0003032))/360| * 360)

This is not an equation. An equation is a statement that two quantities have the same value. All you're showing here is one quantity. Keep in mind that Excel formulas always start with '=' but mathematical equations have the form <expression1> = <expression2>.

The '=' that starts an Excel formula is a shorthand assignment statement, where the thing that's being set (the cell in which the formula is written) is not shown. It is probably a bit confusing that '=' is also used in Excel to test for equality. Most programming languages use different symbols for assignment and equality.
 
  • #5
So than is this:

Y = (280.46646 + (X * 36) + (X * (0.0003032^2)))
- (⌊(280.46646 + (X * 36) + (X * (0.0003032^2))) / 360⌋ * 360)


the same as writing this...

Y = (280.46646 + (X * 36) + (X * (0.0003032^2))) (mod 360)

Any idea what the typical method would be in a scientific style report?
 
  • #6
drogerssolar said:
So than is this:

Y = (280.46646 + (X * 36) + (X * (0.0003032^2)))
- (⌊(280.46646 + (X * 36) + (X * (0.0003032^2))) / 360⌋ * 360)


the same as writing this...

Y = (280.46646 + (X * 36) + (X * (0.0003032^2))) (mod 360)
I haven't checked your numbers, but I doubt that the two values are the same. I'm guessing that you want an integer value for Y in the range 0 ... 359. The argument to a modulus expression in mathematics is defined only for integer numbers, at least I've never seen it being used on numbers with fractional parts. That's the reason for the greatest integer function in your first equation above.

To cut to the chase, what I think you're trying to do is to take a number such as 645.783 (for example), strip off the fractional part (.783) to get 645, and then find the remainder mod 360, which would be 285.
drogerssolar said:
Any idea what the typical method would be in a scientific style report?
 
  • #7
Thanks for your help Mark.

In your example you are describing what I am trying to do; however, the value of Y does not need to be an integer.

Basically my main equation is Y = (280.46646 + (X * 36) + (X * (0.0003032^2)))
and if this gave us a result of Y=645.783; I would want to use the modulo function to give me the result of 285.783.

If the equation gave a result of Y=3525.783; I would want to use modulo to give a result of 285.783.

So yes you are correct in saying I want a number between 0-359; however, that number does not need to be an integer.
 
  • #8
Mark44 said:
The argument to a modulus expression in mathematics is defined only for integer numbers, at least I've never seen it being used on numbers with fractional parts.
Several 'mathematical' applications define the mod function to take congruences of real numbers, eg Mathcad, Matlab and Mathematica.
 

FAQ: Writing Out Equations with a Modulo Function

1. What is a modulo function?

A modulo function, also known as the modulus or remainder function, is a mathematical operation that calculates the remainder when one number is divided by another. It is represented by the % symbol in mathematical equations.

2. How do I write equations with a modulo function?

To write an equation with a modulo function, use the % symbol between the two numbers in the equation. For example, 10 % 3 = 1, which means 10 divided by 3 has a remainder of 1.

3. What is the purpose of using a modulo function in equations?

The purpose of using a modulo function in equations is to find the remainder or to perform a specific operation on the remainder of a division. It is often used in computer programming to determine if a number is even or odd, or to create patterns and repetitions in code.

4. Can a modulo function be applied to any numbers?

Yes, a modulo function can be applied to any integer numbers. It can also be applied to decimal numbers, but the result may vary depending on the programming language or calculator being used.

5. Are there any rules to follow when using a modulo function in equations?

Yes, there are a few rules to keep in mind when using a modulo function. The result will always be a whole number, the remainder will always be less than the divisor, and if the first number in the equation is smaller than the second number, the result will always be the first number.

Similar threads

Back
Top