The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 12:29pm
Pages: 1
Send Topic Print
Assignment after coordinate transformation (Read 1641 times)
Richardsim
New Member
*
Offline



Posts: 7

Assignment after coordinate transformation
Apr 11th, 2011, 12:23am
 
Part of a model I've implemented is shown below:

module Modulename (ttranstip, tphitip);
   inout [0:1] ttranstip;
   inout tphitip;
   kinematic [0:1] ttranstip;
   kinematic gnd;
   rotational tphitip, rotgnd;
   ground gnd, rotgnd;

parameter real alpha = 0;

parameter real k1=2;
parameter real k2=1;
parameter real k3=1;
parameter real k4=2;
parameter real k5=1;

// temp values
 
   real  gl11, gl12, gl21, gl22, Fxtip, Fytip, Mtip, xtip, ytip, phitip, T, Iz, ke,
   kb, A, kFxd_xwumind, kFxd_xwdminu, Lb, Tautemp, xglobal, yglobal;

//alpha,k1, k2, k3, k4
   
analog begin

gl11 = cos(alpha);
gl12 = -sin(alpha);
gl21 = sin(alpha);
gl22 = cos(alpha);

xtip = k1*Fxtip + k2*Fytip;
ytip = k3*Fxtip + k4*Fytip;

Tautemp = Tau(tphitip,rotgnd);
Theta(tphitip) <+ k5*Tautemp;

Pos(ttranstip[0]) <+ gl11*xtip + gl12*ytip;
Pos(ttranstip[1]) <+ gl21*xtip + gl22*ytip;

F(ttranstip[0],gnd) <+ gl11*Fxtip + gl12*Fytip;
F(ttranstip[1],gnd) <+ gl21*Fxtip + gl22*Fytip;

end

endmodule



This compiles succesfully. However, in simulation errors occur. Intuitively, only the Theta(tphitip) <+ assignment is a neat link between through and across variables at the terminals (no coordinate transformation for the angular coordinate). Apart from rewriting the set of equation to obtain a direct expression between through and across variables, can I adjust the code above to get it to work?
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Assignment after coordinate transformation
Reply #1 - Apr 11th, 2011, 6:30am
 
Did you intentionally leave out the assignments to Fxtip and Fytip?

Why do you have "gnd" only in
F(ttranstip[0],gnd) <+
and not in
Pos(ttranstip[0])
?
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.