C1Ron

40 Reputation

3 Badges

4 years, 22 days

MaplePrimes Activity


These are questions asked by C1Ron

Is there any alternative to Mathematica's "RegionFunction" in Maple, with applications of controlling the plotting domain for surface plots ? This question has been asked previosly, and given a workaround by "Markiyan Hirnyk", suggesting to leave the function that is to be plotted undefined outside of the plot region. Something like:

f1 := proc(x,y) if x^2 + y^2 > 0 and x^2 + y^2 < 4 then 8 - x^2 - y^2 end if end proc:
f2 := proc(x,y) if x^2 + y^2 > 0 and x^2 + y^2 < 4 then x^2 + y^2 end if end proc:
plot3d({f1,f2}, -2..2, -2..2) 

The result is clearly not good looking. You can increase the number of points, but we need a better way to do this.

BTW, the similar question was asked in 2010. Are there any better alternatives, ~ 10 years later ?

Simple example to illustrate the desired functionality:
Say we have a 2D vector function which describes the position of a particle

r := t -> <5*cos(Pi*t), 5*sin(Pi*t)>

We want to define the velocity and acceleration as functions, so we could do something like

v := t -> <diff(r(t)[1], t), diff(r(t)[2], t)>

The problem now is that we cannot call our velocity function with numeric arguments.
A simple solution is to call the function via "subs", as in

subs(t = 2, v(t))

but IMHO, this is not very elegant and I guess inefficient. Is there a command that enables for pulling out the evaluated result from diff such that it can be used directly as a functional expression ? I.e., I want to be able to call

v(2)

directly, without having to do substitutions.

 

EDIT:

I found that you can do

v := <diff(r(t)[1], t, diff(r(t)[2], t)>
v := unapply(v, t)

but please provide your recommendations. Thanks

I have started to use Maple to test my calculations for a complex variable course.

The example is a complex integrand, and integration about an ellipse centered at origin.
Integrand has function 

f(z) = z*exp(a*z) / (z2+1)2

C:  z(t) = cos(t) + i*2*sin(t)

where a is a real constant. My idea is shown in the attatched workbook, i.e. 

dz = -sin(t) + i*2*cos(t) dt
g(t) = (-sin(t) + i*2*sin(t)) * f(cos(t) + i*sin(t))
int(g(t), t = 0..2*Pi)

PS, I've done similar code previously, but only for circle contours at center (see attachement)

The analytical answer is pi*a*sin(a), and Maple gives this correct for circular contours, but not for the ellipse.

So, what I'm asking is not how to solve the problem, but how to perform (arbitrary) contour integrals in Maple.

attachForMaplePrime.mw

I find the 2D math input in Maple to somewhat cumbersome for various expressions.
Specifically, I have a function f(z) = z^2, with w = f(I x + y) where I is the imaginary number.

I typed the line in 2D math

plots[implicitplot]({Im(w) = 2, Re(w) = 2}, x = -5 .. 5, y = -5 .. 5, colour = {"Blue", "Red"})
Error, (in plot/color) invalid color specification: {"Blue", "Red"}

For some reason this does not work in 2D math, but in Maple-input it works as expected.

I recall from past use of Maple, that there were other problems as well with the 2D math input.
I know you need to be particular with the use of space. 

Are there other common pitfalls or "bugs" related to use of 2D math input ?

I try to define an ellipse using the geometry package

with(geometry):

ellipse(e1,['foci'=[[0,1],[4,1]], 'MajorAxis' = 8],[x,y]);

 

I get the message:  Error, (in geometry:-ellipse) wrong type of arguments

but the documentation tells me that I can define an ellipse this way...

 

Page 1 of 1