MaplePrimes Questions

Explorer_Assistan.mw

I tried the video example of the Explorer Assistant, and get jumbled output.  See the *.mw file.

Ratch

 

Hi,

I have a 4-D function that I have found an analytic expression for in Maple, but I want to generate a numerical 4-D array, which I can export for use in Matlab. However, I don't think I'm using a very good solution, because it is extremely slow (several minutes for even 10x10x10x10 elements). My code is

NumRange:=10:
NumElements:=10:
dx:=2*NumRange/(NumElements-1):
A:=Array(1..NumElements,1..NumElements,1..NumElements,1..NumElements,[seq([seq([seq([seq(evalf(rho(ws1,ws2,ws1p,ws2p)),ws2p=-NumRange..NumRange,dx)],ws1p=-NumRange..NumRange,dx)],ws2=-NumRange..NumRange,dx)] , ws1=-NumRange..NumRange,dx)],datatype=float);

Rho is an exponential with 10 terms in the exponents.

I also tried using four for-loops but that was even slower!

Thanks for any input

How can I write a general procedure which will take an integer n and create n nested loops:

add(...(add(f(x_1,...,x_n),i_1=0..k_1),...),i_n=0..k_n);

Thank you in advance.

I wanted to define a 4th order tensor in the following way,

    restart;
    with(Physics);
    Setup(mathematicalnotation = true);
    delta := KroneckerDelta;
    L[i, j, k, l] := lambda*delta[i, j]*delta[k, l]+mu*(delta[i, k]*delta[j, l]+delta[i, l]*delta[j, k]);

but when I type L[1, 1, 1, 1] it doesn't replace i, j, j and l by 1. i
do i need to define it in a different way?

Is it possible to find all the solutions of the equation

abs(tan(x)*tan(2*x)*tan(3*x))+abs(tan(x)+tan(2*x)) = tan(3*x)

which belong to the interval 0..Pi with Maple?

 

 

I really do not want to click on hundreds of pages here http://www.maplesoft.com/products/maple/new_features/index.aspx in order to figure what new functions  there are in Maple 18. Even when clicking on these pages and following the links, it is hard to collect and enumerate what the new functions are and one gets lost in the processes. It seems all marketing material.

Any one knows a page that lists these new functions all in one place? It will be nice if there is a list of new functions/packages and list of modified functions in Maple 18.

Trying to find what new functions or modified functions in Maple is not easy.

 

Hello,

 

I don't seem to be able to create an array of plot with two rows, where the first one is a sigle animation and the second rwo is two animations in the same plot. For example I would the first row of the array to display

H := animate(plot3d, [x-k*y+1, x=-10..10, y=-10..10], k=-10..0, frames=4):

display([H]);

end the second row to display

P := animate(plot, [sin(x+t), x=-Pi..Pi], t=-Pi..Pi, frames=8):
Q := animate(plot, [cos(x+t), x=-Pi..Pi], t=-Pi..Pi, frames=8):


display([P, Q]);


Any ideas?

I'd like to bind a symbol to some expression, but display the expression analytically before evaluating, and show the value on the same line (not new line).

Something like:

restart;
a:=10: b:=3:
f:='a+b^2';`=`,f;

But this display the expression and its numerical value on 2 lines. I'd like to get this output:

      f:=a+b^2 ,`=`,19  

This is just so I can see the expression before it is evaluated, and its numerical value on same line. Or if there is a better way do this. I tried using print, but could not get the assignment to work then.

 

Hi, the title isn't great as I didn't know how to describe this really. I need to solve the following equation for b:

y = (1-exp(-x*b))/(1-exp(-50*b))

When I put a value for y in, this is fine and fsolve gives me a numeric real solution. However, even when using RealDomain, it does not give me a real solution if I leave y as it is, and instead gives a 'RootOf' solution, which I don't really understand. This is the same whether using solve or isolate:

b=-(1/50)RootOf(_Zx-50ln(-y+ye^(_Z)+1))

I have the values of x and y for multiple data points and can put them in an nx1 matrix. Is there a way to replace x and y with matrices (with real numbers in) and solve for each set of points for b (ie there would be n values of b)? Obviously I could go through and put in each value of x and y but this would take ages, so was just wondering if there's a quick way to do this.

I have tried by simply putting matrices instead of the letter but get the error:

