MaplePrimes Questions

I'm trying to upload a file to Maple Cloud for the first time, but I am getting an error due to the way I use libraries.

The first lines of the startup code in the sheet look like this.

libname := "S:/Maple/NODE_Library", libname;
with(NODETreMaterial);
with(NODETreTverrsnitt);

The libraries are on a network drive on our server.

The question is - how can I solve this? Would it be better to somehow upload those libraries to Maple Cloud (no idea how to do that by the way), or can it be solved in a different way?

 I want to compute a function W for certain values of x < π/2. W is a ratio of 2 positive values -they are squares-computed using dsolve and that ratio seems to be negative when evalf is applied to the answer.!!!  The true answer (without the evalf) are positive. Also, applying evalf to the correct answers does not produce those silly negative answers. Any suggestions? I would prefer uplaod my file but do not know how>

Here is the file:

This worksheet has a system of ode's ( a second order and a first order), a power series solution near 0 to use for inital conditions, and a function W of the vairables that I want to compute for certain values of x < π/2. W is a ratio of 2 positive values and that ratio seems to be negative when evalf is applied to the answer.!!! The true answer (without the evalf) are positive. Also, applying evalf to the correct answers does not produce those silly negative answers.

  • >  restart;

  • >  alias(B=b(x));alias(Bp=diff(b(x),x));alias(f=F(x));alias(fp=diff(F (x),x));alias(fpp=diff(F(x),x,x));

    B B, Bp

    B, Bp, f B, Bp, f, fp

    B, Bp, f, fp, fpp

  • >  eq1 := sin(x)*(1+B*cos(x)^2)*fpp-(2*((f^2-2*B)*cos(x)^2-f^2+3*B* (1/2)-1))*cos(x)*fp+2*sin(x)*((f^2-3*B*(1/2))*cos(x)^2-f^2+(1/2)* B-1/2)*f = 0;eq2 := (-B*cos(x)^6+(B-1)*cos(x)^4+cos(x)^2)*fp^2+2*f* cos(x)*sin(x)*(cos(x)-1)*(cos(x)+1)*(1+B*cos(x)^2)*fp+cos(x)*sin(x) *Bp+B*cos(x)^6*f^2-(2*(B-1/2))*f^2*cos(x)^4+B*cos(x)^2*f^2-f^2+B = 0;

    eq1 sinx 1 Bcosx2fpp 2 f2 2Bcosx2 f2 3B 1cosxfp 2

    2sinx f2 3B cosx2 f2 B 1 f=0 222

    eq2 Bcos x 6 B 1 cos x 4 cos x 2 fp2 2fcos x sin x cos x
    1 cosx 1 1 Bcosx2 fp cosx sinx Bp Bcosx6f2 2 B

    1 2

(1)

f2cos x 4 Bcos x 2f2 f2 B=0 > f2p:=solve(eq1,fpp);

f2p

(2)

(3)

1 2sin x f3cos x 2 sin x 1 Bcos x 2

2cos x 3fpf2
3sinx fBcosx2 4cosx3fpB 2sinx f3 2cosx fpf2 sinx fB

3cosx fpB sinx f 2cosx fp

  • >  fs:=x^8*(127/604800*C+653/17010*(C^5)+2/81*(C^7)+773/1020600*(C^3)) +x^6*(17/5670*(C^3)-4/81*(C^5)+31/15120*C)+x^4*((1/9)*C^3+7/360*C)+ (1/6)*x^2*C+C:

  • >  Bs:=x^6*(20/189*(C^4)+4/315*(C^2))+4*x^4*C^2*(1/45)+2*x^2*C^2*(1/3) :

  • >  Digits:=15:

  • >  ic:=(c)->{F(1e-5)=subs([x=1e-5,C=c],fs),D(F)(1e-5)=subs([x=1e-5,C= c],diff(fs,x)),b(1e-5)=subs([x=1e-5,C=c],Bs)}:

> nans:=dsolve({eq1,eq2} union ic(c),{f,B},numeric,stiff=true,

(4)

> parameters=[c]);

nans proc x_rosenbrock ... end proc

(4)

(5) (6)

> W:=fp^2*cos(x)/f^2;

W fp2 cos x f2

> Wp:=simplify(subs(fpp=f2p,diff(W,x)));

cosxsinx 1 Bcosx2fp2 f27Bcosx4 f25B3cosx2fpcosxf2

1

1
Wp f3sin x 1 Bcos x 2 4fp 2 f 4

444

3B cosx2 f2 B 1 f2sinx 222

  • >  k:='k': for k from 4 to 5 do nans(parameters=[k]); evalf(eval([W, Wp], nans(Pi/2-1e-10)),5); end do;

    c = 4.
    482.73, 1.3965 10
    8

    c = 5.
    5.6838 10
    6, 1.4948 1013

  • >  k:='k': for k from 4 to 5 do nans(parameters=[k]); eval([W,Wp],

    nans(Pi/2-1e-10)); end do;

    c = 4. 0.0131412243081803, 1.31416436948280 108

    c = 5.
    154.729383663460, 1.54702786932958 10
    12

  • >  evalf([0.0131412243081803, -1.31416436948280*10^8],5);

    0.013141, 1.3142 108

(7)

(8) (9)

 

