Maple 16 Questions and Posts Maple 16 Questions and Posts Feed

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

I am having trouble printing out a limit cylce on maple 16.  I have the attached file and if anybody could look at it and perhaps help me out it would be greatly appreciated.  The first limit cycle is supposed to look somewhat like the second one.  I'v tried many different things but nothing seems to be working.  an explenation would also be nice too.  if the file does not open correctly also let me know. thank you very much.  

 Math_4710_Hilbert_16.mw

Hi, 

I want to animate this code 

plots[odeplot](Trajectoire, [[x1(t), y1(t), t], [x2(t), y2(t), t], [x3(t), y3(t), t], [x4(t), y4(t), t], [x5(t), y5(t), t], [x6(t), y6(t), t], [x7(t), y7(t),t], [x8(t), y8(t), t], [x9(t), y9(t), t], [xA(t), yA(t), t]], TempsInitial..TempsFinal, numpoints = 10000,axes=boxed, scaling = constrained);

However, Maple 16 is giving me an error message :

Error, (in plots/animate) the first argument must be a procedure


I don't know how I can do to animate this code.

 

Thanks!

Hello,

sometimes I observe extreme delays when simply entering a variable name like fooBar; right after starting a Maple session. This happens when the current directory contains a file with that name, because Maple automatically loads this file.

For example, if I create an empty file fooBar.m and start a Maple session,

> fooBar;
Error, `./fooBar.m` is an incorrect or outdated .m file

raises an error. More often however, I have some huge Maple files in the working directory and whenever I use (by chance) a variable name in the Maple session that matches a filename, Maple tries to load the corresponding file.

Is there a documentation of this behaviour and a possibility to stop this automatic loading of files?

Thanks,

Erik

Dear All,

 

I would like perform a symbolic integration to the following integrand with Heaviside function:

 

The integral I defined is as follows:

The output I got is

 

Could any one explain me how to avoid the undefined in the output. I tried to define the assumtions to constrain the solution. However, I failed to supress the undefined.

I expect a result of the integration should also be piecewise function.

 

Appreciate you constructive inputs.

 

Thanks!

 

 

Hello,

I have trouble in using the function factors. For example, I expect

factor(Pi*(t^2+1), {I});

to output

-Pi*(-t+I)*(t+I)

but instead the result is

Pi*(t^2+1)

This problem does not appear if Pi gets replaced by a general symbol:

factor(pi*(t^2+1), {I});

produces (as I expect it should)

-pi*(-t+I)*(t+I)

The problem seems to be tied to symbols representing constants, as for example replacing Pi by Catalan also results in no factorization being performed. It further seems to be tied to specifying a splitting field, because

factor(Pi*(t^2-1));

results in

Pi*(t-1)*(t+1)

Is this behaviour intended? Probably the reason is that the polynomial does not have algebraic coefficients (as it includes Pi). Indeed,

factor(Pi*(t^2-1),{});

produces the error message

Error, (in factor) expecting a polynomial over an algebraic number field

But why does this error then not appear for the call factor(Pi*(t^2-1))? If this would assume complex coefficients, it should factor using I. Considering coefficients in an algebraic number field, also the original call factor(Pi*(t^2+1), {I}); should raise an error!?

Thanks,

Erik

I have tried to use Maple to solve ordinary differential equations but i have this error. Could you please help me to fix this problem

> eq1 := diff(v1(t), t) = v2(t);
> eq2 := diff(v2(t), t) = -v1(t)+(3*(v1(t)^2-1))*v2(t);
> init1 := v1(0) = 2;
> init2 := v2(0) = 0;
> with(DEtools);
> DEplot({eq1, eq2}, [v1(t), v2(t)], 0 .. 3*Pi, {[0, 0, 0]}, scene = [v1, v2], stepsize = .1);

Error, (in DEtools/DEplot/direction) division by zero

 

thank you

I've been poking around with convolutions on Maple, and some weird behavior came up---if I let it compute the convolution of a piecewise function, then take the convolution of that, it comes out differently than if I enter a function from scratch as the middle step---file attached (PiecewiseProblem.mw).  I'm not really a Maple pro, so am I'm doing something crazy here?

Thanks!

Dear all;

 

I want to plot the error defined in the last line.   the error is defined by the difference entre step h and step 2h for Heun method.

The code for Heun1 work well ( stepsize 2h),

Heun2 don't working. Please, I need a Help, maybe there is somethong missing.

here the code with maple code, without pciture.

f :=(x,y)-> 1/(1+sin(y));

ode:=diff(y(x),x)=f(x,y);

