Raja Amer Azim

40 Reputation

2 Badges

16 years, 104 days

MaplePrimes Activity


These are answers submitted by Raja Amer Azim

HI kindly help out with this problem thank you > restart; > with(plots); > m := 20;g := 9.8;Lf := 5;Lr := 5;h := .28;Rw := .25;Iz := 500;Iw := 2;Tbf := 0;Tbr := 0;Taf := 0;Tar := 0; > deltaf := proc (t) options operator, arrow; 0. end proc; deltar := proc (t) options operator, arrow; 0. end proc; ic1 := vx(0) = 10, vy(0) = 0, r(0) = 0, psi(0) = 0, omegaf(0) = 2.5, omegar(0) = 2.5; > eq1 := Fx((sqrt((vy(t)+Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)+Lf*r(t))/vx(t))-deltaf(t))-omegaf(t)*Rw)/(sqrt((vy(t)+Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)+Lf*r(t))/vx(t))-deltaf(t))), (m*g*Lr-m*(diff(vx(t), t))*h)/(Lf+Lr))*cos(deltaf(t))+Fy((sqrt((vy(t)+Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)+Lf*r(t))/vx(t))-deltaf(t))-omegaf(t)*Rw)/(sqrt((vy(t)+Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)+Lf*r(t))/vx(t))-deltaf(t))), (m*g*Lr-m*(diff(vx(t), t))*h)/(Lf+Lr))*sin(deltaf(t))+Fx((sqrt((vy(t)-Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)-Lr*r(t))/vx(t))-deltar(t))-omegar(t)*Rw)/(sqrt((vy(t)-Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)-Lr*r(t))/vx(t))-deltar(t))), (m*g*Lf-m*(diff(vx(t), t))*h)/(Lf+Lr))*cos(deltar(t))+Fy((sqrt((vy(t)-Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)-Lr*r(t))/vx(t))-deltar(t))-omegar(t)*Rw)/(sqrt((vy(t)-Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)-Lr*r(t))/vx(t))-deltar(t))), (m*g*Lf-m*(diff(vx(t), t))*h)/(Lf+Lr))*sin(deltar(t))+m*(diff(vx(t), t)-vy(t)*r(t)) = 0; > eq2 := -Fy((sqrt((vy(t)+Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)+Lf*r(t))/vx(t))-deltaf(t))-omegaf(t)*Rw)/(sqrt((vy(t)+Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)+Lf*r(t))/vx(t))-deltaf(t))), (m*g*Lr-m*(diff(vx(t), t))*h)/(Lf+Lr))*cos(deltaf(t))+Fx((sqrt((vy(t)+Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)+Lf*r(t))/vx(t))-deltaf(t))-omegaf(t)*Rw)/(sqrt((vy(t)+Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)+Lf*r(t))/vx(t))-deltaf(t))), (m*g*Lr-m*(diff(vx(t), t))*h)/(Lf+Lr))*sin(deltaf(t))-Fy((sqrt((vy(t)-Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)-Lr*r(t))/vx(t))-deltar(t))-omegar(t)*Rw)/(sqrt((vy(t)-Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)-Lr*r(t))/vx(t))-deltar(t))), (m*g*Lf-m*(diff(vx(t), t))*h)/(Lf+Lr))*cos(deltar(t))+Fx((sqrt((vy(t)-Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)-Lr*r(t))/vx(t))-deltar(t))-omegar(t)*Rw)/(sqrt((vy(t)-Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)-Lr*r(t))/vx(t))-deltar(t))), (m*g*Lf-m*(diff(vx(t), t))*h)/(Lf+Lr))*sin(deltar(t))+m*(diff(vy(t), t)+vx(t)*r(t)) = 0; > eq3 := -Lf*(Fy((sqrt((vy(t)+Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)+Lf*r(t))/vx(t))-deltaf(t))-omegaf(t)*Rw)/(sqrt((vy(t)+Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)+Lf*r(t))/vx(t))-deltaf(t))), (m*g*Lr-m*(diff(vx(t), t))*h)/(Lf+Lr))*cos(deltaf(t))-Fx((sqrt((vy(t)+Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)+Lf*r(t))/vx(t))-deltaf(t))-omegaf(t)*Rw)/(sqrt((vy(t)+Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)+Lf*r(t))/vx(t))-deltaf(t))), (m*g*Lr-m*(diff(vx(t), t))*h)/(Lf+Lr))*sin(deltaf(t)))+Lr*(Fy((sqrt((vy(t)-Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)-Lr*r(t))/vx(t))-deltar(t))-omegar(t)*Rw)/(sqrt((vy(t)-Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)-Lr*r(t))/vx(t))-deltar(t))), (m*g*Lf-m*(diff(vx(t), t))*h)/(Lf+Lr))*cos(deltar(t))-Fx((sqrt((vy(t)-Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)-Lr*r(t))/vx(t))-deltar(t))-omegar(t)*Rw)/(sqrt((vy(t)-Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)-Lr*r(t))/vx(t))-deltar(t))), (m*g*Lf-m*(diff(vx(t), t))*h)/(Lf+Lr))*sin(deltar(t)))+Iz*(diff(r(t), t)) = 0; > eq4 := Fx((sqrt((vy(t)+Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)+Lf*r(t))/vx(t))-deltaf(t))-omegaf(t)*Rw)/(sqrt((vy(t)+Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)+Lf*r(t))/vx(t))-deltaf(t))), (m*g*Lr-m*(diff(vx(t), t))*h)/(Lf+Lr))*Rw-Tbf+Taf-Iw*(diff(omegaf(t), t)) = 0; > eq5 := Fx((sqrt((vy(t)-Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)-Lr*r(t))/vx(t))-deltar(t))-omegar(t)*Rw)/(sqrt((vy(t)-Lf*r(t))^2+vx(t)^2)*cos(arctan((vy(t)-Lr*r(t))/vx(t))-deltar(t))), (m*g*Lf-m*(diff(vx(t), t))*h)/(Lf+Lr))*Rw-Tbr+Tar-Iw*(diff(omegar(t), t)) = 0; > eq6 := diff(psi(t), t)-r(t) = 0; > > > > > > > Fx := proc (Sa, F) local DX, MUX, BCDX, CX, BX, EX, SHX, SVY, x, Y, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b; if not [args]::(list(numeric)) then return ('Fx')(args) end if; b := F; b0 := 1.490000; b1 := (-1)*28.08998; b2 := (-1)*1401.6957; b3 := 101.33759; b4 := (-1)*172.59867; b5 := (-1)*0.61757933e-1; b6 := 0.15667623e-1; b7 := .18554619; b8 := 1.0000; b9 := 0.; b10 := 0.; DX := 1.03*b; BCDX := (b3*b^2+b4*b)*exp(-b5*b); CX := b0; SHX := b9*b+b10; EX := b6*b+b7*b+b8; BX := BCDX/(CX*DX); SVY := 0; x := Sa+SHX; Y := b*DX*sin(CX*arctan(BX*x-EX(BX*x-arctan(BX*x))))+SVY; return Y end proc; > > > > Fy := proc (alpha, Fz) local DY, MUY, BCDY, CY, BY, EY, SHX, SVY, GAMA, x, Y, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a; if not [args]::(list(numeric)) then return ('Fy')(args) end if; a := Fz; a0 := 1.65000; a1 := (-1)*34.0; a2 := 1250.00; a3 := 3036.00; a4 := 12.80; a5 := 0.501e-2; a6 := (-1)*0.2103e-1; a7 := .77394; a8 := 0.22890e-2; a9 := 0.13442e-1; a10 := 0.3709e-2; a11 := 19.1656; a12 := 1.21356; a13 := 6.26206; GAMA := 1; MUY := a1*a+a2; DY := MUY*a; BCDY := a3*sin(2*arctan(evalf(a4/a))*(1-a5*abs(GAMA))); CY := a0; EY := a6*a+a7; BY := BCDY/(CY*DY); SHX := a8*GAMA+a9*a+a10; SVY := a11*a*GAMA+a12*a+a13; x := alpha+SHX; Y := Fz*evalf(DY*sin(CY*evalf(arctan(evalf(BY*x-EY(BY*x-evalf(arctan(BY*x)))))))+SVY); return Y end proc; > > eqsys := eq1, eq2, eq3, eq4, eq5, eq6; > sys := {ic1, eqsys}; > solution := dsolve(sys, numeric, known = [Fx, Fy], range = 0 .. 10); Error, (in dsolve/numeric/make_proc) Could not convert to an explicit first order system due to 'RootOf' > > > odeplot(solution, [[t, Saf(t), color = blue], [t, vx(t), color = red]], 0 .. 10, numpoints = 200); Error, (in plots/odeplot) input is not a valid dsolve/numeric solution > > >

