MaplePrimes Questions

 

I have a procedure which give an approximate solution for ode.

This our procedure

RKadaptivestepsize := proc (f, a, b, epsilon, N).

It's working ( afther some 3 mistake found by a member in Mapleprime).

Then I would like to compute the error between exact and approximate.

RKadaptivestepsize: compute the approximate solution

analyticsol: analytic solution

 

## here, I compute the error
for N from 2 by 2 to 500 do
dataerror:= N->evalf(abs(RKadaptivestepsize(f,0,1,epsilon,N)[1+N][2]-(eval(analyticsol, x = 1))));
##  sequence of data error
data[error] := [seq([N, dataerror(N)], N = 2 .. 500, 2)]:
if  data[error][k][2]<=epsilon then   
printf("%a  is the number of steps required using 3-step Runge Kutta Method to achieve an  eroor of 1e-6 .", k)
break ;
end if;   
end do;
end do;

But its gives an error.: Error, reserved word `error` unexpected

Have any one an idea.

 

Hello,

I am having trouble using the programmer entry point interface to convert/parfrac. As an example consider x/(I*x-1): While

> convert([x, [I*(x+I), 1]], parfrac, x);                   

         [-I, [(I + x) I, -I]]

correctly computes a partial fraction decomposition, the equivalent input

> convert([x, [I*x-1, 1]], parfrac, x);  

results in the error message (both in Maple 16 and 17)

Error, (in convert/parfrac) denominator factors must be coprime

which does not make any sense to me, since there is only a single denominator factor present (and it is even the same factor as in the previous call, only written differently).

What is the reason for this behaviour and how can I use convert/parfrac in a way that avoids such errors?

Thanks,

Erik

I am trying to numerically evaluate the following integral

 

integral to solve

 

I have currently used the maple commands

 

int(exp(10*(-2*y^2+y^4))*exp(-10*(-2*z^2+z^4)), [z = -infinity .. y, y = -1 .. 0], numeric)

evalf(int(exp(10*(-2*y^2+y^4))*exp(-10*(-2*z^2+z^4)), [z = -infinity .. y, y = -1 .. 0]))

evalf(Int(exp(10*(-2*y^2+y^4))*exp(-10*(-2*z^2+z^4)), [z = -infinity .. y, y = -1 .. 0]))

 

but all of them return the integral unevaluated. Any help?

Hello

I'm doing some calculation reports in maple. These reports are to be submitted to various classification societies - which all have different requirements to the calculations.

I would like to make a report, where the class specific calculations would be append based on a selection of class in the main calculation.

How do I do this?

 

If I was using latex, matlab, APDL or something like that, I would do and *IF Class=class1, *INPUT class.calc, *ENDIF, but how to do this in maple?

Hi

I need a temperature distribution inside a barrier during a heating process.
I will be appreciated for any help.

 

wz

How to animete BC using varying temperature in time?  How to obtain animated solution?

restart

Diffusivity coefficent...

a := 0.1e-5:

Thickness of barrier...

L := .2:

Heating curve:
Time in heating curve (in hours form exmaple)...

Time := seq(i, i = 1 .. 10):

Varying temperature in time [K]....

Temp_in_Time := [433.15, 568.15, 703.15, 838.15, 973.15, 1108.15, 1243.15, 1378.15, 1513.15, 1616.15]:

Initial temperature [K]

Tot := 298:

PDE := diff(T(x, t), t) = a*(diff(T(x, t), x, x)):

--->>>

BC1 := {T(0, t) = Temp_in_Time[2], T(L, t) = Temp_in_Time[2], T(x, 0) = Tot}:

sol := pdsolve(PDE, BC1, numeric, timestep = 50):

sol:-plot(t = 3*3600, thickness = 3, colour = red);

 

``



Download heating.mw

Hi

I use Maple perhaps only one time per year and thus i'm a beginner with the product (even if i use it since 1996). I'm trying to make the following script work in Maple 17:

http://www.maplesoft.com/applications/view.aspx?SID=4268&ref=Feed&L=F

but i fail.... Some help will be appreciate

restart:

Eq1:=1/r*diff(r*diff(w(r),r),r)-(cos(z1))^2*(w(r)+1)-DP;

dsolve({Eq1});

bcs:=D(w)(0)=0,w(r2)=A1;

dsolve({Eq1,bcs},w(r)):

where z1, Dp, r2, A1 are constants.

 

Hi, can I get some help with this?


The question is:

Consider the following IVP for a mass of m = 2 kg attached to a spring with a spring constant k = 9 N/m. The spring mass system is in a medium with damping constant b.

2y" + by' + 9y = 0

y(0) = 0, D(y)(0) = -3 

 

