MaplePrimes Questions

I prefer to write packge:-command(....) so I can see which package the command is from.

But sometimes I am forced to load  a package. Here is an example. IntegrationTools contains some useful types

At load time the IntegrationTools package defines three new types: Integral, DefiniteIntegral and IndefiniteIntegral, which can be used to access integrals involved in any given expression.

I thought I can access these just like the commands in the package, using ":-" notation, but this does not work

------------------
restart;
v := Int(sin(x), x);
type(v,IntegrationTools:-IndefiniteIntegral);
---------------------

 

Error, IndefiniteIntegral is not a command in the IntegrationTools package

But this works

-----------------------
restart;
with(IntegrationTools);
v := Int(sin(x), x);
type(v,IndefiniteIntegral);
----------------

It looks like :- only works to access functions/commands/procs in a package. and not to access types such as in this example.

Is there some other notation to use to reference types in package without having to load the whole package?

    

according to help on Combine

The Combine command combines integrals using linearity. The parameter v is any expression involving definite or indefinite integrals.

So, why I get an error from the following?

restart;
expr:=Int(sin(x),x) + Int(cos(x),x);

IntegrationTools:-Combine(expr);

Error, (in IntegrationTools:-Combine) invalid subscript selector

interface(version);
 Standard Worksheet Interface, Maple 18.02, Windows 7, October  20 2014

 

 

 

 

 

How can we plot theta=pi/6 in polar coordinates by maple13?

>restart:
>with(LinearAlgebra):
>with(Student[NumericalAnalysis]):
s := {E[1], E[2], E[3]};
v := {x[1], x[2], x[3]};
A := GenerateMatrix(s, v);
B := augment(A)
Then what i do that for any matric i can use same program.

I tried

nops({x, y, z,1+x, 2+y, -3+z,-2+x, 3+y, -1+z });

and Maple out 9.

If x = 1, y = 2, z = 3, we have

nops({1, 2, 3, 2, 4, 0, -1, 5, 2});

equal to 7.

Edit.

I edited my question. The word "list" into "set".

My question means, there is a triple (x, y, z) = (1, 2, 3) so that the number of element of the set {x, y, z,1+x, 2+y, -3+z,-2+x, 3+y, -1+z } is 7, not 9. Why we can confirm the number of elements of the set {x, y, z, 1+x, 2+y, -3+z,-2+x, 3+y, -1+z } is 9? And, how must select the integer numbers x, y, z (0 < x <10, 0< y <10, 0< z < 10) so that the number of elements of the set {x, y, z, 1+x, 2+y, -3+z,-2+x, 3+y, -1+z } is 9?

I tried

restart:

ListTools[Categorize]:

L:=[]:

for x from -2 to 5  do

for y from -2 to 5  do

for z from -2 to 5  do

a:=[x,y,z]:

b:=[1+x,2+y,-3+z]:

c:=[-2+x,3+y,-1+z]:

if op(1,a)*op(2,a)*op(3,a)*op(1,b)*op(2,b)*op(3,b)*op(1,c)*op(2,c)*op(3,c)<> 0

and op(1,a)<>op(2,a) and  op(1,a)<>op(3,a) and  op(1,a)<>op(2,b) and  op(1,a)<>op(3,b) and  op(1,a)<>op(2,c) and  op(1,a)<>op(3,c) and op(2,a)<>op(3,a) and op(2,a)<>op(1,b) and

op(2,a)<>op(3,b) and

op(2,a)<>op(1,c) and

op(2,a)<>op(3,c) and

op(3,a)<>op(1,b) and

op(3,a)<>op(2,b) and 

op(3,a)<>op(1,c) and

op(3,a)<>op(2,c) and

op(1,b)<>op(2,b) and

op(1,b)<>op(3,b) and

op(1,b)<>op(2,c) and

op(1,b)<>op(3,c) and

op(2,b)<>op(3,b) and

op(2,b)<>op(1,c) and

op(2,b)<>op(3,c) and

op(3,b)<>op(1,c) and

op(3,b)<>op(2,c) and

op(1,c)<>op(2,c) and

op(1,c)<>op(3,c) and op(2,c)<>op(3,c) then L:=[op(L), {a,b,c}] fi; od: od: od:

nops(L); 

L;

 

 

 

 

with(Tolerances):

a := `&+-`(2, .5);

b := `&+-`(30, 10);

evalf(a*b);

with(ScientificErrorAnalysis):

a1 := Quantity(2, .5);

b1 := Quantity(30, 10);

combine(a1*b1, errors);

Dear everyone, 

       I want to deal with experimental data with error. I find two ways to do the job. But  the results are different .Could you tell me which one is more correct?

      Thank you.

Barry.


Hi there,

I would like to use Maple to solve a couple of integrals.

My attempt seems to have some errors, since even if the integral expressions are rendered correctly, they are  not being solved. They shouldn't need numeric methods to be solved.

The integrals are the following:
G1 := int(e^((lambda-k)*s-e^(-k*s)), s = -infinity..t);
G := int(e^(-(lambda+k)*t-e^(-k*t))*G1, t = -infinity..infinity);

Thus:

