Preben Alsholm

13743 Reputation

22 Badges

20 years, 340 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

In Maple 17
solve(sys, [c,d,e,f,g,h,i,j,k,l,m,n,p]);

returns [], i.e. it didn't find any solution.

This simpler version also returns an incorrect result:

s:=HFloat(-infinity);
type(s,positive);
returns true.

Could you correct the syntax of your input
eqt := y^5+y^4 + -0.5109*y^3 + -0.0595*y^2 + 0.0000-(-3.1086e-015*u^4 + u^3 + -0.5109*u^2 + -0.0595*u) = 0;
so it parses in Maple?
It is not clear to me what you intended it to mean, so I won't try myself.

An implementation of the intended procedure could be
F:=proc(L1::listlist) local L;
    L:=ListTools:-Flatten(L1);
    1/2*abs((L[3]-L[1])*(L[6]-L[2])-(L[5]-L[1])*(L[4]-L[2]))
end proc;
    
F([[a,b], [c,d], [e,f]]);

An implementation of the intended procedure could be
F:=proc(L1::listlist) local L;
    L:=ListTools:-Flatten(L1);
    1/2*abs((L[3]-L[1])*(L[6]-L[2])-(L[5]-L[1])*(L[4]-L[2]))
end proc;
    
F([[a,b], [c,d], [e,f]]);

@Yankel Yes, it is quite empty!
Did you actually write anything or did you try to dump (somehow) an image there?

Notice that if you change the problematic derivative (which is D[2](f)(0,tau), and not D[1](f)(0,tau) as you wrote ) to D[1](f)(0,tau), then things work.

@Alina8faq I now see what you did. You were in 2D input mode and then punched sin^2 resulting in

after that you moved the cursor down (with the arrow key) and punched (a+b).
One advantage of using 1D-input (as I always do) is that descriptions like the short one I gave above are totally unnecessary. You just write characters one by one and your commands may as well be written in a text editor. So when you wrote
K:=(sin^2(a+b)-sin^2(a-b))
then you didn't just punch those characters you also moved the cursor when necessary.

If you want you can change to 1D-input (Maple input) and worksheet mode under the menu items
Tools/Options/Display and Tools/Options/Interface, respectively.

@Alina8faq I now see what you did. You were in 2D input mode and then punched sin^2 resulting in

after that you moved the cursor down (with the arrow key) and punched (a+b).
One advantage of using 1D-input (as I always do) is that descriptions like the short one I gave above are totally unnecessary. You just write characters one by one and your commands may as well be written in a text editor. So when you wrote
K:=(sin^2(a+b)-sin^2(a-b))
then you didn't just punch those characters you also moved the cursor when necessary.

If you want you can change to 1D-input (Maple input) and worksheet mode under the menu items
Tools/Options/Display and Tools/Options/Interface, respectively.

@Alina8faq If you use 1D input (aka Maple input), then what you wrote results in 0:
K:=(sin^2(a+b)-sin^2(a-b));
returns 0. The reason is that 2(a+b) is interpreted as the constant function 2 applied to a+b, thus 2(a+b) = 2. In the same way 2(a-b) = 2. Thus (sin^2(a+b)-sin^2(a-b)) evaluates to sin^2 - sin^2 , i.e. 0.
If I insert K:=(sin^2(a+b)-sin^2(a-b)) as 2D input:

and then do
lprint(K);
then I get the following printout
sin^2*(a+b)-sin^2*(a-b)
and that is surely not what you want either, because sin^2*(a+b) is interpreted as the function
sin^2 times (a+b).

@Alina8faq If you use 1D input (aka Maple input), then what you wrote results in 0:
K:=(sin^2(a+b)-sin^2(a-b));
returns 0. The reason is that 2(a+b) is interpreted as the constant function 2 applied to a+b, thus 2(a+b) = 2. In the same way 2(a-b) = 2. Thus (sin^2(a+b)-sin^2(a-b)) evaluates to sin^2 - sin^2 , i.e. 0.
If I insert K:=(sin^2(a+b)-sin^2(a-b)) as 2D input:

