Thread Subject: same equation,with the "simple" function, get different result!

Subject: same equation,with the "simple" function, get different result!

From: wang hua

Date: 8 Mar, 2010 03:47:06

Message: 1 of 4

equation 1:
 syms E U a b Zg real;
>> I=(U*exp(i*a)-E)/(Zg*exp(i*b));
>> S=U*conj(I);
>> P=real(S);
>> Q=imag(S);
>> eq1=simple(P*sin(b)-Q*cos(b))

eq1 =
 
(U^2*sin(a))/Zg


equation 2:
syms E U a X R real;
>> I=(U*exp(i*a)-E)/(R+i*X);
>> S=U*conj(I);
>> P=real(S);
>> Q=imag(S);
>> eq2=simple(P*X/sqrt(R^2+X^2)-P*R/sqrt(R^2+X^2))
 
eq2 =
 
-(U*(R - X)*(2*R*U*cos(a) - 2*E*R + 2*U*X*sin(a)))/(2*(R^2 + X^2)^(3/2))

eq1 should equal eq2,because X/sqrt(R^2+X^2)=sin(b) and R/sqrt(R^2+X^2))=cos(b). but by using matlab,I got the diffent results. how can I simple eq2 to eq1?
Can anyone help me?thx.

Subject: same equation,with the "simple" function, get different result!

From: wang hua

Date: 15 Mar, 2010 09:24:05

Message: 2 of 4

I'm sorry for my carelessness, eq2 should be:
eq2=simple(P*X/sqrt(R^2+X^2)-Q*R/sqrt(R^2+X^2))
 
thanks for everyone!

"wang hua" <ghpghp3@126.com> wrote in message <hn1rvq$2jc$1@fred.mathworks.com>...
> equation 1:
> syms E U a b Zg real;
> >> I=(U*exp(i*a)-E)/(Zg*exp(i*b));
> >> S=U*conj(I);
> >> P=real(S);
> >> Q=imag(S);
> >> eq1=simple(P*sin(b)-Q*cos(b))
>
> eq1 =
>
> (U^2*sin(a))/Zg
>
>
> equation 2:
> syms E U a X R real;
> >> I=(U*exp(i*a)-E)/(R+i*X);
> >> S=U*conj(I);
> >> P=real(S);
> >> Q=imag(S);
> >> eq2=simple(P*X/sqrt(R^2+X^2)-P*R/sqrt(R^2+X^2))
>
> eq2 =
>
> -(U*(R - X)*(2*R*U*cos(a) - 2*E*R + 2*U*X*sin(a)))/(2*(R^2 + X^2)^(3/2))
>
> eq1 should equal eq2,because X/sqrt(R^2+X^2)=sin(b) and R/sqrt(R^2+X^2))=cos(b). but by using matlab,I got the diffent results. how can I simple eq2 to eq1?
> Can anyone help me?thx.

Subject: same equation,with the "simple" function, get different result!

From: Walter Roberson

Date: 15 Mar, 2010 19:06:32

Message: 3 of 4

wang hua wrote:
> I'm sorry for my carelessness, eq2 should be:
> eq2=simple(P*X/sqrt(R^2+X^2)-Q*R/sqrt(R^2+X^2))

> "wang hua" <ghpghp3@126.com> wrote in message
> <hn1rvq$2jc$1@fred.mathworks.com>...
>> equation 1:
>> syms E U a b Zg real;
>> >> I=(U*exp(i*a)-E)/(Zg*exp(i*b));
>> >> S=U*conj(I);
>> >> P=real(S);
>> >> Q=imag(S);
>> >> eq1=simple(P*sin(b)-Q*cos(b))
>>
>> eq1 =
>>
>> (U^2*sin(a))/Zg
>>
>>
>> equation 2:
>> syms E U a X R real;
>> >> I=(U*exp(i*a)-E)/(R+i*X);
>> >> S=U*conj(I);
>> >> P=real(S);
>> >> Q=imag(S);
>> >> eq2=simple(P*X/sqrt(R^2+X^2)-P*R/sqrt(R^2+X^2))
>>
>> eq2 =
>>
>> -(U*(R - X)*(2*R*U*cos(a) - 2*E*R + 2*U*X*sin(a)))/(2*(R^2 + X^2)^(3/2))
>>
>> eq1 should equal eq2,because X/sqrt(R^2+X^2)=sin(b) and
>> R/sqrt(R^2+X^2))=cos(b). but by using matlab,I got the diffent
>> results. how can I simple eq2 to eq1?
>> Can anyone help me?thx.