Sorry for the previous post!

tried your suggestion got the following message....

Error, (in D/procedure) function must be unary


The 'αf' gets calculated by
eq11 := (vy(t)+Lf*r(t))/vx(t)-tan(`αf`(t)+deltaf(t)) = 0;

 

I tried your suggestion got the following message....


Error, (in D/procedure) function must be unary

The 'αf' gets calculated by

eq11 := (vy(t)+Lf*r(t))/vx(t)-tan(`αf`(t)+deltaf(t)) = 0;

 

The same procedure Fx when used  alone works fine but when used along another function it gives the following Error,

(in dsolve/numeric/checkknown) use of 'rosenbrock_dae' method with procedure defined function Fx requires a differentiation rule `diff/Fx`
 

> restart;
> with(plots);
> m := 20;g := 9.8;Lf := 5;Lr := 5;h := .28;Rw := .25;Iz := 500;Iw := 2;Tbf := 0;Tbr := 0;Taf := 0;Tar := 0;
> eq23 := deltaf(t) = 0.; eq24 := deltar(t) = 0.; ic1 := vx(0) = 10, vy(0) = 0, Vx(0) = 10, Vy(0) = 0, r(0) = 0, psi(0) = 0, omegaf(0) = 2.5, omegar(0) = 2.5, Fxf(0) = 0, Fyf(0) = 0, Fxr(0) = 0, Fyr(0) = 0, Saf(0) = 0, Sar(0) = 0, `αr`(0) = 0, `αf`(0) = 0;
> eq1 := Fxf(t)*cos(deltaf(t))+Fyf(t)*sin(deltaf(t))+Fxr(t)*cos(deltar(t))+Fyr(t)*sin(deltar(t))+m*(diff(vx(t), t)-vy(t)*r(t)) = 0;
> eq2 := -Fyf(t)*cos(deltaf(t))+Fxf(t)*sin(deltaf(t))-Fyr(t)*cos(deltar(t))+Fxr(t)*sin(deltar(t))+m*(diff(vy(t), t)+vx(t)*r(t)) = 0;
> eq3 := -Lf*(Fyf(t)*cos(deltaf(t))-Fxf(t)*sin(deltaf(t)))+Lr*(Fyr(t)*cos(deltar(t))-Fxr(t)*sin(deltar(t)))+Iz*(diff(r(t), t)) = 0;
> eq4 := Fxf(t)*Rw-Tbf+Taf-Iw*(diff(omegaf(t), t)) = 0;
> eq5 := Fxr(t)*Rw-Tbr+Tar-Iw*(diff(omegar(t), t)) = 0;
> eq6 := diff(psi(t), t)-r(t) = 0;
> eq7 := vx(t)*cos(psi(t))-vy(t)*sin(psi(t))-Vx(t) = 0;
> eq8 := vy(t)*cos(psi(t))+vx(t)*sin(psi(t))-Vy(t) = 0;
> eq9 := m*g*Lr-m*(diff(vx(t), t))*h-Fzf(t)*(Lf+Lr) = 0;
> eq10 := (m*g*Lf-m*(diff(vx(t), t))*h)/(Lf+Lr)-Fzr(t) = 0;
> eq11 := (vy(t)+Lf*r(t))/vx(t)-tan(`αf`(t)+deltaf(t)) = 0;
> eq12 := (vy(t)-Lr*r(t))/vx(t)-tan(`αr`(t)+deltar(t)) = 0;
> eq13 := Vtf(t) = sqrt((vy(t)+Lf*r(t))^2+vx(t)^2);
> eq14 := Vtr(t) = sqrt((vy(t)-Lf*r(t))^2+vx(t)^2);
> eq15 := vwxf(t) = Vtf(t)*cos(`αf`(t));
> eq16 := vwxr(t) = Vtr(t)*cos(`αr`(t));
> eq17 := Saf(t) = (vwxf(t)-omegaf(t)*Rw)/vwxf(t);
> eq18 := Sar(t) = (vwxr(t)-omegar(t)*Rw)/vwxr(t);
> eq19 := Fxf(t) = Fx(Saf(t), Fzf(t));
> eq20 := Fxr(t)-Fx(Sar(t), Fzr(t)) = 0;
> eq21 := Fyf(t)-Fy(Saf(t), Fzf(t)) = 0;
> eq22 := Fyr(t)-Fy(Sar(t), Fzr(t)) = 0;
>
> Fx := proc (Sa, Fz) local DX, MUX, BCDX, CX, BX, EX, SHX, SVY, x, Y, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, FZ; if not [args]::(list(numeric)) then return ('Fx')(args) end if; FZ := Fz; b0 := 1.490000; b1 := (-1)*28.08998; b2 := (-1)*1401.6957; b3 := 101.33759; b4 := (-1)*172.59867; b5 := (-1)*0.61757933e-1; b6 := 0.15667623e-1; b7 := .18554619; b8 := 1.0000; b9 := 0.; b10 := 0.; DX := b1*FZ^2+b2*FZ; BCDX := b3*FZ+b4*FZ; CX := b0; SHX := b9*FZ+b10; EX := b6*FZ+b7*FZ+b8; BX := BCDX/(CX*DX); SVY := 0; x := Sa+SHX; Y := evalf(DX*sin(CX*arctan(BX*x-EX(BX*x-arctan(BX*x))))+SVY); return Y end proc;

