How do I ensure the product of two values from a function is always negative?

22 Views Asked by At

For a MATLAB project, I am to find values of a and b such that $(\sin(aL)+a\cos(aL)) \cdot (\sin(bL)+b\cos(bL))$ is always negative. The catch is that $L$ is continuously varying over a range of an index of $1:100$. Since sin/cos are cyclical functions, is there a way to modify $a/b$ with a function of the index value such that $f(a)\cdot f(b)$ is always negative?

1

There are 1 best solutions below

0
On

restrict yourself to $a=-b=2\pi k,\ k\in\mathbb {Z} $. Now you can get rid of sines, cosines and $ L$, and get an easy formula...

Edit: if you meant that $ L $ can take 100 different real values, you can do instead the following, given that a and b can be functions of $ L $: $ a=-b=\frac {1}{L} 2\pi $ if $ L\neq 0 $, and $ a=-b=1 $ if $ L=0 $.