MaplePrimes Questions

Hello
I encountered with a problem in understanding of structured types. I test following structured types:



the result is

true

false
false

I cannot understand two last results as I expected to receive trues. Could you explain me the result?
Thank you.

UPD
A code appropriate for copy/pase along with short problem solution is presented below

restart;
`type/A1`:={integer, rational};
`type/A2`:=integer or rational; #  it matchs the expressions that literally contain `or` (see @Carl Love's
answer below)
`type/A3`:=OR(integer, rational); # `Or` should be used rather then `OR` (see @acer's
answer below)

x:=5;
type(x, A1);
type(x, A2);
type(x, A3);

> restart;
> with(plots);
> Eq1 := diff(f(eta), eta, eta, eta)+f(eta)*(diff(f(eta), eta, eta))-2*(diff(f(eta), eta))^2-M^2*(diff(f(eta), eta)) = 0;
/ d / d / d \\\ / d / d \\
|----- |----- |----- f(eta)||| + f(eta) |----- |----- f(eta)||
\ deta \ deta \ deta /// \ deta \ deta //

2
/ d \ 2 / d \
- 2 |----- f(eta)| - M |----- f(eta)| = 0
\ deta / \ deta /
> Eq2 := 1+(4/3)*R*(diff(theta(eta), eta, eta))+Pr*(f(eta)*(diff(theta(eta), eta))-(diff(f(eta), eta))*theta(eta)) = 0;
4 / d / d \\
1 + - R |----- |----- theta(eta)||
3 \ deta \ deta //

/ / d \ / d \ \
+ Pr |f(eta) |----- theta(eta)| - |----- f(eta)| theta(eta)| = 0
\ \ deta / \ deta / /
> bcs1 := f(0) = S, (D(f))(0) = 1+L*G, (D(D(f)))(0) = .1, f(6) = 0;
f(0) = S, D(f)(0) = 1 + L G, @@(D, 2)(f)(0) = 0.1, f(6) = 0
> fixedparameter := [S = .1, M = .1];
[S = 0.1, M = 0.1]
> Eq3 := eval(Eq1, fixedparameter);
/ d / d / d \\\ / d / d \\
|----- |----- |----- f(eta)||| + f(eta) |----- |----- f(eta)||
\ deta \ deta \ deta /// \ deta \ deta //

2
/ d \ / d \
- 2 |----- f(eta)| - 0.01 |----- f(eta)| = 0
\ deta / \ deta /
> fixedparameter := [R = .1, Pr = .7];
[R = 0.1, Pr = 0.7]
> Eq4 := eval(Eq2, fixedparameter);
/ d / d \\ / d \
1 + 0.1333333333 |----- |----- theta(eta)|| + 0.7 f(eta) |----- theta(eta)|
\ deta \ deta // \ deta /

/ d \
- 0.7 |----- f(eta)| theta(eta) = 0
\ deta /
> bcs2 := theta(0) = 1+T*B, (D(theta))(6) = B, theta(6) = 0;
theta(0) = 1 + T B, D(theta)(6) = B, theta(6) = 0

> T := .1; B := .1;
0.1
0.1
> L := [0., .1, .2, .3];
[0., 0.1, 0.2, 0.3]
> for k to 4 do R := dsolve(eval({Eq3, Eq4, bcs1, bcs2}, L = L[k]), [f(eta), theta(eta)], numeric, output = listprocedure); Y || k := rhs(R[2]); YL || k := rhs(R[3]) end do;
Error, (in dsolve/numeric/bvp/convertsys) too many boundary conditions: expected 6, got 7
> plot([YL || (1 .. 4)], 0 .. 6, 1 .. -.2, labels = [eta, diff(f(eta), eta)]);

 

Dear all;

I need your help to get all the solution of this nonlinear  system  with four parameters: r1, r2, q1, q2  assumed to be positives. Let the system:

the first equation is: r1*x*(1-x/q1)=x*y/(1+x)

the second equation: r2*y*(exp(-y)-q2)=-x*y/(1+x)

How can get the positive solution ( x, y) of the previous system.

Thank you for your help.

Dear Exppert,

