MaplePrimes Questions

Hi all, I want to ask how to use for loop reverse in Maple.

Example, i have array . In Java then

for(int i = arr.size(); i > 0; i--) {

    //do something

}

What is simillar for loop in Maple?

Thank you very much.

Hi, when I wan to generate results, it shows this; What should I do?

Error, (in solve) a constant is invalid as a variable, I. 

I have a system of equations that can't be solved analytically, but can be solved using fsolve. I would like to plot the solution for one of the unknowns as a function of a parameter "DV" that is in a few of the equations. There are two issues at hand. First, even if I give DV a numerical value, the solutions are of the form { x = 0.23, y = 4.56 }, a form that plot( ) obviously can't handle directly. Generally I have dealt with this by using the op( ) command to pick out the solution I want; is there a better way?

But even after I have the solution I want, fsolve( ) won't work until I give it a value for DV. Thus a plot( ) command like

   plot(op(2, op(2, fsolve({e1, e2}, {x, y})), DV = -1 .. 1)

fails with an "Error, (in fsolve) DV is in the equation, and is not solved for" error.

There's got to be an esy way to do this!

Here Maple treats the intervals as independent, as I think it should:

INTERVAL(1 .. 2)+INTERVAL(1 .. 2);
              INTERVAL(1 .. 2) + INTERVAL(1 .. 2)

INTERVAL(1 .. 2)-INTERVAL(1 .. 2);
              INTERVAL(1 .. 2) - INTERVAL(1 .. 2)

(even though for the first one an autosimplification to 2*INTERVAL(1..2) wouldn't matter). But as soon as there are non-linear terms, Maple ignores that rule:

INTERVAL(1 .. 2)^2-INTERVAL(1 .. 2)^2;
                               0

INTERVAL(1 .. 2)/INTERVAL(1 .. 2);
                               1

INTERVAL(-1 .. 1)*INTERVAL(-1 .. 1);
                                        2
                       INTERVAL(-1 .. 1) 

That means I cannot substitute intervals for variables in a formula. In fact, I don't know how INTERVAL(-1 .. 1)*INTERVAL(-1 .. 1) can be computed as a product of two independent intervals at all, there doesn't seem to be any way to pass it to evalr.

 

Hello,

This is a problem encountered in most engineering equations. An equation is given with some variables very small that they can be ignored. Basically the mathematical equivalent of an engineering approximation.

 

Below is a very simple example:

 

Both R and r are between 10E3 and 50E3. 
gm is between 1 and 10.

So regardless of actual values the answer to 4significant figures can always be approximated by:

eqn1~ R*gm*r

 

Is there any way to tell MAPLE to approximate an equation such that it is only accurate to certain decimal places? I have tried using "fnormal()" with "assuming"  statements but it always requires some of the variables be assigned actual numeric values.

I was wondering if there was a way to get this approximation without having to assign values to any of the variables but only by specifying the range of values for each variable.

 

Thanks.

 

 

 

How can ı write 3d^2+f^2-4e^2+2td^2-4te^2+2tf^2+3f^2+4td^2+....... as  (.......)d^2 +(......)e^2+ (.......)f^2 

so

3d^2+f^2-4e^2+2td^2-4te^2+2tf^2+3f^2+4td^2+....... = (.......)d^2 +(......)e^2+ (.......)f^2  ??????

 


 

hi

i have an Integral equation like below

now i want to use Parts That u=op(1,A), but when I use Parts it dont work properly, actually i want to get

but when i use 

A := Expand(Parts(Int(A, x), op(1, A)))

maple solve it like bellow 

i know that i can separate these terms One by one, but there are many functions like this in my code , so i want to know if there is any way to solve this function.

thank you.

Hi!
I am quite new to maple. 
I have uploaded two printscreens of two similar procedures. The only difference is that in prosedure nr. 2 the number "a"(rate of change given in the exercise), is supposed to variate in term of k.

I assume that i have to define an if-sentence that will tell the procedure to use a=0.15 when, n=0, and a1:=a(1-(k/Km)) when n>0.  Can someone please help me with solving this? 

Regards Paul

 

 

I am now working on differential equations like the following, and wonder how I can deal with diff(C(x,t),x).  In particular, I would like to know the values of diff(C(x,t),x) at specific sets of (x, t).  I also would like to know how to integrate diff(C(x,t),x) for a time period (at x = 0.5L or x = L).

 

restart;

C0 := 10;

K  := 3.0e6;

d  := 5.0E-14;

hm := 5.0E-4;

L  := 0.001;

 

DE1 := diff(C(x, t), t) = d*diff(C(x,t), x, x);

IC := C(x, 0) = piecewise(x < 0, 0, 0 <=x <= L, C0, L < x, 0);

BC1 := D[1](C)(0, t) = 0;

BC2 := -d*D[1](C)(L, t) = hm * C(L, t) / K;

 

pds:=pdsolve(DE1, {IC, BC1, BC2}, type=numeric, spacestep=L/10000, timestep=10000);

 

T := 60*60*24*100;

pds:-plot(t=T, x=0..L);

 

#I tried the following, but these seem to always return zero (while the plot suggests some negative value of diff(C(x, t), x));

v1 := pds:-value(diff(C(x, t), x));

v1(L, T);

v2 := pds:-value(int(diff(C(x, t), x), t = 0 .. T));

v2(L, 0);

Hello all,

I really don't know what is going on with my code but I think I can use some help. I'm new to Maple and to parallel programmimg. What I would to understand is why the following code is simply not working.

 

evList := seq(seq([i,j],j=i..6),i=1..6):
M := Matrix(6,shape=symmetric):
integMult := proc(kIni::integer, kFin::integer)
  local i, j, k, l, kk;
  global evList, M;
  for kk from kIni to kFin do
     i := evList[kk][1]:
     j := evList[kk][2]:
     M[i,j] := Matrix(3*n,(k,l)->evalf(int(expand(N[i][k]*N[j][l]),x[1]=0..a,x[2]=0..b)));
  od:
end proc:
Start(null, Task=[integMult,1,10],Task=[integMult,11,21]);

When I consider one single Thread (i.e. 1 to 21), it works like a charm. But the code written above gives me a kernel lost. I don't know if it is the shared variable "M" (matrices of matrices) or if it is the shared parameter (vector of vectors) , or both. But I've tested duplicating both and nothing different happens.

Can anyone help me?

hi 

i have an equation like thes:

i want to classify Coefficients of F & H like this:

anybody can help me to how i do it?

thank you.

I can solve three equations for x like this

restart:
x := y/p:
z := x*a+y*(1-b):
x := 100*z/(p*r+r);

                            /y a            \
                        100 |--- + y (1 - b)|
                            \ p             /
                   x := ---------------------
                              p r + r      

However, I dont like the fact that x is a function of y. I just want x to be a function of a, b, p and r. So I try to expreses the equations as follows:

restart;
y := p*x;
x := 100*z/(p*r+r);
z := x*a+y*(1-b);
solve(z, x);

Error, recursive assignment
Warning, solving for expressions other than names or functions is not recommended.

Any idea how I can get an equation for x that only depend on a, b, p and r? 
 

Hi there,

I was asked to compute the inverse laplace transform of 
1/s^2 + (e^s - 2)/(s*(e^s-1))

I've tried to evaluate it using online calculators like wolframalpha.However,none of them was able to give an answer.

So,this is what I've got from Maple:

 

I was wondering if it is correct.The graph doesn't look too bad but I've no idea what 1+frac(t) means.Some help would be greatly appreciated,thanks!

p.s.I've loaded the with(inttrans) package

This fails (the code computes the quotient group directly from the definition):

with(GroupTheory):

Qgr := (sgr, gr) -> CustomGroup(LeftCosets(sgr, gr),
  `.` = ((a, b) -> LeftCoset(Representative(a) . Representative(b), sgr)),
  `/` = ((a) -> LeftCoset(Representative(a)^(-1), sgr)),
  `=` = ((a, b) -> Elements(a) = Elements(b)));

gr := QuaternionGroup();
Generators(gr);
                [(1, 2, 3, 4)(5, 6, 8, 7), (1, 5, 3, 8)(2, 7, 4, 6)]

qgr := Qgr(Subgroup({Generators(gr)[1]^2}, gr), gr);
                  qgr := ` < a custom group with 4 generators > `

AreIsomorphic(qgr, DirectProduct(CyclicGroup(2), CyclicGroup(2)));
Error, (in =) invalid keyword expression

If I rename the parameters in the definition of Qgr, e.g., change the last line to

`=` = ((aa, bb) -> Elements(aa) = Elements(bb))

then everything works, AreIsomorphic gives true.

 


 

restart

mu:=0.0025

0.25e-2

(1)

A:=1*10^(-20); Aprim:=4.46*10^(-20);

1/100000000000000000000

 

0.4460000000e-19

(2)

eta:=1.003*10^(-3)

0.1003000000e-2

(3)

V:=2*10^(-9)

1/500000000

(4)

ode:=mu*h(x)*diff(h(x),x,x)+mu*A/(6*pi*h(x)^2)-eta*V

0.25e-2*h(x)*(diff(diff(h(x), x), x))+0.4166666667e-23/(pi*h(x)^2)-0.2006000000e-11

(5)

ode1:=mu*h(x)^3*diff(h(x),x,x)-eta*V*h(x)^2+mu*A/(6*pi)=0

0.25e-2*h(x)^3*(diff(diff(h(x), x), x))-0.2006000000e-11*h(x)^2+0.4166666667e-23/pi = 0

(6)

ic1:=h(0)=3/1000000000, D(h)(-0.20e-4)=0,h(-0.20e-4)=1e-9

h(0) = 3/1000000000, (D(h))(-0.20e-4) = 0, h(-0.20e-4) = 0.1e-8

(7)

dsol1 := dsolve({ic1, ode}, numeric)

Error, (in dsolve/numeric/bvp) system is singular at left endpoint, use midpoint method instead

 

``


 

Download velocity_tehta1.mwvelocity_tehta1.mw

First 804 805 806 807 808 809 810 Last Page 806 of 2308