Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab question

  1. Mar 18, 2004 #1
    Below shows code that I wrote for a problem that I'm trying to solve,

    function der = dqind(t,x);
    %ids=x(1);iqs=x(2);idr=x(3);iqr=x(4);x(5)=wm;
    poles=6;
    w=2*pi*60;
    Lm=15/w;
    Ls=0.15/w + Lm;
    Lr=0.1/w + Lm;
    Rs=0.2;Rr=0.1;J=0.5;B=0.1;
    dqabcT=[1 -0.5 -0.5;0 sqrt(3)/2 -sqrt(3)/2;1 1 1];
    inductor_matrix = [Ls 0 Lm 0;0 Ls 0 Lm;Lm 0 Lr 0;0 Lm 0 Lr];
    inverse_of_inductor_matrix=inv(inductor_matrix);
    if (t<=10) V=220/sqrt(3);
    else V=220;
    end;
    Vst=[V*sin(w*t);V*sin(w*t-2*pi/3);V*sin(w*t-4*pi/3)];
    Vdqs=dqabcT*Vst;
    Vvector=[Vdqs(1:2,1);0;0];
    wo=x(5,1)*poles/2;
    speed_voltage_matrix = [Rs 0 0 0;0 Rs 0 0; 0 wo*Lm Rr wo*Lr;-wo*Lm 0 -wo*Lr Rr];
    Torque=(poles/3)*(x(3)*x(2)-x(1)*x(4));
    der=inverse_of_inductor_matrix*(Vvector-speed_voltage_matrix*x(1:4,1));
    der(5,1)=(Torque - B*x(5,1))/J;

    When I run the above code, I get what I expected. I now what to do something a little different which requires me to transform my solutions using a matrix.
    So, what I want to do exactly is solve the above diff. equation (ie.
    [t,x]=ode23(@dqind,.....);) and tranform every solution that it computes with a matrix (ex. [1 4 5 3; 3 5 2 7; 3 4 5 6; 3 5 4 3])

    In order to do this, would I need to include this matrix transform in the M-File that I call to solve the above code ?
    Would I write another M-File ?

    Thanks
     
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you help with the solution or looking for help too?
Draft saved Draft deleted



Similar Discussions: Matlab question
  1. MATLAB questions (Replies: 0)

  2. MATLAB question (Replies: 2)

  3. MATLAB question (Replies: 1)

  4. Matlab question (Replies: 2)

  5. Matlab question (Replies: 10)

Loading...