Hi, after solving an equation and inserting it in the original equation the result is not equal to zero!!

What is the problem?

in the attached file below I obtained 'q' and then I put it in the eq (3), but the result is not zero!!

Please help me.

555.mw

I am looking for an elegant way in which to find a vector that is perpendicular to another vector.  The attached worksheet shows one method, but this can result in a divide by zero error.  I could write a procedure to detect and avoid the divide by zero error, but this feels like a sledgehammer to crack a nut :-)

Another method might be to rotate the vector by PI/2, but I'm not sure how to do this.

Any suggestions would be gratefully received!

Perpendicular_Vectors.mw

 

 

 

Hi, 
I need do generate a large number of matrices (always with the same dimensions) whose each column is a random sample of a different random variable.
I wrote a rather simple procedure to do that (see below a notional example). Let T and S the time and the memory size required for a single execution of this procedure, then its execution N times needs a time N*T and a size N*S.
If time is not a problem, the increase in memory size is extremely constraining.
How should I write this procedure in order that N executions of it use a memory of the order of S and not N*S?
 

Download Not_Efficient.mw

 

 

I keep getting this datatype float[8] error, can some1 please help me. 
upload the mw file here faq.mw

Also i have a working for lopp and want to make a procedure. 
Any suggestions will be helpful as well. Thanks.

This is a given set of equations (from a classifier problem in deep learning):

I tried to replicate the expression in Maple, but it was unsuccessful. 

Q_MaplePrime20200417.mw

Would you tell me how to make it work?

Then, please let me know how to refer to a previous result (equation number) in the current expression. 

The last line above (and the attached Maple document) shows my attempt, It did not work. 

Thank you/Be healthy!

 

 

Hello,

How to solve this error? Thank you

Sistem := diff(E[1](t), t) = subs(E[1] = E[1](t), L[1] = L[1](t), P[1] = P[1](t), M[1] = M[1](t), E[2] = E[2](t), L[2] = L[2](t), P[2] = P[2](t), M[2] = M[2](t), Data, dE1), diff(L[1](t), t) = subs(E[1] = E[1](t), L[1] = L[1](t), P[1] = P[1](t), M[1] = M[1](t), E[2] = E[2](t), L[2] = L[2](t), P[2] = P[2](t), M[2] = M[2](t), Data, dL1), diff(P[1](t), t) = subs(E[1] = E[1](t), L[1] = L[1](t), P[1] = P[1](t), M[1] = M[1](t), E[2] = E[2](t), L[2] = L[2](t), P[2] = P[2](t), M[2] = M[2](t), Data, dP1), diff(M[1](t), t) = subs(E[1] = E[1](t), L[1] = L[1](t), P[1] = P[1](t), M[1] = M[1](t), E[2] = E[2](t), L[2] = L[2](t), P[2] = P[2](t), M[2] = M[2](t), Data, dM1), diff(E[2](t), t) = subs(E[1] = E[1](t), L[1] = L[1](t), P[1] = P[1](t), M[1] = M[1](t), E[2] = E[2](t), L[2] = L[2](t), P[2] = P[2](t), M[2] = M[2](t), Data, dE2), diff(L[2](t), t) = subs(E[1] = E[1](t), L[1] = L[1](t), P[1] = P[1](t), M[1] = M[1](t), E[2] = E[2](t), L[2] = L[2](t), P[2] = P[2](t), M[2] = M[2](t), Data, dL2), diff(P[2](t), t) = subs(E[1] = E[1](t), L[1] = L[1](t), P[1] = P[1](t), M[1] = M[1](t), E[2] = E[2](t), L[2] = L[2](t), P[2] = P[2](t), M[2] = M[2](t), Data, dP2), diff(M[2](t), t) = subs(E[1] = E[1](t), L[1] = L[1](t), P[1] = P[1](t), M[1] = M[1](t), E[2] = E[2](t), L[2] = L[2](t), P[2] = P[2](t), M[2] = M[2](t), Data, dM2);
Error, invalid input: subs received Data, which is not valid for its 9-th argument

Hi,

I am using Direct Search Optmization package for a procedure using Search command and everytime I run it it'll give me a different answer. same procedure, same code, when executed few times every time it generates a different answer. Can anyone help me with this ? 

When executing DEBUG within inline code (not within a procedure) the values displayed in successive debug windows (on clicking continue) are added to the end of my worksheet. How can the latter display be prevented?

This Anti-derivative of  arccos(x)*arcsin(x), Maple  2020 cannot do that? It seems not difficult.

int(arccos(x)*arcsin(x),x)

In Mathematica, we can easily to get output :

2 x - Sqrt[1 - x^2] ArcSin[x] +  ArcCos[x] (Sqrt[1 - x^2] + x ArcSin[x])

When pressing !!! (Execute entire worksheet) it seems to me that startup code is executed.

Is that correct, and if - why is that so?

How can I transform the following differential equation from (x,t) to (X,T) coordinate, where, for example, X=x-alpha*t, T=beta*t (alpha and beta are constant)

diff(z, t)+(diff(R, x))*L+A*(diff(L, x))+diff(k, x, x)-(diff(k, t, t)) = 0

Thanks.

First 563 564 565 566 567 568 569 Last Page 565 of 2425