Error, invalid input: exp expects its 1st argument, x, to be of type algebraic, but received Vector(50, {(1) = -50*b, (2) = -49*b,...

Thanks for your time

James

Hi, 

 

I wish to be able to calculate the roots of the function f(p) by using the roots of the function h(p) and applying the bisection method due to the fact that the roots of h(p) bracket the roots of f(p) as can be seen in the graph below. I have done this before for another example when h:=J0(p); and hence i could use The commands BesselJZeros(0,n)/BesselJZzeros(0,n+1) to find the roots. So my problem arises with the finding the roots of h(p) and how to insert them into my bisection loop(underlined below).

Any advice would amazing. Many thanks


restart;

Digits := 30:
with (plots):
with(RootFinding):

#Define given parameters

R:=1: #external radius of particles, cm

d:=10^(-3): #diffusivity cm^2 per second

alpha:= 1: #fractional void volume

c0:=10^(-6): #concentartion of soltion in void volume of solid initially, moles per liter

C0:=0: #concentration of main body of solution initially, moles per liter

k1:=0.5: #constant in adsorption isotherm (ka)

k2:=0.75: #constant in adsorption isotherm (kd)

k:=2.5: #equilbrium constant for adsorption kinetics

n0:=(k1/k2)*c0:#initial amount absrobed on solid, moles per liter

V:=0.1: #volume of external solution, liters

W:=0.1: #weight of absorbant, grams

rho:=2.0: #solid aparrant density, g/cc

delta:=(1/d)*((p+alpha*k2+k1)/(p+alpha*k2));

beta:=W*alpha*d/(rho*V);

   

1000*(p+1.25)/(p+.75)

 

0.500000000000000000000000000000e-3

 

 

 

 

 


f:=p->(BesselJ(0,R*sqrt(-delta*p))*k*p-(R*sqrt(-delta*p))*BesselJ(1,R*sqrt(-delta*p))*(d*p/R + 2*beta*k/(R^2)));

proc (p) options operator, arrow; BesselJ(0, R*sqrt(-delta*p))*k*p-R*sqrt(-delta*p)*BesselJ(1, R*sqrt(-delta*p))*(d*p/R+2*beta*k/R^2) end proc

(2)

h:=p->(BesselJ(0,R*sqrt(-delta*p)));
plot([f(p),h(p)],p=-0.3..0,axis=-5..5,legend=["f(p)","h(p)"]);


 




proc (p) options operator, arrow; BesselJ(0, R*sqrt(-delta*p)) end proc

 

 

 

(3)



points:=5:
rts:= Array(1..points):
for n from 1 by +1 to points do
pl:=evalf(#**first root of h**);
pu:=evalf(#**second root of h, i.e n+1 root**);
pe:= (pl+pu)/2;
while abs(f(pe))>10^(-6) do
pe:=(pu+pl)/2;
if f(pu)*f(pe) <0 then
pl:=pe;
elif f(pl)*f(pe)<0 then
pu:=pe;
end if;
od;
rts[n]:=pe;

od;
rts[n]:=p[n];

 

 

Download spherical_continue.mw


 

Download spherical_continue.mw

Hi,

 

I am trying to plot union of regions in Maple 15. Each region is formed by a set of inequalities. I can see from online such a feature is available in Maple 17.

The code is:

> with(plots);

> I1 := inequal({x < 1, y < 1}, x = 0 .. 2, y = 0 .. 2, optionsfeasible = [color = "Brown", thickness = 2]);

> I2 := inequal({y > 1, x < 1}, x = 0 .. 2, y = 0 .. 2, optionsfeasible = [color = "Yellow", thickness = 2]);

> display(I1);      ---> This is working 

>display(I2);      ---> This is also working

>display({I1,I2});  ---> Not working.

The above is also attached in the worksheet.

Is there any other way to plot the two region. I am new to Maple. Please suggest me the alternative in Maple 15.

 

Thanks!

 

Hello there,

i got a question regarding derivatives in Matlab.

 

I got a function for a example:

f:=f1(y)*f2(x)

 

from this function i need the partial derivatives with respect to x and y, i can easily get them with

diff(f,x)

diff(f,y)

 

now i want to compute the derivative of f with respect to time t, assuming that y and x both depend on t - how can i tell maple that y and x depend on t?

 

thanks

ben

I want to find the solution in a special form.
How can I do it?
Here is what I tried:

(Maple)

(Maple)


In the left hand side u_1 is not changed in  D(u_1).
I want to substitute and evalute (differentiate) it.

Thanks,  Sandor

 

 

 

 

Dear All;

Happy, to discuss with you these lines, and thank you to help me.

My goal is:

 

ode := D(y)(x) = f(x,y(x));
                          
In this expression, is assumed to be a known function of the independant variable
                                      x
 and the function that we are trying to solve for
                                    y(x)
.  The simplest numerical stencils to solve this equation will give us an approximation to
                                      y
 at some point
                                  x = X + h
 given some knowledge of
                                      y
 at
                                    x = X
.  All of these stencils are based on the Taylor series approximation for
                                    y(x)
 about
                                    x = X
 to linear order:
eq1 := y(x) = series(y(x),x=X,3);
                       
eq2 := h = x - X;
eq3 := subs(isolate(eq2,x),eq1);
                                
Now, we can remove the first derivative of y
                                     
 by making use of the differential equation:
eq4 := subs(x=X,ode);
eq5 := subs(eq4,eq3);
                           

Now we must compute the same for y(x-h)  and then make.  How can I do this please

assume input 0.567

how to get a list [5, 6, 7] or [5;6;7]?

First 1457 1458 1459 1460 1461 1462 1463 Last Page 1459 of 2429