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:
simplifiy does not work

Subject: simplifiy does not work

From: Baha Kuzu

Date: 14 Dec, 2010 23:30:23

Message: 1 of 9

Anybody knows how to simplify trigonometric expression like;
Asin(wt)^3+Bcos(wt)^2*sin(wt)+C*cos(wt)^3+.....
Simplify is working if I take sin(3wt) in expressions. But it does not work if i take as it is above. Actually, I have a very huge van der pol equation I wanna simplify.

One part of my equation I want to simplify is;

d*e^2*mu*wf*sin(t*wf)^3 - c^3*mu*w*cos(t*w)^2*sin(t*w) - d^3*mu*wf*cos(t*wf)^2*sin(t*wf) + e^3*mu*wf*cos(t*wf)*sin(t*wf)^2

all of them symbolic. I know maple does it with combine command, but for matlab???
Thanks in advance,
Ismail

Subject: simplifiy does not work

From: Walter Roberson

Date: 14 Dec, 2010 23:46:38

Message: 2 of 9

On 10-12-14 05:30 PM, Baha Kuzu wrote:
> Anybody knows how to simplify trigonometric expression like;
> Asin(wt)^3+Bcos(wt)^2*sin(wt)+C*cos(wt)^3+.....
> Simplify is working if I take sin(3wt) in expressions. But it does not work if
> i take as it is above. Actually, I have a very huge van der pol equation I
> wanna simplify.
>
> One part of my equation I want to simplify is;
>
> d*e^2*mu*wf*sin(t*wf)^3 - c^3*mu*w*cos(t*w)^2*sin(t*w) -
> d^3*mu*wf*cos(t*wf)^2*sin(t*wf) + e^3*mu*wf*cos(t*wf)*sin(t*wf)^2
> all of them symbolic. I know maple does it with combine command, but for
> matlab???


*Possibly*

http://www.mathworks.com/help/toolbox/mupad/stdlib/combine.html

You might have to use target=sincos


I do not have the mupad symbolic toolbox to test this with.

Subject: simplifiy does not work

From: Baha Kuzu

Date: 15 Dec, 2010 00:04:06

Message: 3 of 9

 
> *Possibly*
>
> http://www.mathworks.com/help/toolbox/mupad/stdlib/combine.html
>
> You might have to use target=sincos
>
>
> I do not have the mupad symbolic toolbox to test this with.


I think, what I am trying to do is opposite of this. I want to get first degree terms from square or cubic terms.
Baha

Subject: simplifiy does not work

From: Baha Kuzu

Date: 15 Dec, 2010 00:06:06

Message: 4 of 9

 
> *Possibly*
>
> http://www.mathworks.com/help/toolbox/mupad/stdlib/combine.html
>
> You might have to use target=sincos
>
>
> I do not have the mupad symbolic toolbox to test this with.


I think, what I am trying to do is opposite of this. I want to get first degree terms from square or cubic terms.
Baha

Subject: simplifiy does not work

From: Walter Roberson

Date: 15 Dec, 2010 00:13:46

Message: 5 of 9

On 10-12-14 06:06 PM, Baha Kuzu wrote:
>
>> *Possibly*
>>
>> http://www.mathworks.com/help/toolbox/mupad/stdlib/combine.html
>>
>> You might have to use target=sincos
>>
>>
>> I do not have the mupad symbolic toolbox to test this with.
>
>
> I think, what I am trying to do is opposite of this. I want to get first
> degree terms from square or cubic terms. Baha

Ummm, I'm still not sure what you are after. You said maple's combine() did
the work, and maple's combine would convert to sin(3*w*t) from its expansion.
I do not know what MuPad's combine outputs as I do not have that available to
test with.

What result do you get if you use

evalin(simengine,'combine(expand(sin(3*w*t)), target=sincos)');

Subject: simplifiy does not work

From: James Merlin

Date: 15 Dec, 2010 00:40:56

Message: 6 of 9

I never seen something like that, good luck with it :)
[url=http://nationalpaydayloan.net]national loans[/url]

Subject: simplifiy does not work

From: Baha Kuzu

Date: 15 Dec, 2010 01:50:07

Message: 7 of 9

> Ummm, I'm still not sure what you are after. You said maple's combine() did
> the work, and maple's combine would convert to sin(3*w*t) from its expansion.
> I do not know what MuPad's combine outputs as I do not have that available to
> test with.
>
> What result do you get if you use
>
> evalin(simengine,'combine(expand(sin(3*w*t)), target=sincos)');

I did not understand what this command does. what is simengine e.g.? I am not that much professional.

My code is working if I use
>syms c d e w t mu
>x = c*cos(w*t)+d*cos(3*w*t)+e*sin(3*w*t)
for equation
>eq = xdotdot-mu*(1-x*x)*xdot+x
dot:1st derivative wrt t, dotdot:2nd derivative wrt t

I can get it by using expand and simplify commands. But the problem is;
______
But if I use
>syms c d e w wf t mu
>x = c*cos(w*t)+d*cos(wf*t)+e*sin(wf*t)
>eq = xdotdot-mu*(1-x*x)*xdot+x
simplify does not work. I don't know why.
If you want I can send my code. It is just 12 line code.

Subject: simplifiy does not work

From: Walter Roberson

Date: 15 Dec, 2010 06:34:15

Message: 8 of 9

On 14/12/10 7:50 PM, Baha Kuzu wrote:

> But if I use
>> syms c d e w wf t mu
>> x = c*cos(w*t)+d*cos(wf*t)+e*sin(wf*t)
>> eq = xdotdot-mu*(1-x*x)*xdot+x
> simplify does not work. I don't know why.

In your first example, there was a clear relationship between w*t and
3*w*t, and that relationship could be exploited by the trig identities.
In this example, though, there is no clear relationship between the w*t
that you use in the first term and the wf*t that you use in the other
terms. You would probably be better off using w*t in the first term and
w*f*t in the other terms, preferably with an assumption placed upon f
that f was real-valued.

> If you want I can send my
> code. It is just 12 line code.

As I have mentioned, I do not have the Symbolic Toolkit for Matlab, so
sending me the code wouldn't help much.

Subject: simplifiy does not work

From: Baha Kuzu

Date: 15 Dec, 2010 13:26:05

Message: 9 of 9

Walter Roberson <roberson@hushmail.com> wrote in message <IjZNo.3144$ju1.2350@newsfe14.iad>...
> On 14/12/10 7:50 PM, Baha Kuzu wrote:

>
> In your first example, there was a clear relationship between w*t and
> 3*w*t, and that relationship could be exploited by the trig identities.
> In this example, though, there is no clear relationship between the w*t
> that you use in the first term and the wf*t that you use in the other
> terms. You would probably be better off using w*t in the first term and
> w*f*t in the other terms, preferably with an assumption placed upon f
> that f was real-valued.
>
> > If you want I can send my
> > code. It is just 12 line code.
Okay I see what you say, matlab mess it up. (by the way it is wf*f, wf is a coefficient).
Thank you...

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