Maple 2016 Questions and Posts

These are Posts and Questions associated with the product, Maple 2016

I am practicing with some diff equations. I am having problem solving for one of the constants. I am having a pproblem assigning a value to derivatives or 2nd derivatives. What is a good general technique is this type of situation?
 

restart

NULL

``

omega^2 = g/l

omega^2 = g/l

(1)

Eq1 := diff(Theta(t), t, t) = -omega^2*Theta(t)

diff(diff(Theta(t), t), t) = -omega^2*Theta(t)

(2)

ics := Theta(0) = 0, (diff(Theta(t), t))(0) = Vmax, (diff(Theta(t), t, t))(0) = 0

Theta(0) = 0, (diff(Theta(t), t))(0) = Vmax, (diff(diff(Theta(t), t), t))(0) = 0

(3)

SHM := dsolve({Eq1, ics})

(4)

SHM := dsolve({Eq1})

{Theta(t) = _C1*sin(omega*t)+_C2*cos(omega*t)}

(5)

SHM := dsolve({Eq1, Theta(0) = 0})

Theta(t) = _C1*sin(omega*t)

(6)

``

diffSHM := diff(SHM, t)

diff(Theta(t), t) = _C1*omega*cos(omega*t)

(7)

``

(Theta(t))(0) = 0, (diff(Theta(t), t))(0) = V

(Theta(t))(0) = 0, (diff(Theta(t), t))(0) = V

(8)

``

``

``

``

``

NULL

NULL


 

Download SHM.mw

I was trying to write a procedure that would compute a simple linear equation using the Extended Euclidean Algorithm. I was thinking of a procedure like the following:

solveEeaMatrix := proc (a::list, b::list) 
 local c::list;  
 c := a -iquo(a[1],b[1])*b;  
 print(c);  
 while (c[1] <> gcd(a[1],b[1]) do 
 ...

I am basically stuck at this part as

1) I don't know how to setup a multi-dimensional array that could dynamically grow(as a possible solution).

2) I can't come up with a recursive function that could possibly take care of this.

In short, if I am given for example an equation like: 84*x+203*y = 14

I will transform it into 2 linear equation as follow:
row0 := [203, 0, 1] row1 := [84, 1, 0] Subsequently, I will perform the following:

c := a -iquo(a[1],b[1])*b;  

Where aand b are both lists and arguments of the procedure and cbeing another list and a local variable.

But I don't know how to do the following programmatically:

row3 := row1-iquo(row1[1], row2[1])*row2;
row4 := row2-iquo(row2[1], row3[1])*row3;
row5 := row3-iquo(row3[1], row4[1])*row4;
and so on ...                  

Any hint would be appreciated.

Dear All, 

I am trying to use define_external to use a C dll from inside MAPLE. The C dll exports a function that has a argument of type function pointer which has a return type of pointer. The function itself returns pointers.  

Pointers are needed as return types as the C function needs to return arrays. 

When I try to pass the C function, as maple procedure as the argument, it errs saying "Error, (in rk4_vec) number expected for float[8] parameter, got proc () option remember; table( [( 1 ) = HFloat(1.0), ( 2 ) = HFloat(-0.0) ] ) 'procname(args)' end proc"

rk4_vec is as follows: 

rk4_vec := define_external("rk4vec", 't0' :: float[8], 'm' :: integer[4], 'u0' :: ARRAY(1..2,datatype=float[8]), 'dt' :: float[8], 'f' :: PROC('t' :: float[8], 'm' :: integer[4], 'u' :: ARRAY(1..2,datatype=float[8]), 'RETURN' :: REF(float[8])), 'RETURN' ::REF(float[8]), "WRAPPER", LIB="rk4.dll");

rk4vec in C looks like this: 

double *rk4vec ( double t0, int m, double u0[], double dt, 
  double *f ( double t, int m, double u[] ) )

I am passing as :

rk4vec_test_f := proc(t, n, u)
local uprime :: REF(float[8]);
#uprime := Array(n);
uprime(1) := u(2);
uprime(2) := -u(1);
return uprime;
end proc;

