MaplePrimes Questions

Hi.

please, I need some code about stepsize adaptative Runge Kutta method ( any order ) or other methods.

Thanks

I am trying to produce an animation. Everything seems correct, but the evaluation is taking a very long time. Even after an hour, it still tries to crank out a graph for me. I even tried to truncate the integral!

Here is my code.

with(plots):

z:= x -> 2*(int((sin(2*y)-sin(y))*cos(y*x)*exp(-y^2*t)/y, y = 0 .. 200))/Pi;

animate(plot, [z(x), x = 0 .. 10, y = -.1 .. 2], t = 0 .. 1, frames = 100);

 

Would could be the problem? 

Hi all

How to read a value from keyboard of PC when executing a maple document and assign it to a variable ?

Thanks

 


Dear the specialst in programmation, please I need to put a conditon if in this procedure with this form: Can you correct me this code please. Thank you.


aaa:=proc(x,y,f,N)
local bb,
for i= from 1 to N do

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

if bb[i]<=2 then y:=3*x[i] else y::=x[i]^2end if ;

end do:

end proc

 

 

> with(DEtools);
> L := -1.576674; MU := 0; DE13 := {(D(x))(t) = x(t)*(1+4*x(t)*x(t)-y(t)*y(t))+MU*y(t)*(x(t)*x(t)-.43*y(t)*y(t)-L), (D(y))(t) = y(t)*(1+x(t)*x(t)-.5*y(t)*y(t))+MU*x(t)*(x(t)*x(t)-.43*y(t)*y(t)-L)}; DEplot(DE13, [x(t), y(t)], t = 0 .. 20, [[x(0) = 0.1e-1, y(0) = .99], [x(0) = -.1, y(0) = -.9], [x(0) = 1.1, y(0) = 0], [x(0) = 0, y(0) = .2], [x(0) = 0, y(0) = .6], [x(0) = .6, y(0) = 0], [x(0) = .75, y(0) = 1], [x(0) = .1, y(0) = .1], [x(0) = .5, y(0) = 1.0], [x(0) = -.5, y(0) = 1], [x(0) = .5, y(0) = -1], [x(0) = -.5, y(0) = -1], [x(0) = -0.1e-1, y(0) = .99], [x(0) = 0.1e-1, y(0) = -.99], [x(0) = -0.1e-1, y(0) = -.99], [x(0) = .5, y(0) = -1], [x(0) = -.5, y(0) = -1], [x(0) = 0.1e-1, y(0) = .9]], stepsize = 0.1e-1, scene = [x(t), y(t)], title = "phaseplane 3 prime plot", linecolor = black, thickness = 1);
-1.576674
0
/ / 2 2\
{ D(x)(t) = x(t) \1 + 4 x(t) - y(t) /,
\

/ 2 2\\
D(y)(t) = y(t) \1 + x(t) - 0.5 y(t) / }
/
Warning, plot may be incomplete, the following errors(s) were issued:
cannot evaluate the solution further right of .93908020e-1, probably a singularity
Warning, plot may be incomplete, the following errors(s) were issued:
cannot evaluate the solution further right of .26367741, probably a singularity
Warning, plot may be incomplete, the following errors(s) were issued:
cannot evaluate the solution further right of .23463732, probably a singularity
Warning, plot may be incomplete, the following errors(s) were issued:
cannot evaluate the solution further right of 1.7040014, probably a singularity
Warning, plot may be incomplete, the following errors(s) were issued:
cannot evaluate the solution further right of .62484768, probably a singularity
Warning, plot may be incomplete, the following errors(s) were issued:
cannot evaluate the solution further right of .62484768, probably a singularity
Warning, plot may be incomplete, the following errors(s) were issued:
cannot evaluate the solution further right of .62484768, probably a singularity
Warning, plot may be incomplete, the following errors(s) were issued:
cannot evaluate the solution further right of .62484768, probably a singularity

 

what do i need to do so there are no more singularites?

i cant find the error the program is saying i have 

> L := -1.576674; MU := 0; DE13 := {D(y)*t = -x(t)*(1-2*x(t)*x(t))+MU*y(t)*(x(t)*x(t)-3*y(t)*y(t)-L), (D(x))(t) = y(t)*(1-y(t)*y(t))+MU*y(t)*(x(t)*x(t)-3*y(t)*y(t)-L)}; DEplot(DE13, [x(t), y(t)], t = -20 .. 20, [[x(0) = 0.1e-1, y(0) = .99], [x(0) = 0.5e-1, y(0) = .95], [x(0) = .1, y(0) = .9], [x(0) = 0.4e-1, y(0) = .96]], stepsize = 0.1e-2, scene = [x(t), y(t)], title = "phaseplane plot", linecolor = black, thickness = 1, number = 1000);
 
Error, (in DEtools/DEplot/CheckInitial) too few initial conditions: [x(0) = 0.1e-1, y(0) = .99]

it might be hard to read but if someone could help me it would be very appreciated 

int(BesselJ(2, r*k)*BesselJ(1, 1500*k), k = 0 .. infinity);

(of course, calculated numerically) against r=0..40 ?

PS. It is possible in Mathematica 9.0.1.0 .

 

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?  

First 1453 1454 1455 1456 1457 1458 1459 Last Page 1455 of 2434