Axel Vogt

5936 Reputation

20 Badges

20 years, 251 days
Munich, Bavaria, Germany

MaplePrimes Activity


These are answers submitted by Axel Vogt

You will have to know both sides and if you are new to Maple it is better to learn some handling working through the small introductory handbook:

the (univariate) function is sin (not sin(x)) and differeniating can be done through D(sin), but also other ways, if you can specify the 'variable' in your expression

in general that will only work for functions defined in Maple, not in VB

examples are given in ..\samples\OpenMaple\msvb of your Maple installation

Having no VB I think the communication for what you want is through strings and probably is close to what is done in connecting Maple and Excel (not sure how open those codes are).

But certainly challenging for a new user (and you are supposed to know VB coding well)

Seems to be homework or do you use pluralis majestatis? :-)

At +-infinity you decide by the leading coefficient and as long as p' is
strictly positive your p is strictly increasing - if p' has a zero then it
is isolated iff p' is not a constant. From that you build your intervals,
assuming the Reals are meant.

If it is for Maple then it is likely you need concrete polynomials and you
probably have to use Numerics if degree is beyond 4.

PS: if somebody posts a question which should be substantiated it is
better to do that in public, ok?

so what is your actual question?

Then it may (silently) depend on the precision used and that is not good at all ... explicit conversion to Naturals is trivial, if one really wants it (and knows which one is desired)

  Digits:=10; evalf(Pi * 1e14); round(%);

                           314159265400000

  Digits:=14; evalf(Pi * 1e14); round(%);

                           314159265358980


Do not hesitate to check the help ... which says, that the 2nd parameter has to be a positive integer while 1E6 is a float (just type that in).

So just modify it for your intended usage:

  mySample:= (X,n) -> Sample(X,round(n));
  xs:=mySample(X,1E1);

If I remember correctly one can use Splines for that by setting degree = 1

# re-write ln a sum
> ln(x);  
> convert(%, Sum, dummy=k) assuming abs(1-x)<1;
> simplify(%); combine(%); simplify(%);
> 
> # integrate each summand
> op(1,%); Int( %*ln(1-x)^2,x=0..1);
> Change(%, 1-x=y,y); value(%) assuming 0 < k; factor(%);
> 
> # sum it
> Sum(%, k=0..infinity);
> value(%);
> evalf(%);


                                            2
                                          Pi
                         -6 + 2 Zeta(3) + ---
                                           3


                             -0.306018060


What do you mean by "Compare the fit and LeastSquare commands to the simplicity and elegance of the ShapiroWilkWTest in Maple where the output is just like a dream ..."?

do not know Aple, but if you tye in the command "libname" Maple should show you its pathes and from that you may guess how to proceed (for a backslash you may need 2 of them, as above, if it is an escape character). Otherwise you may want to check the documentation (or wait until somebody provides a definite answer ...)

i find that at c\programme\maple12\bin.win, which is my standard path

Export(R, "D:\\temp\\Employees.xls","Payroll", "B2"); lets me put it to a desired location

PS: i find it quite odd, that these commands do not work with the classical interface ... really odd.

what is sin2 ? use multiplication signs - or do you mean square?

what is cos^2(teta) ? ( cos(theta) )^2 or cos(cos(theta))

does rcos have a meaning?

and pi is written in UpperCase for Maple, use Pi, not pi

you 'always' can use numerical evaluation to check whether your input makes sense

I prefer either UpperCase Sum or would use add, if only plotting or evaluation is needed
f:= n -> Sum(Sum((-1)^(k-j)*binomial(k,j)*j^(n), j=1..k ), k=1..n);
g:= n -> add(add((-1)^(k-j)*binomial(k,j)*j^(n), j=1..k ), k=1..n);

[seq([n,ln(f(n))], n=0 ..40)]:  # using log, since values become large
evalf(%):                       # compute the values now
plots[pointplot](%);            # plot the pairs
To get single values you can use
f(5); evalf(%);
                                 541.

g(6);
                                 4683

.

If you can accept non-public code you will find some solution by Beliakov at the Maple Application Center, he calls it the LibLip Maple toolbox