> Fy := proc (alpha, Fz) local DY, MUY, BCDY, CY, BY, EY, SHX, SVY, GAMA, x, Y, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a; if not [args]::(list(numeric)) then return ('Fy')(args) end if; a := Fz; a0 := 1.65000; a1 := (-1)*34.0; a2 := 1250.00; a3 := 3036.00; a4 := 12.80; a5 := 0.501e-2; a6 := (-1)*0.2103e-1; a7 := .77394; a8 := 0.22890e-2; a9 := 0.13442e-1; a10 := 0.3709e-2; a11 := 19.1656; a12 := 1.21356; a13 := 6.26206; GAMA := 1; MUY := a1*a+a2; DY := MUY*a; BCDY := a3*sin(2*arctan(evalf(a4/a))*(1-a5*abs(GAMA))); CY := a0; EY := a6*a+a7; BY := BCDY/(CY*DY); SHX := a8*GAMA+a9*a+a10; SVY := a11*a*GAMA+a12*a+a13; x := alpha+SHX; Y := Fz*evalf(DY*sin(CY*evalf(arctan(evalf(BY*x-EY(BY*x-evalf(arctan(BY*x)))))))+SVY); return Y end proc;
>
> eqsys := eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8, eq9, eq10, eq11, eq12, eq13, eq14, eq15, eq16, eq17, eq18, eq19, eq20, eq21, eq22, eq23, eq24;
>
> sys := {ic1, eqsys};
> solution := dsolve(sys, numeric, known = [Fx, Fy], range = 0 .. 10);
Error, (in dsolve/numeric/checkknown) use of 'rkf45_dae' method with procedure defined function Fx requires a differentiation rule `diff/Fx`
>

thank you

 

Thank you for your timely advice. The problem is regarding simulating automotive systems using maple. Different tire models are to be used(non-linear).

tire force calculations are done using procedures( minimum  two) ..the same procedures which work independently start giving up when used in combination.

I would appreciate an early reply.

 

 

if the procedure is defined after defining the set of equations then it works!

implementing it gives you the same error

Error, (in RLLS) cannot determine if this expression is true or false: abs(x[2]+0.5e-4) <= 0.5e-4

Page 1 of 1