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:
Symbolic Toolbox: Solution of Trigonometric Equations

Subject: Symbolic Toolbox: Solution of Trigonometric Equations

From: Dinesh Bhati

Date: 14 Jun, 2013 20:37:22

Message: 1 of 5

Hi,

 solve((sin(t))^2-1)

do not return 3*pi/2 but only pi/2.How can I get 3*pi/2 also.

I am interested in all the solutions.

Thanks,
Dinesh Bhati

Subject: Symbolic Toolbox: Solution of Trigonometric Equations

From: Nasser M. Abbasi

Date: 14 Jun, 2013 23:03:42

Message: 2 of 5

On 6/14/2013 3:37 PM, Dinesh Bhati wrote:
> Hi,
>
> solve((sin(t))^2-1)
>
> do not return 3*pi/2 but only pi/2.How can I get 3*pi/2 also.
>
> I am interested in all the solutions.
>

EDU>> evalin(symengine,'solve(sin(t)^2-1)')
  
  
matrix([[t]]) in solvelib::VectorImageSet(matrix([[pi/2 + pi*k]]), k, Z_)

so the answer is pi/2 + pi*k where k in Z (ie. set of integers)

So let k=1 and you have your other solution.

--Nasser

Subject: Symbolic Toolbox: Solution of Trigonometric Equations

From: Dinesh Bhati

Date: 15 Jun, 2013 06:45:13

Message: 3 of 5

Can you please help in the following particular case. I want all the minima points. Toolbox is returning only one.I have plotted function 'p'. It has no. of minimas.

syms t10 t11
p=(cos(t11)*sin(t10) + sin(t10)^3*cos(t11)*+sin(t10)^2 - cos(t11)^2*sin(t10)^2);
eq1=diff(p,t10);
eq2=diff(p,t11);
s=solve(eq1,eq2,'t10','t11')
s.t10
s.t11

"Nasser M. Abbasi" wrote in message <kpg7gf$d77$1@speranza.aioe.org>...
> On 6/14/2013 3:37 PM, Dinesh Bhati wrote:
> > Hi,
> >
> > solve((sin(t))^2-1)
> >
> > do not return 3*pi/2 but only pi/2.How can I get 3*pi/2 also.
> >
> > I am interested in all the solutions.
> >
>
> EDU>> evalin(symengine,'solve(sin(t)^2-1)')
>
>
> matrix([[t]]) in solvelib::VectorImageSet(matrix([[pi/2 + pi*k]]), k, Z_)
>
> so the answer is pi/2 + pi*k where k in Z (ie. set of integers)
>
> So let k=1 and you have your other solution.
>
> --Nasser

Subject: Symbolic Toolbox: Solution of Trigonometric Equations

From: Nasser M. Abbasi

Date: 15 Jun, 2013 08:13:13

Message: 4 of 5

On 6/15/2013 1:45 AM, Dinesh Bhati wrote:
> Can you please help in the following particular case. I want all the minima points.
>Toolbox is returning only one.I have plotted function 'p'. It has no. of minimas.
>
> syms t10 t11
> p=(cos(t11)*sin(t10) + sin(t10)^3*cos(t11)*+sin(t10)^2 - cos(t11)^2*sin(t10)^2);
> eq1=diff(p,t10);
> eq2=diff(p,t11);
> s=solve(eq1,eq2,'t10','t11')
> s.t10
> s.t11

There are a little more to it. You might be better of either do it
by hand, or find a ready to use code, or write one yourself.
May be file exchange has something. (or toolbox might allready have
one, do not know)

But here is a sketch of algorithm:

given: f(x,y)

1) find diff(f,x) and diff(f,y)
2) find solution to diff(f,x)=0. let sol be yi and xi
3) replace y in diff(f,y) by yi. Now solve diff(f,y)=0 for xj
4) just found critical point(s) (xj,yi)
5) now replace x in diff(f,y) by xi from (2) and solve diff(f,y)=0 for yj
6) found another critical point(s) (xi,yj)
7) check each point if min/max/saddle points using second derivatives.

--Nasser

Subject: Symbolic Toolbox: Solution of Trigonometric Equations

From: Christopher Creutzig

Date: 22 Jul, 2013 12:00:58

Message: 5 of 5

On 15.06.13 08:45, Dinesh Bhati wrote:
> Can you please help in the following particular case. I want all the minima points. Toolbox is returning only one.I have plotted function 'p'. It has no. of minimas.
>
> syms t10 t11
> p=(cos(t11)*sin(t10) + sin(t10)^3*cos(t11)*+sin(t10)^2 - cos(t11)^2*sin(t10)^2);
> eq1=diff(p,t10);
> eq2=diff(p,t11);
> s=solve(eq1,eq2,'t10','t11')
> s.t10
> s.t11

In MATLAB R2013a, I get 13 solutions.


Christopher

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