and

 


And attached is the unsuccessful attempt: MaplePrimes_Lea-Catcheside.mw

Thanks,
jon


Hi there,
I have a set of differential equations whose solution, Jacobian matrix and its eigenvalues, direction field, phase portrait and nullclines, need to be computed.

Each of the equations has a varying parameter.

I know how to get the above for a single parameter value, but when I set a range of values for the parameters, Maple is not able to handle all cases as I would expect: solving the differential equation system:

eq1 := x*(1.6*(1-(1/100)*x)-phi*y)
eq2 := (x/(15+x)-0.3e-1*x-.4)*y+.6+theta
desys := [eq1, eq2];
vars := [x, y];
steadyStates := map2(eval, vars, [solve(desys)])

already yields an error:
Error, (in unknown) invalid input: Utilities:-SetEquations expects its 2nd argument, equations, to be of type set({boolean, algebraic, relation}), but received {-600*y+(Array(1..2, {(1) = 8400, (2) = 15900})), Array(1..5, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0})}


The equations are the following:
de1 := diff(x(t), t) = x(t)*(1.6*(1-(1/100)*x(t))-phi*y(t));
de2 := diff(y(t), t) = (x(t)/(15+x(t))-0.3e-1*x(t)-.4)*y(t)+.6+theta

the parameters being:
phi:=[0 0.5 1 1.5 2]
theta:=[5. 10.]

How can I handle the situation so that Maple computes each of the above for each combination of the parameters?

I would like to avoid using two for loops and having to store all results in increasingly bigger and complicated arrays.

The worksheet at issue is this: MaplePrimes_Tumour_model_phi_theta_variation.mw


Thanks,
jon

Hi there,
I am wondering how to print parentheses in the legend of an odeplot.

The following command

odeplot(numsolnf, [[t, CECnf(t)], [t, VECnf(t)], [t, CICnf(t)], [t, VICnf(t)]], 0..50, opts, legend = ['Extracelular urea concentration (mg/dL)', 'Extracelular urea volume (L)', 'Intracelular urea concentration (mg/dL)', 'Intracelular urea volume (L)'])

where numsolnf is the numerical solution of the equation system composed by CECnf(t), VECnf(t), CICnf(t), and
VICnf(t) produces no parentheses.

And the "Extracelular urea concentration (mg/dL)" and "Intracelular urea concentration (mg/dL)" are displayed as if the whole text was a quotient:


Extracelular urea concentration mg
dL

Any ideas about how to solve these issues?

Thanks,
jon

Hi there,

this may be a common task but did not find any helpful hint nor an answer: is there any way to combine to arrays A and B into another one element-wise, i.e.:
C = [[A[1],B[1]], [A[2],B[2]],...,[A[N],B[N]]]
without doing a for loop?


Thanks,
jon

Recently, in one of the old book on programming came across the following problem: to place on the chessboard 5 queens so that each free field was attacked by at least one queen. This problem is called the problem of the dominant queens. I have not seen the implementation of this task in Maple. Naturally to solve this problem for an arbitrary board N by N. I have 2 variants to solve the problem, but I am not going to to present them yet, so that everyone can enjoy the independent decision. Especially the interesting case is the case of the board 6 by 6, when the solution is unique (certainly up to symmetry).

Of course, it is interesting for each board  N by N to find the minimum number of queens that satisfy the above condition. It seems that for arbitrary board  N by N the exact value of this number is not known. I do not know any other way of solving the problem as a brute force method.

Hye,

Have a good day Sir.

can u help me how to solve my problem using the Implicit Crank Nicolson Finite different Method. I have attached the problem and what I have done in Word file. I have to modify my Equations in order to get the graphs (that is wrong actually). Can you help how to get the graphs by not change the sign of my equations?:( 

 

Thank you in advance.

God Bless you.

 

 

1. if parametric equations are
x0 = a^4, x1=a^3*b, x2=a^2*b^2, x3=a*b^3, x4=b^4

how to find ideal below

e12 = x0*x2-x1^2
e13 = x0*x3-x1*x2
e14 = x0*x4-x1*x3
e23 = x1*x3-x2^2
e24 = x1*x4-x2*x3
e34 = x2*x4-x3^2

2.
if let y_i = x_i/x0 for i = 1..4
how to find above parametrically by below equations
y1 = b
y2 = b^2
y3 = b^3
y4 = b^4

Dear any body,

I have tried several models/documents (with diagrams) using maplesim v7 32/64bit, but the simulation can not finish and in  equation generation a message appear as follow "protype must be a sructured record type or a record, but receipt squeezed".Same mesaages also appear if I try all examples exist in maplesim. What a big problem this?

Please help me..thanks in advance

I am trying to learn the <> notation to enter matrices and vectors. But I find this page very confusing

http://www.maplesoft.com/support/help/maple/view.aspx?path=examples%2FLA_Syntax_Shortcuts

it says:

but we see clearly the vertical bars are used to separate columns.

Isn't a column the thing that goes from the top to bottom and not from left to right in Maple LinearAlgebra?

 

First 1331 1332 1333 1334 1335 1336 1337 Last Page 1333 of 2429