Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Solving the Quadratic Trignometric Equation

Subject: Solving the Quadratic Trignometric Equation

From: Zeeshan Shareef

Date: 8 Feb, 2012 10:06:17

Message: 1 of 4

Dear Friends,
I have a equation:

a*(sin(theta)^2) + b*sin(2*theta) = c

How I can solve this equation ? I know all the variable a,b and c. Only 'theta' is unknown to me.

Thanks in Advance,
Zeeshan

Subject: Solving the Quadratic Trignometric Equation

From: Nasser M. Abbasi

Date: 8 Feb, 2012 10:16:44

Message: 2 of 4

On 2/8/2012 4:06 AM, Zeeshan Shareef wrote:
> Dear Friends,
> I have a equation:
>
> a*(sin(theta)^2) + b*sin(2*theta) = c
>
> How I can solve this equation ? I know all the variable a,b and c. Only 'theta' is unknown to me.
>
> Thanks in Advance,
> Zeeshan

may be:

--------------

a=1;
b=2;
c=3;
syms theta

EDU>> double(solve(a*(sin(theta)^2) + b*sin(2*theta) -c,theta))

ans =

    0.9079 + 0.3206i
   -2.2337 + 0.3206i
    0.9079 - 0.3206i
   -2.2337 - 0.3206i

-------------------

--Nasser

Subject: Solving the Quadratic Trignometric Equation

From: Torsten

Date: 8 Feb, 2012 11:59:19

Message: 3 of 4

On 8 Feb., 11:06, "Zeeshan Shareef" <zeeshan_i...@yahoo.com> wrote:
> Dear Friends,
> I have a equation:
>
> a*(sin(theta)^2) + b*sin(2*theta) = c
>
> How I can solve this equation ? I know all the variable a,b and c. Only 'theta' is unknown to me.
>
> Thanks in Advance,
> Zeeshan

Substitute
sin(theta)^2 = 0.5*(1-cos(2*theta))
and remember
sin(2*theta)^2+cos(2*theta)^2 = 1.
You'll arrive at a quadratic equation in sin(2*theta) (or
cos(2*theta)) that can be solved analytically.

Best wishes
Torsten.

Subject: Solving the Quadratic Trignometric Equation

From: Roger Stafford

Date: 8 Feb, 2012 20:39:13

Message: 4 of 4

"Zeeshan Shareef" <zeeshan_iiee@yahoo.com> wrote in message <jgtheo$2n0$1@newscl01ah.mathworks.com>...
> I have a equation:
> a*(sin(theta)^2) + b*sin(2*theta) = c
> How I can solve this equation ? I know all the variable a,b and c. Only 'theta' is unknown to me.
- - - - - - - - -
  Here's a method that uses the atan2 function:

 p = 1/2*atan2(2*b,a);
 q = 1/2*acos((a-2*c)/sqrt(a^2+4*b^2));
 theta1 = q-p; theta2 = -q-p;

  There are actually infinitely many roots in general to your equation, but all differ from theta1 or theta2 by integral multiples of pi. Note that if the magnitude of a-2*c exceeds that of sqrt(a^2+4*b^2), there can be no solutions. This is indicated by complex values for q.

Roger Stafford

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us