I used the following command to plot the volume of revolutionin Maple13, but with the message "unable to invert function w.r.t. the vertical axis."

with(Student[Calculus1]):

VolumeOfRevolution(sqrt(1-(x-4)^2), -sqrt(1-(x-4)^2), x=3..5, axis=vertical, scaling=constrained, output=plot).

Meanwhile, this command can plot each function individually, which is a semi-torus.

Regards

Yegan

Hi

I'm trying make Maple write the actual result, when i differenting an expression: x[s] := x(t)+sin(theta(t))*a.
when i differentiate with respect to t, i get:

> diff(x[s], t);
=
print(`output redirected...`); # input placeholder
/ d \ / d \
|--- ()(t)| + cos(theta(t)) |--- theta(t)| a
\ dt / \ dt /

Maple, writes the expression as a table, but i need to see the normal function? Why does it do that? And how can i make it show the expression as a normal function?


When i derive the two parts serperately i get the normal result, but as soon as i add them together, i get the table rasult again?

Is there an easy trick for this one?

-Nicolai

 

 

Hello.
I am trying to extract the terms that are a product of a commutative part and an operator part from the input expression. That is I am trying to extract a terms like a*A.B where A and B are quantum pperators.

I am trying to do it by creating corresponding structured type:

restart; 
with(Physics);
Physics[Setup](op = {A, B}, quiet);

`type/ProdComOp` := `&*`(commutative, specfunc(anything, Physics:-`*`));
z0 := u*A.B-A+k*B+B.A.B+g;
z1 := z0+v*A.B.A;
S1 := indets(z1, ProdComOp);

and all it is Ok. The result is 
But if

z2 := z0-v*A.B.A; 
S2 := indets(z2, ProdComOp);

then
however I expected to receive the same as S1.

How to handle the sign of the commutative part? Thank you.

Hi,

 

  I would like to readdata from a file 

              -6
2 0.38 10 + 0. I

 

  I use

 

f:=readdata(`d:\\test.dat`,2);
for i from 1 to 20 do
print(i,f[i]);
end do:

 

  The problem is, seems maple get -6, instead of 10^-6, since the .txt file puts -6 in a row. 

 

My question is, how to get the right data 0.38*10^-6 correctly?

 

P.S. I used cmaple  inputfile >  outputfile.txt to get the .txt file. Should I use writedata?

 

 

Hi,

 

  I have a file "d:\\test.txt", the content is 

 

       1, 2.0000 + 0. I

 

then I use

f:=readdata(`d:\\test.txt`,2);
for i from 1 to 1 do
print(i,f[i]);
end do:

 

it gives me

***

[[1.]]
1, [1.]

 ***

 

If I remove the comma in the file, I could obtain 2. I do not want to do it manually that remove all commas by hand. Is there any way to skip the commas in readdata?

Consider the function

 

 

The above definition may result in four cases depening on r and x.

Can Maple calculate automatically all possible cases and the corresponding Maxima, Minima and Values at intervals limits?

 

I'm working on my master thesis and trying to solve this equation on maple, after I developed my equation and solving it for N=2,3 and then trying to solve it for N=4 and 5 it took so much long time(more than two days without get any answer), so i'm asking you now to help me reducing the time for solving this complicated equation. 

Shklovskii_N_spheres_with_tails.mw

a := .4; lB := .714; R := 3.2; Z := 24; L := 88; `ℓ` := 2*Z/eta; eta := 1; b := .7; N := 4; Lx = (-N*l+L)/N; r = Lx+2*R

.4

 

.714

 

3.2

 

24

 

88

 

48

 

1

 

.7

 

3

 

Lx = 88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*R+(N-1)*((L-l)/(N-1)))*ln(2*N*R+(N-1)*((L-l)/(N-1)))