I have tried the RETURN type on the define_external call as : float[8], ARRAY(1..2, datatype=float[8]) , but that didnt work either. I got the idea of using REF from times2 example on this link.

Any guidance in this matter is highly appreciated. 

Attached are the C file, the dll, maple worksheet. Tested on Windows, with 64-bit, Maple 2016 standard. rk4.zip

 

Funny, I can't seem to find a list of all available units in the help file.

Is there not a listed table of units somewhere?

**edit add**  conversion of units I mean.  ie.  meters, miles, gallons, litres, Pa, etc...

I wish to solve for k interms of x, e is a constant in the equation k=x+e*sin(k). Using the solve function, i got 

RootOf(_Z-x-e*sin(_Z)) and using the function allvalues(RootOf(_Z-x-e*sin(_Z))) still gave the same expression in _Z. Please is there a way out because I need the value of  as a substitute to another equation. Any help will be highly appreciated.
 

I am trying to model a disease. The equation is as follows:

S*X - f(X,S,Sp) = 100

I have data for S, I have data for X and I have data for f(X,S,Sp) however I want to find an equation for f(X,S,Sp) that has the best fit with the data because I need to use it later on in my calculation. If anyone is intrested S is the sensitivity of the blood test, Sp is the specificity of the blood test. This means that X*(1-Sp) is the number of false positives.

I currently dont have access to Maple hence I am doing all my modeling in excel 2016. So I am severly limited because excel is useless at algebra.

Maple.xlsx

I use maple 2016 on linux with X.  When minimized, the maple icon is very small.  Also, the help icon is very small.

Are larger icons available?

The maple icon is ./bin/Maple2016.png.  I can not find the help icon.  Any ideas?

I have a PDE with boundary conditions, from a NASA paper.  I always seem to have problems expressing the bc.

PDE := diff(u(x, t), t) = (1/4)*exp(2)*exp(-u(x, t))*(diff(diff(u(x, t), x), x))/(x^2+2);

The initial/boundary conditions are

@t=0, u(x, t) = 2-2*ln(-x^2+2)

@x=0, diff(u(x,t),x)=0  ## this is the bc I have problem expressing

@x=1, u(x,t) = 2+ln(1+t)

The exact solution given in the paper:

2 + ln(1+t) - 2*ln(2-x^2)

I tried

ics := u(x, 0) = 2*(1-ln(2-x^2));

bcs := D[1](u(0,t))=0, u(1,t)=2+ln(1+t);

PDEtools[Solve]([PDE,ics,bcs]); ## no solution

How do I do this?

Tom Dean

We have just released an update to Maple.  It includes updates to the Maple Workbook, the video component, the Physics package, and many other small improvements throughout the product. It is available through Tools>Check for Updates in Maple, and is also available from our website on the Maple 2016.2 download page.

eithne

Greetings

How can I get LPSolve to output the unique subsets of {3,1,1,2,2,1} which sum to 5 (no recycling of set values)

partition.mw

(the code is a Yury/Love hybrid).

hi.

please help me for remover this problem.

''''

-Float(infinity)*signum((5.*A3*A1-24.*A2^2)*A1/A2^2)''''

ReducedCantiler.mw
 

restart

f := -(2/3)*eta^3+(1/2)*eta^2+eta; -1; g := -eta^2+1; -1; h := -eta^2+1; 1; F := proc (eta) options operator, arrow; A1*f end proc; 1; G := proc (eta) options operator, arrow; A2*g end proc; 1; H := proc (eta) options operator, arrow; A3*h end proc

proc (eta) options operator, arrow; A3*h end proc

(1)

