mmcdara

3728 Reputation

17 Badges

6 years, 32 days

MaplePrimes Activity


These are questions asked by mmcdara

Why does  1e-(Digits) return 1. and 1e-Digits generate an error?
 

1e-Digits;
Error, missing operator or `;`

1e(-Digits); 
                               1. 
type(Digits, posint)
                              true

 

Hi, 

I have  an expression made of a sum of different terms from which I want to extract all terms of a specific form.

A typical expression and the functions I want to extract is given in the attached file.

You will see in the example that the terms in the expression can be 

  • a constant
  • a continuous function of t
  • a piecewise function like
    something*piecewise(a(t) < 0, A(t), a(t) < 1, B(t), ...)
    
  • a piecewise function like
    something*piecewise(t < 0, A(t), t < 1, B(t), ...)

     

The functions I want to extract are only those of this latter form .

Thanks in advance

MyExpr.mw

PS: all the situations I have to manage contain expressions of the form of the prototype expression given in the attached file.
       Nothing more general than this.

Suppose you do this

save something, afile.m;

and that later someone else does this

read afile.m;

Let's assume that this person does not know the names of the variables you have saved.
A way to get these names could be

before := { anames('user') };
read file.m:
after := anames('user') minus before minus {'before'}


I thought after would only contain something, but it also contains all the elements of before, just as if  
anames('user') minus before was not effective (see PS below)
Exemple

restart:
interface(version)
Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 

   21 2015 Build ID 1097895
a:=1:
before := {anames('user')};
                              {a}
b:=2:
after := {anames('user')} minus before minus {'before'}
                         {a, b}



How can I obtain the set of the new user-asigned names?

PS: Why does displaying  before give the value assigned to and not a itself?

before
                              {1}



Thanks in advance

Hi,

If I use a package  that I don't wnt to load, is these two is the best way to proceedcontains

  • alias (P= package): 
  • macro (P= package):
     

Thanks in advance

Hi, 

Here is my first attempt to work with Embedded Components.
I loaded the "Bezier curve" example ("how to drag points") and the "Linear Regression" one ("how to add points") from the MathApps, merge the codes and modified them in order to draw a polygon with an arbitrary number of sides.

After many unsuccessful attempts I begin to understand the mogic behind Embedded Components (I'm familiar with Maplets and I'm sure this didn't help me).
For now , I am able to define points, drag them, and erase everything. A small step for Mankind but a huge step for me.

What I would like to do now is to erase some points.
The basic code is 

# Plot1 is the PlotComponent
# The list of the points is pt
#
# x0 and y0 are the co-ordinates of the point to remove from pt
# _removing is the number of the point in pt closest to (x0, y0)
#
# Update is the procedure which does the plot in Plot1

Remove := proc()
     x0 := DO(%Plot1( "clickx" ) );
     y0 := DO(%Plot1( "clicky" ) );
     d := map(n -> add((pt[n]-~[x0, y0])^~2), [$1..nops(pt)]):
     _removing := sort(d, output=permutation)[1];
     subsop(_removing=NULL, pt);
     Update();
end proc;

Unfortunately I don't understand well enough the logic of  Embedded Components to make this work

Can you help me fix this?
TIA

sketch.mw

PS: In procedure Update I define two plots named fond (=background) and grille (=grid): grille is a workaround to "toggle gridlines" or 'gridlines'=true for none of these options work for me (Maple 2015.2, Mac OSX Mojave)

4 5 6 7 8 9 10 Last Page 6 of 33