6.238324626*l-3*l*ln(.3125000000*l)+.4687500000*(l-48)^2+2*(88-l)*ln(110.0000000-1.250000000*l)+2.*(l-48.)^2/(6.400000000+l)+(l-48.)^2/(56.80000000+1.500000000*l)+6.*(l-48.)*ln(14.75000000-.1562500000*l)+4.*(l-48.)*ln((97.60000000-1.*l)/(53.60000000-.5000000000*l))+2.*(l-48.)*ln((148.-1.500000000*l)/(104.-1.*l))+3.*(94.40000000-1.*l)*ln(94.40000000-1.*l)-6.*(37.60000000-.5000000000*l)*ln(37.60000000-.5000000000*l)+35.64092141+2.*(144.8000000-1.500000000*l)*ln(144.8000000-1.500000000*l)-4.*(75.20000000-1.*l)*ln(75.20000000-1.*l)+2.*(56.80000000-.5000000000*l)*ln(56.80000000-.5000000000*l)+(195.2-2*l)*ln(195.2-2*l)-2*(151.2-(3/2)*l)*ln(151.2-(3/2)*l)+(107.2-l)*ln(107.2-l)

(2)

s := diff(F, l)

.9375000000*l-3*ln(.3125000000*l)+4.*(l-48.)/(6.400000000+l)-2.*(l-48.)^2/(6.400000000+l)^2-41.76167537-2*ln(110.0000000-1.250000000*l)-2.500000000*(88-l)/(110.0000000-1.250000000*l)-1.500000000*(l-48.)^2/(56.80000000+1.500000000*l)^2-.9375000000*(l-48.)/(14.75000000-.1562500000*l)-3.000000000*ln(144.8000000-1.500000000*l)+4.*ln(75.20000000-1.*l)-1.000000000*ln(56.80000000-.5000000000*l)+2*(l-48.)/(56.80000000+1.500000000*l)+2.*(l-48.)*(-1.500000000/(104.-1.*l)+1.*(148.-1.500000000*l)/(104.-1.*l)^2)*(104.-1.*l)/(148.-1.500000000*l)+6.*ln(14.75000000-.1562500000*l)+4.*ln((97.60000000-1.*l)/(53.60000000-.5000000000*l))+2.*ln((148.-1.500000000*l)/(104.-1.*l))+4.*(l-48.)*(-1./(53.60000000-.5000000000*l)+.5000000000*(97.60000000-1.*l)/(53.60000000-.5000000000*l)^2)*(53.60000000-.5000000000*l)/(97.60000000-1.*l)-3.*ln(94.40000000-1.*l)+3.000000000*ln(37.60000000-.5000000000*l)-2*ln(195.2-2*l)+3*ln(151.2-(3/2)*l)-ln(107.2-l)

(3)

solve(s, l)

104.4945628

(4)

NULL



Download Shklovskii_N_spheres_with_tails.mwShklovskii_N_spheres_with_tails.mw

 

I have two lists with differential monomials, like this: [y'y'', y''', (y'')^2].

List is rather big, i want to check if one such a list contains in other.

Seems to be that there is some internal procedure for this operation.

But I don't know what it is...

I have an ode in the form:

 

diff(u(x),x)-f(x)=u(x)^3+B(X)*u(x)+g(x)

how to extaract and name the different coefficients of the equation?

 

Thanks 

Hamada

Having a little trouble getting data from openstreetmap from export here

http://www.openstreetmap.org/export#map=17/43.4763/-80.5459

 

Dear friends:

If

n:=197

then

d:=convert(n,base,10) --> returns [7,9,1]

Is there a simple way for getting back n from d, i.e., 197 from [7,9,1] , not using a for loop?

Thanks and best regards

César Lozaada

 

 

 

 

 

 

 

 

 

Nm= p1. p2 ...pm + 1, for m more than or equals 1.

 

So N1 = p1 + 1 = 2 + 1 = 3, N2 = p1 p2 + 1 = 2  3 + 1 = 7, etc.

 

We prove that Nm is not divisible by any of p1, p2, . . . , pm, so that Nm is either a prime or it is divisible by a prime larger than pm.

 

(c) Use Maple to find out which of these numbers Nm, for m = 1, 2, . . . , 15, is actually prime.

 

Use Maple to compare pm with the smallest prime number that divides Nm, for m =1, 2, . . . , 15.

 

First 1347 1348 1349 1350 1351 1352 1353 Last Page 1349 of 2429