It then asks find three values b1, b2, b3 where b1 is underdamped, b2 is critical, b3 is over. 

I set b1 as 1, b2 as sqt 72, b3 as 9. 

 

Then it asks to find the quasi period. 

I can't get my quasi period right. My answer is 2pi/ sqrt (4.5).

 

Any help?  

Dear all;

Please I need your help to find the error in my code.

I want to solve an ode, with condition on step size.

ode := diff(y(x), x) = 2*x+y(x);
f:=(x,y)->2*x-y;

analyticsol := rhs(dsolve({ode, y(0) = 1}));
RKadaptivestepsize := proc (f, a, b, epsilon, N)
local x, y, n, h,k,z,R,p;
p:=2;
h := evalf(b-a)/N; ## we begin with this setpsize
x[0] := a; y[0] := 1; ## Initialisation
for n from 0 to N-1 do  ##loop
x[n+1] := a+(n+1)*h;  ## noeuds
k[1] := f(x[n], y[n]);
k[2] := f(x[n]+h, y[n]+h*k[1]);
k[3] := f(x[n]+h/2, y[n]+h/4*(k[1]+k[2]));
z[n+1] := z[n]+(h/2)*(k[1]+k[2]);## 2-stage runge Kutta.
y[n+1] := y[n]+(h/6)*(k[1]+k[2]+4*k[3]);
R:=abs(y[n+1]-z[n+1]); ## local erreur
hstar:=sqrt(epsilon/R)
if R=<=epsilon    then
   x[n] := x[n+1]+h;
   y[n]:=y[n+1];
   n:=n+1;

else

h:=hstar;
end if
 end do;
[seq([x[n], y[n]], n = 0 .. N)];
[seq([x[n], z[n]], n = 0 .. N)];
end proc:

epsilon:=1e-8;
RKadaptivestepsize((x,y)->2*x-y,0,1, epsilon,20)

I am trying to display a graph where there is a rotating square. My code is 

   for k to 30 do

RotSquare := Trans(1.5, 1.5).HomRot(k*Pi/15).Trans(-1.5, -1.5).HomSquare;

graph[k] := plot(Transpose(<RotSquare[1], RotSquare[2]>), x = -3..3, y = -3..3):

od:

display(seq(graph[k], k = 1..30), insequence = true);

with HomRot being 

HomRot := theta ->((cos(theta), sin(theta), 0)(-sin(theta), cos(theta), 0) (0 0 1))

However, when I run this code, my output is 

display(PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), PLOT(...), insequence = true)

and I'm not sure what I am doing wrong. Help would be greatly appreciated

Hi.

Please, I need a code in maple for adaptative setp size control for runge Kutta.

Thank you.

Is there any possibility for maple 16 or  any version, to show steps for this kind of Differential Equation.

>restart;

>diff(diff(psi(x),x),x)+ ((1/4)*(-3+lambda^2)/x^2)*psi(x)-I*lambda/x^2*psi(x)+E*psi(x)=0;

it has a Bessel solution, just want to check like Hint, if substitution method can be apply, just as FROBENIUS’METHOD works. Thanks
                

Hello fellow maple fans :)

 

I have tried to plot this continuous Piecewise function

plot(piecewise(0 <= t and t < 2, 2-t, 2 <= t and t <= 3, 2*t-4))

On the interval [0,6]

When i try it plot it it won't show the entre internal, is there a way to tell maple that the funktion should continuous until [0,6]

Please see this http://snag.gy/NPrjG.jpg if you are not sure what i mean in the end it should look like this http://snag.gy/ScgtF.jpg

Greetings David Thanks in advance :)

 

Hi, i'm wondering if theres anything i can do printf and print and have the outputs on the same line. I want the string wihtout any quotations so i think i can only do printf to get this, but then i'm putting an entry out of an array after this. This is a small example out of my code, i would like the output to be all on one line:

The synchronising vector is (S[j-1]) The synchronising word is (X[j-1]) The length of the synchronising word is ...

 

if (sync=true) then 
printf("The Synchronising vector is"); print(S[j-1]);
printf("The sychronising word is");
print(X[j-1]);
printf("The length of the synchronising word is");
print(length(X[j-1]));
else printf("There is no synchronising word"); 
end if;

 At the moment its outputing each print on a new line.

Any help would be much appreciated, thanks.

 

 

Hi. Thanks to help me in ths question.

 

t:=[1,2,3];

f(t[1])=[3,4];  f(t[2])=[11,12];   f(t[3])=[41,1]; 

How can plot  f  versus t

 

 

 

First 1449 1450 1451 1452 1453 1454 1455 Last Page 1451 of 2429