Richardsim
New Member
Offline
Posts: 7
|
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?
|