#how can you calculate the number of times a cosine function equals 0 on some interval [0, T]

88 messages · Page 1 of 1 (latest)

safe trail
#

So let's say we have some arbitrary function f(t) which is in terms of cos(t). How can we calculate the number of times that f(t) = 0 on the domain [0, T] (note there may be factors and outside the cosine function and inside, but ik looking for a generalized statement here)

raven sphinxBOT
safe trail
#

I know that it will be zero everytime the parameter of the cosine function equals $\frac{(2n+1)\pi}{2}$, but the set n makes it difficult to calculate

shrewd canyonBOT
#

£ ςΓσΔηκεΓζ

safe trail
#

the set n is of course limited by the interval [0, T], but im not sure how this would work

dark kraken
#

You can maybe try to find all integers $n$ that satisfy $0 \leq \frac{\pi(2n+1)}{2} \leq T$.

shrewd canyonBOT
#

Crystopher

safe trail
dark kraken
#

You can divide it into two inequalities, so solve both $0 \leq \frac{\pi(2n+1)}{2}$ and $ \frac{\pi(2n+1)}{2} \leq T$. The first one would give you a lower bound, the latter gives you an upper bound for $n$

shrewd canyonBOT
#

Crystopher

safe trail
#

lets say we have $x'(t) = Awcos(w(t+c))$ such that $w(t+c) = \frac{\pi(2n+1)}{2}$ oddly solving for n worked in some cases but for every possible combination

shrewd canyonBOT
#

£ ςΓσΔηκεΓζ

safe trail
#

is this due to the bounds?

#

also how do we deal with a lower bound not being a positive integer value?

#

would the lower bound just be 0 then?

#

also T isn't necessarily an integer

#

so solving for the upper bound doesn't necessarily yield integer division

faint moon
# safe trail how would you do that mathematically

we would find when pi(2n+1)/2 = 0 and when it = T

from there we would take the ceil of n for when the period = 0 and take the floor for n when the period = T

taking the ceil and floor is essentially saying that we are tryna ignore the zeros outside the interval

faint moon
safe trail
shrewd canyonBOT
#

£ ςΓσΔηκεΓζ

safe trail
#

basically just treat all the other variables as constants

#

L > 0, -L/2 <= x_0 <= L/2, and v_0 has no limits other than that it's real

#

you could simplify it as $$x'(t) = \frac{\partial }{\partial t}(\frac{L}{2}sin\left(\frac{\pi v_o(t+c)}{L}\right))$$, where c is the phase-shift constant

shrewd canyonBOT
#

£ ςΓσΔηκεΓζ

safe trail
safe trail
shrewd canyonBOT
#

£ ςΓσΔηκεΓζ

faint moon
safe trail
faint moon
safe trail
#

so I'm trying to minimize it w/ x'(t)

faint moon
#

derivative

safe trail
#

yea the partial derivative

faint moon
safe trail
#

number of zeros of x'(t)

faint moon
safe trail
#

on the interval (0, T]

#

so not including time = 0

faint moon
safe trail
#

essentially

faint moon
#

ok

safe trail
#

so we basically set the variables in the beginning, but then only change t

faint moon
#

sorry for asking so many questions

safe trail
#

so everything except for t is just an initial condition

safe trail
faint moon
#

that should give # of zeros i think

safe trail
#

pretty sure that only works under the assumption c = 0

faint moon
#

bro what is c 😭

safe trail
#

phase-shift constant I calculated lmao

faint moon
#

ohhhhhhhhh

safe trail
#

basically allows for the initial position to be true

faint moon
#

bro at this point id just ask chatgpt

safe trail
#

I've tried solving this for way too long

#

like everything I try only like partially works

faint moon
faint moon
safe trail
#

yea until x(0) = x_0

faint moon
#

wait so just move the interval to the left then by c

#

so (0, T] becomes (-c, T - c]

safe trail
#

but what does this help with

#

that's equivalent to x(t) where c = 0

faint moon
safe trail
#

to which equation?

faint moon
#

if pi(2n+1)/2 is where the zeros will be when c = 0

safe trail
#

show me what u mean

faint moon
#

ok am artist

#

this is your equation shifted to the left by c

#

but if we also shift the interval to the left by c

#

we pretty much have the same equation

#

so now we have to find n at -c
and n at T - c

#

lets just say that N(x) = n at position x

#

so now if N(-c) is an integer, that means that it is a zero at -c so we want to count the number of zeros between those 2 points not including at -c
we do floor(N(T - c)) - N(-c)

#

but if N(-c) is not an integer, then there is not a zero at -c so we want to count the number of zeros between those 2 points including the ceil of N(-c) as that will give the rightmost zero to -c

floor(N(T - c)) - ceil(N(-c)) + 1

safe trail
#

and im trying to avoid a piecewise function

faint moon
#

oh then idk

#

sry bro

safe trail
#

especially to get a solution that works 100% of the time

#

I probably need to reapproach everything

#

gpt just gave me a solution close to one I came up with but with slight changes