PS: reading your "data are material properties" I hope not to being faced with that approach in any airplane in future ...  :-)

The following should do:

#####################################################################################
med:= proc(f1,f2,f3)
option hfloat;
  Statistics[Median]([f1,f2,f3]);
end proc;

1-2*sin(x)*(sin(x)+u*sin(3*x)+v*sin(5*x)); 
combine(%, trig); simplify(%, size);
g:= unapply(%, x, u,v);

Int(g(x, u,v), x = x0 .. x1); value(%);
combine(%, trig); simplify(%, size);
G:= unapply(%, x0, x1, u,v);

RootOf(y^3+a*y^2+b*y+c = 0, y): 
[allvalues(%)]:
cubeRoot:= unapply(%, a,b,c):

A := proc (u, v)
option hfloat; 
local Delta, Res, R1, R2, R3, S, temp, temp1, temp2, temp3, a, b, c,
  J12, J23, J0, J3; #, g; 
#g := proc (x) options operator, arrow; 1-2*sin(x)*(sin(x)+u*sin(3*x)+v*sin(5*x)) end proc; 
 
a := (1/4)*(-u-5*v)/v; 
b := (1/32)*(2+6*u+10*v)/v; 
c := -(1/32)/v; 
  
Res := evalf( cubeRoot(a,b,c) ); #solve(y^3+a*y^2+b*y+c = 0, y); 
R1 := Res[1]; 
R2 := Res[2]; 
R3 := Res[3];
 
Delta := evalf(-u^2-10*v*u-125*v^4+4*v-37*v^2+150*v^3+
  50*v*u^2-10*v^2*u+2*u^3-12*v*u^3-10*v^2*u^2-9*u^4-100*v^3*u); 
if 0.0 < Delta then 
  temp := Re(R1); 
#  S := 2*evalf( Int(g(x), x = 0 .. arcsin(sqrt(temp))) )
  S := 2*G(0, arcsin(sqrt(temp)), u,v); 
elif Delta <= 0.0 then 
  temp1 := min(Re(R1), Re(R2), Re(R3)); 
  temp3 := max(Re(R1), Re(R2), Re(R3)); 
  temp2 := med(Re(R1), Re(R2), Re(R3));
  #print(temp1, temp2, temp3);
  #print(arcsin(sqrt(temp1)),arcsin(sqrt(temp2)),arcsin(sqrt(temp3)));
#  J12:= evalf( Int(g(x, u,v), x = arcsin(sqrt(temp1)) .. arcsin(sqrt(temp2))) );
#  J23:= evalf( Int(g(x, u,v), x = arcsin(sqrt(temp2)) .. arcsin(sqrt(temp3))) );
  J12:= evalf( G(arcsin(sqrt(temp1)), arcsin(sqrt(temp2)), u,v) );
  J23:= evalf( G(arcsin(sqrt(temp2)), arcsin(sqrt(temp3)),  u,v) ); 
  if abs(J12) < abs(J23) then
#    J3:= evalf( Int(g(x, u,v), x = arcsin(sqrt(temp3)) .. (1/2)*Pi) );
    J3:= G(arcsin(sqrt(temp3)), (1/2)*Pi, u,v);
    S := 2*abs(J3) 
  else
#    J0:= evalf( Int(g(x, u,v), x = 0 .. arcsin(sqrt(temp1))) );
    J0:= G(0, arcsin(sqrt(temp1)), u,v); 
    S := 2*abs(J0) 
  end if
else
  #NULL; 
end if;
 
S:= Re( evalf(S) );
return( S ); 
end proc;
#####################################################################################

now first test on some values

  A(1.0, 0.4);
                          0.412962770389228

then for a curve, i.e. fix one input

  plot( 'A'(1.0, v), v = 0.1 ..2.0, numpoints=5);

which works (using the quotation marks is needed here for 'option hfloat').

Now try your 3d plot

  plot3d('A'(u, v), u = 0.1e-2 ... 3, v = 0.1 ... 3, #style = point, 
    numpoints=20^2, axes=boxed);

First 66 67 68 69 70 71 72 Last Page 68 of 93