and then do
lprint(K);
then I get the following printout
sin^2*(a+b)-sin^2*(a-b)
and that is surely not what you want either, because sin^2*(a+b) is interpreted as the function
sin^2 times (a+b).

@fairuzalwani I tried the following, where for my two examples I need simplify(z-ic) in order for the loop to stop. In your case it will depend on the kind of map (Map) you got.
I added a third example below.

Orbit:=proc(Map,ic,Nmax::posint:=100)
  local orbit,z,t;
  orbit:=Vector();
  orbit(1):=ic;
  z:=ic;
  for t from 2 to Nmax while simplify(z-ic)<>0 or t=2 do
    z:=Map(z);
    orbit(t):=z
  end do;
  orbit
end proc;

##########################################
f:=z->z^3;
Orbit(f,exp(I*2*Pi/5),10);
orb:=simplify(%);
plots:-complexplot(exp(I*t),t=0..2*Pi,color=blue):
plots:-complexplot(convert(orb,list),style=point,symbolsize=20,symbol=solidcircle):
plots:-display(%%,%);
#Try the same with only the word 'simplify' removed in the procedure Orbit
##########################################
f:=z->exp(I*Pi/10)*z;
Orbit(f,exp(I*2*Pi/5));
orb:=simplify(%);
plots:-complexplot(exp(I*t),t=0..2*Pi,color=blue):
plots:-complexplot(convert(orb,list),style=point,symbolsize=20,symbol=solidcircle):
plots:-display(%%,%);
#Again you may try the same with only the word 'simplify' removed in the procedure Orbit
####################
#Third example:
If your function maps a set of lists of pairs of integers into itself then the simple check z<>ic should do:
Orbit:=proc(Map,ic,Nmax::posint:=100)
  local orbit,z,t;
  orbit:=Vector();
  orbit(1):=ic;
  z:=ic;
  for t from 2 to Nmax while z<>ic or t=2 do
    z:=Map(z);
    orbit(t):=z
  end do;
  orbit
end proc;
##Simple example
f:=L->modp~(L+[8,9],5);
f([1,1]);
Orbit(f,[1,1],10);




@fairuzalwani I tried the following, where for my two examples I need simplify(z-ic) in order for the loop to stop. In your case it will depend on the kind of map (Map) you got.
I added a third example below.

Orbit:=proc(Map,ic,Nmax::posint:=100)
  local orbit,z,t;
  orbit:=Vector();
  orbit(1):=ic;
  z:=ic;
  for t from 2 to Nmax while simplify(z-ic)<>0 or t=2 do
    z:=Map(z);
    orbit(t):=z
  end do;
  orbit
end proc;

##########################################
f:=z->z^3;
Orbit(f,exp(I*2*Pi/5),10);
orb:=simplify(%);
plots:-complexplot(exp(I*t),t=0..2*Pi,color=blue):
plots:-complexplot(convert(orb,list),style=point,symbolsize=20,symbol=solidcircle):
plots:-display(%%,%);
#Try the same with only the word 'simplify' removed in the procedure Orbit
##########################################
f:=z->exp(I*Pi/10)*z;
Orbit(f,exp(I*2*Pi/5));
orb:=simplify(%);
plots:-complexplot(exp(I*t),t=0..2*Pi,color=blue):
plots:-complexplot(convert(orb,list),style=point,symbolsize=20,symbol=solidcircle):
plots:-display(%%,%);
#Again you may try the same with only the word 'simplify' removed in the procedure Orbit
####################
#Third example:
If your function maps a set of lists of pairs of integers into itself then the simple check z<>ic should do:
Orbit:=proc(Map,ic,Nmax::posint:=100)
  local orbit,z,t;
  orbit:=Vector();
  orbit(1):=ic;
  z:=ic;
  for t from 2 to Nmax while z<>ic or t=2 do
    z:=Map(z);
    orbit(t):=z
  end do;
  orbit
end proc;
##Simple example
f:=L->modp~(L+[8,9],5);
f([1,1]);
Orbit(f,[1,1],10);




First 161 162 163 164 165 166 167 Last Page 163 of 231