## Heun Method with stepsize 2*h

Heun1 := proc(f, x0, h)
local x, y, i, N, k;
N := round((1/2)*x0/h);
y := Array(0 .. N);
x := Array(0 .. N);
x[0] := 0;
y[0] := (1/4)*Pi;
for i from 0 to N-1 do
x[i+1] := (i+1)*2*h;
k[1] := f(x[i], y[i]);
k[2] := f(x[i]+h, y[i]+h*k[1]);
y[i+1] := y[i]+(1/2)*h*(k[1]+k[2]);
 end do;
 evalf([seq([x[i], y[i]], i = 0..N)])
 end proc

 

## Heun Method with stepsize h

Heun2 := proc(f, x0, h)
local x, y, i, N, k;
N := round((1/2)*x0/h);
y := Array(0 .. 2*N);
x := Array(0 .. 2*N);
x[0] := 0;
y[0] := (1/4)*Pi;
for i from 0 to 2*N-1 do
x[i+1] := (i+1)*h;
k[1] := f(x[i], y[i]);
k[2] := f(x[i]+h, y[i]+h*k[1]);
y[i+1] := y[i]+(1/2)*h*(k[1]+k[2]);
 end do;
 evalf([seq([x[2*i], y[2*i]], i = 0..N)])
 end proc


 Heun1((x,y)->f(x, y), 1,1e-2);  ## Heun1 work very well


 Heun2((x,y)->f(x, y), 1,1e-2); ## Dont working...

## The error

x0:=1;

epsilon:= (x0,h)->sqrt(1/(( round(x0/(2*h))+1))*add(( Heun1((x,y)->f(x,y),x0,round(x0/(2*h)))[i][2]-Heun2((x,y)->f(x,y),x0,  round(x0/(2*h)))[i][2])^(2),i=1..N+1));

data[Heun] := [seq([h,epsilon(x0,h)], h =1e-2..1)];

loglog(epsilon(1,h),h=1e-2..1);

 

Dear all,

Thank you for your Help.

h: stepsize;

x in [0,x0];

I give all the step of my code, but I think there is a mistake. I wait for your Help.

I would like to compute the error between  Method Huen with step size h and step size 2h using the definition of epsilon given below:

 ## The error written epsilon(x0,h)= sqrt(1/(N+1) * sum_i=0^N  (y_i^{2h}-y_(2i)^h)^2 ), where y_i^(2h) is the approximation of y(i*2*h).

 ## We want : loglog epsilon versus h.

  epsilon:=(x0,h)->sqrt( 1/(N+1)*add( (Heun1(f,x0,i)-Heun2(f,x0,i))^2,i=0..N ) );

  f:=(x,y)=1/(1+cos(y)); 

  ode:=diff(y(x),x)=f(x,y);

ic:=y(0)=1;  h:=x0/(2*N);

## Method Heun with step size 2h

> Heun1 := proc (f, x0,)

local x, y, i, h, k;

y := Array(0 .. N);

x := Array(0 .. N);

h := evalf((1/2)*x0/N);

x[0] := 0;

y[0] := 1;

for i from 0 to N do

x[i+1] := (2*i+2)*h;

k[1] := f(x[i], y[i]);

k[2] := f(x[i]+h, y[i]+h*k[1]);

y[i+1] := y[i]+h*((1/2)*k[1]+(1/2)*k[2]);

end do;

[seq([x[i], y[i]], i = 0 .. N)];

end proc;

### Now Heun with step size h  ( the same h)

> Heun2 := proc (f, x0,)

local x, y, i, h, k;

y := Array(0 .. N);

x := Array(0 .. N);

h := evalf((1/2)*x0/N);

x[0] := 0;

y[0] := 1;

for i from 0 to N do

x[i+1] := (i+1)*h;

k[1] := f(x[i], y[i]);

k[2] := f(x[i]+h, y[i]+h*k[1]);

y[i+1] := y[i]+h*((1/2)*k[1]+(1/2)*k[2]);

end do;

[seq([x[2*i], y[2*i]], i = 0 .. N)];

end proc;

 

 

Thanks you for your help.


                                

                        

 

Hi There,

 

Could you let me know how to tell Maple to use the ln simplification to give -ln(x)+ln(y) = ln(y/x).

 

I tried following command.

simplify(-ln(x)+ln(y), ln)

 

However, it is not able to give the required simplification.

Hi,

I wrote the following code which is properly run

 


restart:

# parametrs

