mugwort

40 Reputation

4 Badges

3 years, 330 days

MaplePrimes Activity


These are questions asked by mugwort

Hi,

I'm having trouble converting a static plot to animated plot:

Also I've been considering using functional operators instead of expressions so that there's no reuse of variable s when drawing different curves, though I'm not sure if this will be harder to differentiate since diff(expr, s) does not work on a functional operator meaning I'd have to do unapply(diff(f(s),s),s) which seems a long route and I'm not sure if it's what I'm looking for (in terms of simplification).

 

Thanks guys

agentpath.mw

Hi,

I'm trying to create an agent vehicle which drives along a path of a uniform width, and finds the distance to the edge of the path directly ahead of it. Like this:

The aim is to somewhat simulate how far the agent can see down the road.

Since the thickness of a plot curve is unrelated to the units of the axis, and has no means of interacting with objects this would be no use.

I also considered shadebetween function, however this only can shade between the y values of 2 functions, so for a vertical curve it cannot produce any width to the path.

I then realised using parametric equations of form (x(t), y(t)) would likely make most sense and wrote some code which roughly gets the boundarys at a fixed distance from the centre path equation, by adding the x-y components of the reciprocal of the gradient:

For certain simple path equations such as this one, it roughly works other than the areas between which the boundary curves overlap themselves (I would need to find these points of intersection and break the curves up to remove these squigly inner bits). Any advice on this would be much appreciated cause this seems like it will be tricky, if not computationally heavy.

 

More annoyingly, due to the nature of the trig functions involved, for more complex graphs which include a vertical turning point, the left and right boundaries seem to swap over:

and

Clearly this is not the behaviour I had in mind.. and I'm not sure what I can do to fix it, I think maybe using piecewise trig may be a potential solution to avoid the jumping from + to -, though I'm not sure where I would put these breakpoints (I've tried just using abs(arctan(...)) with no luck).

 

If anyone could help wih this that would be really appreciated, or even suggest a better approach to this problem!

Thanks

 

[code] agentpath.mw

Hi,

I'm trying to implement Kernal PCA, I've got a large kernal matrix for which I have checked the elements are of floating point type, however when I try to run the Determinant operation on the matrix all of the coefficients say float(undefined).

In the same worksheet, there I have implemented the standard PCA routine, for which the determinant operation works fine. You can see this operation functioning corrrectly in it's testing section.

If anyone has any idea why this might be occuring I'd be really grateful for some advice.

Thanks

FUML.mw

 

Hi guys

 

I've created a joint display which plots a spacecurve and an arrow which represents the tangent to the curve:

I've written this in the animation format so I can move the tangent arrow along the curve, however when I replace

arrow(subs(s=0,p),subs(s=0,ptan),width=0.3,length=4)

with

arrow(subs(s=A,p),subs(s=A,ptan),width=0.3,length=4)

I get the error:

Error, (in Plot:-AnalyzeData:-StandardizeData) points cannot be converted to floating-point values

I have tried animating the arrow alone(see below) and this works fine, so the problem is coming from try to pass the animation parameter A into the display array of multiple plots.

DG.mw

Thanks

Hello,

I currently have

And was wondering if there's a way to declare x as a real so that this evaluates to 1?

1 2 3 Page 1 of 3