Classically, X/R = sin(x), and R = sqrt(X^2+Y^2) not sqrt(X^2+R^2) .

How do you expect the math engine to make a connection between Zg in the first
formula for eq1, and anything in the second formula?

How do you expect the math engine to make a connection between sin(b) or
cos(b) and the X and R of the second formula? There isn't just one X and R
that is valid for cos(b): there are an infinite number of them, all along the
line with slope tan(b).

Subject: same equation,with the "simple" function, get different result!

From: wang hua

Date: 16 Mar, 2010 03:55:34

Message: 4 of 4

Walter Roberson <roberson@hushmail.com> wrote in message <hnm11b$edm$1@canopus.cc.umanitoba.ca>...
> wang hua wrote:
> > I'm sorry for my carelessness, eq2 should be:
> > eq2=simple(P*X/sqrt(R^2+X^2)-Q*R/sqrt(R^2+X^2))
>
> > "wang hua" <ghpghp3@126.com> wrote in message
> > <hn1rvq$2jc$1@fred.mathworks.com>...
> >> equation 1:
> >> syms E U a b Zg real;
> >> >> I=(U*exp(i*a)-E)/(Zg*exp(i*b));
> >> >> S=U*conj(I);
> >> >> P=real(S);
> >> >> Q=imag(S);
> >> >> eq1=simple(P*sin(b)-Q*cos(b))
> >>
> >> eq1 =
> >>
> >> (U^2*sin(a))/Zg
> >>
> >>
> >> equation 2:
> >> syms E U a X R real;
> >> >> I=(U*exp(i*a)-E)/(R+i*X);
> >> >> S=U*conj(I);
> >> >> P=real(S);
> >> >> Q=imag(S);
> >> >> eq2=simple(P*X/sqrt(R^2+X^2)-P*R/sqrt(R^2+X^2))
> >>
> >> eq2 =
> >>
> >> -(U*(R - X)*(2*R*U*cos(a) - 2*E*R + 2*U*X*sin(a)))/(2*(R^2 + X^2)^(3/2))
> >>
> >> eq1 should equal eq2,because X/sqrt(R^2+X^2)=sin(b) and
> >> R/sqrt(R^2+X^2))=cos(b). but by using matlab,I got the diffent
> >> results. how can I simple eq2 to eq1?
> >> Can anyone help me?thx.
>
> Classically, X/R = sin(x), and R = sqrt(X^2+Y^2) not sqrt(X^2+R^2) .
>
> How do you expect the math engine to make a connection between Zg in the first
> formula for eq1, and anything in the second formula?
>
> How do you expect the math engine to make a connection between sin(b) or
> cos(b) and the X and R of the second formula? There isn't just one X and R
> that is valid for cos(b): there are an infinite number of them, all along the
> line with slope tan(b).

Thank Walter Roberson, I mean that Zg=sqrt(X^2+R^2), R=Zg*cos(b), X=Zg*sin(b).
If eq2=simple(P*X/sqrt(R^2+X^2)-Q*R/sqrt(R^2+X^2)), then eq1 will equal eq2.
For my careless, I got the wrong answer. now, I have another question about latex below,
>> latex(E)

ans =

\mathrm{EMLVar}

>> latex(U)

ans =

U

why latex(E)=\mathrm{EMLVar}? not E?
why latex(U)=U? not \mathrm{UMLVar}

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
active power wang hua 7 Mar, 2010 22:56:59
circuit wang hua 7 Mar, 2010 22:56:40
symbolic math t... wang hua 7 Mar, 2010 22:56:03
rssFeed for this Thread

Contact us at files@mathworks.com