I appreciate everyone's time on this issue, so dear to my heart!
So, please, show me the errors of my ways, or at least the errors
in my syntax.
Please consider this calculation again, that requires Integrate.
r0Vec = {Quantity[0, "Meters"], Quantity[0, "Meters"]};
r1Vec = {Quantity[1, "Meters"], Quantity[0, "Meters"]};
v0Vec = AngleVector[{Quantity[2.8, ("Meters")/("Seconds")], 0 Degree}];
v1Vec = AngleVector[{Quantity[0, ("Meters")/("Seconds")], 0 Degree}];
aVec = {ax, ay};
m = Quantity[0.45, "Kilograms"];
g = Quantity[9.8, ("Meters")/("Seconds")^2];
Fw = m*g;
FwVec = AngleVector[{Fw, 270 Degree}];
FkVec = AngleVector[{Fk, 180 Degree}];
FnVec = AngleVector[{Fw, 90 Degree}];
RVec = FkVec + FnVec + FwVec;
This code will explode because of the way I have defined aVec. This much we can agree on. It will cause Integrate and Plus to return Quantity based errors regarding mismatched units.
aVec = {ax, ay};
So, the question now is:
How do I correct this definition?
What is the proper syntax, if you will?
As mentioned above, we could change the definition of aVec to the following:
aVec = {Quantity[ax, ("Meters")/("Seconds")^2],
Quantity[ay, ("Meters")/("Seconds")^2]};
And if we do so, and evaluate the following cell:
r0Vec = {Quantity[0, "Meters"], Quantity[0, "Meters"]};
r1Vec = {Quantity[1, "Meters"], Quantity[0, "Meters"]};
v0Vec = AngleVector[{Quantity[2.8, ("Meters")/("Seconds")], 0 Degree}];
v1Vec = AngleVector[{Quantity[0, ("Meters")/("Seconds")], 0 Degree}];
(*aVec={ax,ay};*)
aVec = {Quantity[ax, ("Meters")/("Seconds")^2],
Quantity[ay, ("Meters")/("Seconds")^2]};
m = Quantity[0.45, "Kilograms"];
g = Quantity[9.8, ("Meters")/("Seconds")^2];
Fw = m*g;
FwVec = AngleVector[{Fw, 270 Degree}];
FkVec = AngleVector[{Fk, 180 Degree}];
FnVec = AngleVector[{Fw, 90 Degree}];
RVec = FkVec + FnVec + FwVec;
NSolve[{RVec == m*aVec,
r1Vec == r0Vec + Integrate[v0Vec, Quantity[t, "Seconds"]] +
Integrate[Integrate[aVec, Quantity[t, "Seconds"]],
Quantity[t, "Seconds"]],
v1Vec == v0Vec + Integrate[aVec, Quantity[t, "Seconds"]]},
{t, ax, ay, Fk}]
We get, in V12, the following output:
{{t -> 0.714286, ax -> -3.92, ay -> 0.,
Fk -> Quantity[1.764, "Newtons"]}}
Which is perfectly correct, EXCEPT there are no units for t and ax.
Why is this?
Is this the wrong syntax for the definition of aVec?
Or is this simply the best one can hope for in V12?
Thanks,
- Joe