MUR:=(1-phi)^2.5:
RhoUR:=(1-phi+phi*rho[p]/rho[f]):
RhoCPR:=(1-phi+phi*rhocp[p]/rhocp[f]):
BetaUR:=(phi*rho[p]*beta[p]+(1-phi)*rho[f]*beta[f])/(RhoUR*rho[f])/beta[f]:

dqu3:=diff(h(x),x$1)-RhoUR*BetaUR*T(x);
dqu2:=5*diff(T(x),x$2)+k[f]/k[nf]*Pr*RhoCPR*f(x)*diff(T(x),x$1);
dqu1:=5/(MUR)*diff(f(x),x$3)
+ 2*(diff(h(x),x$1)*x-h(x))
+RhoUR*(3*f(x)*diff(f(x),x$2)-diff(f(x),x$1)^2);
rho[f]:=998.2: cp[f]:=4182: k[f]:=0.597:   beta[f]:= 2.066/10000:
rho[p]:=3380: cp[p]:=773: k[p]:=36:   beta[p]:= 8.4/1000000:

k[nf]:=((k[p]+2*k[f])-2*phi*(k[f]-k[p]))/((k[p]+2*k[f])+phi*(k[f]-k[p])):
rhocp[nf]:=rho[p]*cp[p]*phi+rho[f]*cp[f]*(1-phi):
rhocp[p]:=rho[p]*cp[p]:
rhocp[f]:=rho[f]*cp[f]:

phi:=0.00:
binfinitive:=6: Pr:=7: lambda:=0:


with(plots):
pppe:=dsolve( {dqu1=0,dqu2=0,dqu3=0,T(0)=1,T(binfinitive)=0,f(0)=0,D(f)(0)=lambda,D(f)(binfinitive)=0,h(binfinitive)=0}, numeric );
-pppe(0);
print(odeplot(pppe,[x,diff(f(x),x)],0..binfinitive,color=black,numpoints=400));
print(odeplot(pppe,[[x,diff(f(x),x)]],0..binfinitive,color=black,numpoints=400));
print(odeplot(pppe,[[x,T(x)]],0..binfinitive,color=black,numpoints=400));


However, in some range of parameters, I must increase the value of binfinitive (for example binfinitive=50). however, my code is doesnt converge for higher values of 10 (at most). Can anyone change this algorithm in a way that it insensitive to the value of binfinitive?

Many thanks for your attention in advance

 

Amir

I plot a curve with "plot" command, how to export the figure to .emf format file?

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

I suppose you would have to programme this, because I couldn't find anything relating to vector spaces in my Maplesoft Linear Algebra tutor or package.

My question really is, you have a problem like, the set of all pairs of real numbers of the form (1,x) with the operations (1,y)+(1,y')=(1,y+y') and k(1,y)=(1,ky) 

( ^ taken straight out of my homework haha)

and you run through the 10 vecctor space axioms to determine whether it fails and it not a vector space, or it passes all and it is a vector space.

 

Is there a way to do this in Maplesoft?

 

Hell

I write this code and didn't work , I have some erorrs as

Warning, The use of global variables in numerical ODE problems is deprecated, and will be removed in a future release. Use the 'parameters' argument instead (see ?dsolve,numeric,parameters)
Warning, cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up

also I have question " How I can change the scale of plot"

parameters := [z = 0, Omega = 2.2758, tau = 13.8, T2 = 200, omega0 = 1, r = .7071, s = 2.2758, H = 1.05457173*10^(-34), omega = .5, k = 1666666.667, Delta = 1.7758]

 

sys1 := {diff(u(t), t) = s*v(t)-u(t)/T2, diff(v(t), t) = -s*u(t)-2*Omega*exp(-r^2/omega0^2-t^2*1.177^2/tau^2)*cos(kz-`ωt`)*w(t)-v(t)/T2, diff(w(t), t) = 2*Omega*exp(-r^2/omega0^2-t^2*1.177^2/tau^2)*cos(kz-`ωt`)*v(t)}; ICs1 := {u(-20) = 0, v(-20) = 0, w(-20) = -1}

 

ans1 := dsolve(`union`(eval(sys1, parameters), ICs1), numeric, output = listprocedure); plots:-odeplot(ans1, [[t, u(t)], [t, v(t)], [t, w(t)]], t = -20 .. 20, legend = [w, v, u])

 

U := eval(u(t), ans1); F := eval(((-2*10^33*Omega*H*r*U(t))*(1/omega0^2))*exp(-r^2/omega0^2-t^2*1.177^2/tau^2)*cos(kz-`ωt`), parameters)

 

plot(F, t = -20 .. 20)

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