manueleleonelli

40 Reputation

4 Badges

11 years, 252 days

MaplePrimes Activity


These are questions asked by manueleleonelli

Hi all,

I want to define variables with indices, possibly zero. So for example I define mu[01] and mu[10]... 

My problem is that mu[01] automatically becomes mu[1] in Maple's output, so that I could not distinguish it from mu[001]... 

Is there any way to address it?

Thanks 
Manuele

Hi all,

I would like to set equal to zero some monomials in a polynomial. In particular those monomials in which an unknown has a certain degree. 

For example for the polynomial

poly := x^2*y+x*y*z+x*z

i would like to set equal to zero the monomials in which x has degree 1, that is x*y and x*z.

Is there a way to do it?

Thanks in advance
Manuele 

Hi all,

I'm trying to plot the regions of a cube that are defined by an inequality. At the moment I am able to plot only the surface defined by the corresponding equality. 

That's the code: 

with(plots)

implicitplot3d(x^2*y = z, z = 0 .. 1, y = 0 .. 1, x = 0 .. 1);

Now I would like to plot the two regions defined by the corresponding inequality. 

Have you got any idea on how to do this?

Bests

Manuele

Hi all,
I am writing a procedure that I would like to have several outputs. The code is as follows:

Initialize := proc (p, theta, PiV, PiU, n, m)

J := CompJ(PiU, m);

for i to n do

if member(i, V) then

Ai[i] := CompAi(PiU, PiV, i, n, J)

end if

end do

end proc

The function calls other functions previously defined that are not important here. Basically I would like to return the set J and the list Ai, but I am not sure on how to do it. 

Once the procedure returns these elements, I would like to assign them to some variables. I am not sure on how this can be done when a function returns more than one thing.

Thanks in advance for the help
Bests
Manuele 

Hi all,
I've got this code but the second if statement does not seem to work within the for cycle... If I write it outside the cycle it works... Can you help me with this??? 
 
Dec := {1, 4}; Var := {2, 3, 5, 6}; n[1] := 4; n[2] := 3; n[3] := 2; n[4] := 3; n[5] := 4; n[6] := 2; Ut := {1, 2, 3}; pa[2] := {1}; pa[3] := {1, 2}; pau[1] := {3}; pa[5] := {4}; pau[2] := {5}; pa[6] := {4, 5}; pau[3] := {4, 6}; J := {3, 5, 6};
m := numelems(Ut); n := numelems(`union`(Dec, Var)); j := numelems(J);

if member(n, J) then A[n] := {`union`(pa[n], `intersect`(pau[3], {n}))}; jcur := j-1 end if

for i from n-1 to 1 do if member(i, J) then A[i] := `union`(`union`(A[i+1], pa[i]), `intersect`(pau[jcur], {i})); jcur := j-1 else A[i] := `union`(A[i+1], `intersect`(pa[i], {i})) end if end do

Thanks in advance
manuele

1 2 Page 1 of 2