AliKhan

10 Reputation

8 Badges

13 years, 230 days

MaplePrimes Activity


These are replies submitted by AliKhan

Dear Georgios,

Thanks for the help

Best Regards

A.Q

Dear Georgios,

Thanks for the help

Best Regards

A.Q

Thanks Dough Meade for the reply.  If you see carefully in the attached file MAPLE doesn't add the two expressions, it just writes them as it is.  for example in V2 :   0.0001900851754 Sin(-5theta+6wrt1+1.047197551),  this will appear the same in (V+V2), and same for rest of the terms.

I was actually looking for a command like "combine" for multiplication, which can basically add the two trignometric equations

 

 

Thanks Dough Meade for the reply.  If you see carefully in the attached file MAPLE doesn't add the two expressions, it just writes them as it is.  for example in V2 :   0.0001900851754 Sin(-5theta+6wrt1+1.047197551),  this will appear the same in (V+V2), and same for rest of the terms.

I was actually looking for a command like "combine" for multiplication, which can basically add the two trignometric equations

 

 

Thanks Markiyan,

 

I will try the code as suggested.

 

Best Regards

A.Q

Soton

Thanks Markiyan,

 

I will try the code as suggested.

 

Best Regards

A.Q

Soton

Hi Pagan

I have applied evalc but still it doesn't work. It again separates both Re and Imaginary parts.  I want to evaluate the whole expression, and when I do the conjugate still remains the same. I mean it does't multiply with anything.

 

Thanks

 

A.Q

Soton

Hi Pagan

I have applied evalc but still it doesn't work. It again separates both Re and Imaginary parts.  I want to evaluate the whole expression, and when I do the conjugate still remains the same. I mean it does't multiply with anything.

 

Thanks

 

A.Q

Soton

@Markiyan Hirnyk 

 

Thanks Markiyan for consideration.  

 

Theta = 0..Pi/2

wr = 15000

t1=1e-3 sec

 

But I want solution in the form of T as shown in file attached.  The only thing which I am looking for is how to multiply.  As you would have seen that Conjugate is separate.  Is there a way that I can evaluate the equation which multiplies the conjugate as well.    From T it seems that Maple didn't multiplied both expressions....

 

Regards

A.Q

Soton           Mapleprimes.mw

@Jarekkk   

 

Hi Jarek,

Pls find the attached file for your kind consideration.

 

Regards

A.Q

Soton                                      Mapleprimes.mw

@Markiyan Hirnyk 

 

Hi Markiyan,

Pls find attached file for your kind consideration.

 

Regards

A.Q

Soton                      Mapleprimes.mw

Hi Jarekk,

 

Sorry I think the first Maple file didn't uploaded correctly.  Therfore I am uploading the file again.

 

leastsquare1.mw

 

Best Regards

A.Q.

Soton

 

 

 

 

 

Hi Jarekk,

 

Sorry I think the first Maple file didn't uploaded correctly.  Therfore I am uploading the file again.

 

leastsquare1.mw

 

Best Regards

A.Q.

Soton

 

 

 

 

 

I think there is some problem in downloading a maple file.  Therefore I am uploading it again. 

leastsquare1.mw

 

Regards

A.Q

Soton

Hi Jarekk,

Thanks alot for your reply and solution.  I am really stuck in one more bit thats the least square problem.  leastsquare1.mw 

 Hope you can help me to solve this bit as well.

Least square method is successfuly implemented in MATLAB code (WRITTEN IN THIS MESSAGE AT THE END), but I couldn't do it in Maple.  I am having problem in the for loop section,  I am attaching Matlab code and  maple code (for correction) pls.

 

Your help will be really appreciated.

 

Best Regards

A.Q

Soton

 

Matlab code as I cannot upload the file:

 

close all;

clear all;

clc

    nr=1500;

    Do=190e-3;

    Ds=120.8e-3;

    la=76e-3;

    Qs=36;

    p=2;

    alpha_p=0.556;

    lm=6.3e-3;

    g=0.5e-3;

    mur=1.045;

    Br = 1.16;

    Rs=Ds*0.5;

    bo=4*Rs*pi/180; 

    do=0.6e-3;

   dslot=17.2e-3;

    Mtype='R';

    Nlambda=64;

    NB=301;

    N=128;

 

    Rs=Ds*0.5;

    Rm=Rs-g;

    Rr=Rs-g-lm;

    R=Rs-g*0.5;

   

    Rp1=Rr;

    Rp2=Rs;

    Rp3=Rs;

    Rp4=Rs;

    thetas=2*pi/Qs;

    alphao=2*asin(0.5*bo/Rs);

    theta1=thetas/2-alphao/2;

    theta2=theta1+alphao;

 

    clear j

    boprime=theta2-theta1;

    gprime=log(Rp2/Rp1);

    bCM=(boprime/2/gprime+sqrt((boprime/2/gprime)^2+1))^2;

    aCM=1/bCM;

   

   clear z_realz_imag

    z_imag=j*[0:thetas/N:thetas];

    z_real(1:length(z_imag))=log(R);

    z=z_real+z_imag;

    s=exp(z);

 

  FCM=inline('j*gprime/pi*(log((1+s)/(1-s))-log((b+s)/(b-s))-2*(b-1)/sqrt(b)*atan(s/sqrt(b)))+log(Rp2)+j*theta2',...'s','b','gprime','Rp2','theta2');

%START OPTIMIZATION

    w0=[0.01*aCM];

 

%initial values

 

for i=1:length(z)

        res=@(w0)(FCM(sqrt((w0-bCM)/(w0-aCM)),bCM,gprime,Rp2,theta2)-z(i));

       

        [w(i),resnorm,residual,exitflag]=lsqnonlin(res,w0,[],[]); 

       

        k(i)=exp(j*gprime/pi*log(w(i))+log(Rp2)+j*thetas/2);

       

        lambda(i)=k(i)*(w(i)-1)/(w(i)-aCM)^(1/2)/(w(i)-bCM)^(1/2)/s(i);

   

        w0=w(i);

   

 end

      

        lambda=[conj(lambda(N/2+1:-1:1)) lambda(2:N/2)];

    

    figure;plot(real(lambda));grid

    figure;plot(imag(lambda));grid

 

1 2 3 4 5 6 Page 4 of 6