Q1 := diff(F(eta), eta, eta, eta)+.5*H(eta)*((diff(F(eta), eta))^2+F(eta)*(diff(F(eta), eta, eta)))/G(eta)^2+2*(diff(G(eta), eta))*(diff(F(eta), eta, eta))/G(eta)-(diff(H(eta), eta))*(diff(F(eta), eta, eta))/H(eta); 1; Q2 := diff(G(eta), eta, eta)+H(eta)*((diff(F(eta), eta))*G(eta)+.5*F(eta)*(diff(eta, eta)))/G(eta)^2+2*(diff(G(eta), eta))^2/G(eta)-((diff(H(eta), eta))*(diff(H(eta), eta)))/H(eta)+(diff(F(eta), eta, eta))^2-(H(eta)/G(eta))^2; 1; Q3 := diff(H(eta), eta, eta)+(.5*1.3)*H(eta)*(5*(diff(F(eta), eta))*H(eta)+F(eta)*(diff(H(eta), eta)))/G(eta)^2+2*(diff(G(eta), eta))*(diff(H(eta), eta))/G(eta)-(diff(H(eta), eta))^2/H(eta)+(1.3*1.44)*H(eta)*(diff(F(eta), eta, eta))/G(eta)-(1.3*1.92)*(H(eta)/G(eta))^3

-2*A3+.65*A3*(5*A1*(-2*eta^2+eta+1)*A3*(-eta^2+1)-2*A1*(-(2/3)*eta^3+(1/2)*eta^2+eta)*A3*eta)/((-eta^2+1)*A2^2)+4*A3*eta^2/(-eta^2+1)+1.872*A3*A1*(-4*eta+1)/A2-2.496*A3^3/A2^3

(2)

Eq1 := int(Q1*f, eta = 0 .. 1);

-0.2600000000e-1*A3*(24.*A1*A2^2-65.*A1*A2*A3+64.*A3^2)/A2^3

(3)

sol := solve({Eq1 = 0, Eq2 = 0, Eq3 = 0}, {A1, A2, A3}); J := min(select(`>`, sol, 0))

Error, invalid input: `>` expects 2 arguments, but received 1

 

A11 := evalf(simplify(sol[1, 1])); A22 := evalf(simplify(sol[1, 2])); A33 := evalf(simplify(sol[1, 3]))

Error, invalid subscript selector

 

``


 

Download ReducedCantiler.mw

 

How to find the integral of (x+y)/(x+y+z) over the part of the unit ball  centered at the origin which lies in the positive octant { x>=0 , y>=0, z>=0 } ? Numeric calculations suggest Pi/9.

How to find the double integral of sin(x^2)*cos(y^2) over the disk of radius R which is centered at the origin? 

Here is my try 

restart; evalf(VectorCalculus:-int(sin(x^2)*cos(y^2), [x, y] = Circle(`<,>`(0, 0), 1), inert), 15);
                       0.722091449378409
identify(%);
                       0.722091449378409

 

Hello people in mapleprimes,

I want to modify the following expression a to b. For it, I used c code.
But, as seen in d, just using c returns a. Originally, I intended phi being between 0 and 1, so
that 1-phi >0. Isn't any better way to modify a to b? and it is better to have maple sort expression remembering 1-phi to be positive, and to have maple give any priority to it in modifying a to b.

a:=(-2*theta+1)*phi/(phi-1)+theta;
b:=(2*theta-1)*phi/(-phi+1)+theta;
c:=simplify(-1*numer(op(1,aa)))/simplify((-1)*denom(op(1,aa)))+theta;
d:=simplify(c)
(-2*theta+1)*phi/(phi-1) + theta

I will be very glad if you borrow me your idea.

Thank you in advance.

Hi All,

To get EOM of a specific type of vibrating shell structure, I constructed the Hamilton equation of the system with messy and complex integrand (so many derivatives and variables are included). Now I have to calculate the variation of the Hamilton equation (del(int((T+U-V),t=t0..t1)=0) to get the EOMs and BCs of the system.

Is there anybody to know how to take a variation of such bulky integral in Maple?

Is there anyone to have experience in finding the EOM of shell structure using variational calculus in Maple?

Any comment will be useful.

Regards,

 

1 2 3 4 5 6 7 Last Page 1 of 25