Items tagged with numerical numerical Tagged Items Feed

I have an arrays of data. One for x values, and one for y values. How can I obtain a numerical integration of y for a range of x values?

I have tried defining a function of X using ArrayInterpolation(x,y,X) and then calling evalf(Int(f,xmin..xmax)) but that gives an error message. (I don't seem to be able to paste into this window) The error message says

"Error, invalid input: evalf expects its 2nd argument, n, to be of type posint, but received numeric."

I thought I was using a form of the equation right from the help system.

I also tried the 2D version of integration, but it returns the difference of my limits times my function name.

I aslo tried AdaptiveQuadrature, but I can't get that to work either.

-Mike McDermott

Newbie Maple user

 

 

I want to solve numerically the nonlinear pde:

 

u_x+u_t - (u_{xt})^2 = u(x,t)

 

which method do you propose me to use with maple? (I don't mine about which boundary conditions to be used here).

 

I have the following integral equation to solve numerically:

 

v(x,t)=1 - h*\int_0^t JacobiTheta0(1/2x , \pi i s) v^4(1,t-s)ds

where h is a numerical parameter, and v(1,t) = 1-h*\int_0^t \theta_3(r)v^4(1,t-r)dr (theta3 is Jacobi theta3 function).

 

So I want to use an iteration method that will converge numerically to the solution, where v(1,0)=1.

How to use maple for this?

I want also to find the rate of convergence to the numerical solution.

 edit: I should note that v(x,0)=1, even though it's implied from v(x,t) above.

 

Hi,

sorry for that question, i'm a beginner in maple but i think my question is not as simple.

So, i want to solve numerically this first equation :

but the second term is present only if k*(U*t-x)>μc*m*g  (stick-slip problem)

initial conditions : U=1m/s; x=0m; k=10 for example

My problem is simple, i don't know how to use conditional statement for such an ode in maple.

I've tried > Xr := U*t-x;
> k := 10; m := 1; g := 10; mu := .2;
> if k*Xr > mu*m*g then ode1 := m*(diff(x(t), t, t)) = k.Xr-mu*m*g else ode1 := m*(diff(x(t), t, t)) = k.Xr end if;

But, of course, too optimistic.

Thank to anyone who will solve that (isuppose) simple problem

Philippe

Hello,

This is the system of equations in term of sin and cos. I have used the command "solve" in Maple but it yielded only 2 solutions. I've tried to use with(RealDomain): It yielded more solutions but most of them were wrong.

 

 

f1 := -8100+(-30+70*cos(t1)-40*cos(t2))^2+(-70*sin(t1)+40*sin(t2))^2

f2 := (-20-80*cos(t3))^2+(-15+70*cos(t1)+10*cos(t1+t))^2+(-70*sin(t1)-10*sin(t1+t)+80*sin(t3))^2-5625

f3 := (-20-80*cos(t3))^2+(15+40*cos(t2)+10*cos(t1+t))^2+(-40*sin(t2)-10*sin(t1+t)+80*sin(t3))^2-5625

f4 := 10*cos(t1+t)*(30-70*cos(t1)+40*cos(t2))-10*sin(t1+t)*(70*sin(t1)-40*sin(t2))

 

Anybody know how to solve this system of equations to get the full set of roots?

Thank you very much in advance.

Dear Friends:

I am currently working on a calculation for phase velocity of acoustic waves and don’t get along.  

My equation has the following form:

equ := tan( (31 / 20000) * sqrt( -9610000/c^2 + 1) / Pi) / tan((961/1260000) * sqrt( -39690000/c^2 + 1)/ P i) = -(1191640000/63)*sqrt(-9610000/c^2 + 1)*sqrt (-39690000/c^2 + 1)/ (c^2*(19220000/c^2 - 1)^2)

Using ‘sol = solve(equ,c)’ returns

sol := 96100* RootOf(1 + (400000000 * Pi^2 * RootOf(40320000000000000000 * Pi^4 * tan(_Z)*_Z^4256000000000000 * Pi^3 * csgn(_Z) * _Z^3 * tan((1/157500) * sqrt(24806250000 * Pi^2 * _Z^2 - 45167) / Pi) * sqrt(24806250000 * Pi^2 * _Z^2 - 45167) -96868800000000 * Pi^2 * tan(_Z) * _Z^2 + 615040000 * Pi * csgn(_Z) * _Z * tan((1/157500) * sqrt(24806250000 * Pi^2 * _Z^2 - 45167) / Pi ) * sqrt(24806250000 * Pi^2 * _Z^2 - 45167)+58181823 * tan(_Z))^2 - 961)* _Z^2)

c should be in a range of 13,000.

Two questions:

1) How can I deal with _Z?

2) Any suggestion how I can calculate ‘c’? Maybe numerical?

I am relative new in maple…

Many thanks!

Alex

Hi,

     I'm trying to numerically solve a PDE in Maple for different boundary conditions, however I'm having trouble even getting Maple to numerically solve it for simple boundary conditions.

I have cylindrical coordinates, r, z, theta, and I treat r = r(z, theta) for convenience to plot my solution surface. The initial coundary condition is that at z = epsilon (z = 0 is singular) , r = constant and of course r is periodic in theta. This is just a circle, and the analytical solution is know to be a half-sphere  r = sqrt(R^2 - z^2). I entered my initial boundary conditions into Maple, but it doesn't like the periodic one

IBC := { r(epsilon, theta) = R - epsilon__r,
              r(z, 0) = r(z, 2*Pi) };

pdsolve(
  PDE,
  IBC,
  numeric,
  indepvars = [z, theta],
  time = z,
  range = 0..2*Pi);
Error, (in pdsolve/numeric/par_hyp) Incorrect number of boundary conditions, expected 2, got 1

I'm not sure how to make this work, and then generalize it to more arbitrary intial slices r(epsilon, theta) = f(theta).

Here's the attached worksheet, ForMaplePrimesSUbmission.mw

Any help is appreciated,

Thanks

Any suggestions (or perhaps related examples?) illustrating how I might numerically solve for f(t) in the following non-linear integral equation?  In Fortran, I would start with a guess f(t)=T0, and then search in the neighborhood for a minimum (in the error), but I am not familiar with numerical searches and methods in Maple.  Thank you for any suggestions or leads.

(a,b,... etc are all real)


T__0 := 298.

`ΔT` := 25.

0 < beta and beta <= 1

``

f*t = T[0]+`&Delta;T`*[1-exp(-a(int(exp(-b/f(y)), y = y[1] .. t))^beta)]

NULL


Download Integraleqn.mw

 

 

 

Good day everyone,

Please I do get numerical output/values in this solution U1.mw

Best regards

I have to solve a numerical problem and I was wondering how to make maple treat very small numbers as zero. Say I do not care about anything less than 10^-5, so maple should treat all such numbers as zero. How to set this behaviour for the entire session? Thanks!

 

I have a system of pdes and solved numerically using pdsolve (numeric) command.

The system consists of four first order partial differentia equations.

for example u(x,t), R(x,t)....

what command should I give to the Maple and get the graph of u(x,t) at a specific point x_0?

For example, I need a plot for u(30,t).

Is it possible with the maple plot?

I really appreciate your help.

Thank you for reading this post. :)

 

I have a problem solving a system of PDEs.

The system of PDEs are

PDE01 := -(l^2+1^2)*(diff(v(l, t), t))+(l^2+1^2)*(diff(R(l, t), l, l))+4*l*(diff(R(l, t), l))+4*l*v(l, t)/(l^2+1^2)^(1/4)-6*R(l, t)/(l^2+1^2)+(l^2+1^2)^(1/2)*(-1.1+sqrt(.1))^2*sqrt(24)*u(l, t) = 0

PDE02 := diff(R(l, t), t) = v(l, t)

PDE03 := diff(u(l, t), t)-sqrt((1.1^2-1)/1.1^2)*(diff(u(l, t), l))-2*l*sqrt(1.1^2-1)*u(l, t)/(l^2+1^2) = 0

the initial condisions are

v(l, 0) = 0, R(l, 0) = 0, u(l, 0) = sqrt((l^2+1^2)^(1/2))*10^(-5)*exp(-(l-10)^2/.5^2)

and the BCs are

bdry00 := {((30^2+1^2)/30^2)^(1/4)*v(-30, t) = -((30^2+1^2)/30^2)^(1/2)*(D[1](R))(-30, t), ((30^2+1^2)/30^2)^(1/4)*v(30, t) = -((30^2+1^2)/30^2)^(1/2)*(D[1](R))(30, t), u(-30, t) = sqrt(30^2+1^2)*10^(-5)*exp(-40000), u(30, t) = sqrt(30^2+1^2)*10^(-5)*exp(-10000)}

to solve the system,

I enter

pde := pdsolve({PDE01, PDE02, PDE03}, {bdry00, init00}, time = t, numeric, range = -30 .. 30, timesstep = 1/60, spaceste = 1/254)

then, I failed to get the result constantly.

I tried several cases changing the initial conditions...

Can you let me know what I am doing wrong?

 

Dear all,

I have a question regarding the computation speed of Maple. I'm doing some numerical work with Maple and when I'm not using the build in Maple routines, but write my one routines to solve e.g. a system of partial differential equations using a finite differencing method, it takes Maple sometimes up to two hours to finish the computation. I also noticed that Maple is only using around 30% of my CPU. I know it's more efficient to do numerical work with C++ or other programming languages (at least that's what most people I know are using) but do any of you know some ways to improve the computation speed of Maple or to make it use more of my CPU to do the calculations faster?

Dear all,

I have a question regarding the dsolve procedure in Maple. I'm trying to construct a neutron star model using the Tolman-Oppenheimer-Volkoff equation using a polytropic equation of state (EOS) which requires me to solve the ode system:

diff(rho(r),r)=-(rho(r)*(1+K/(5/3-1)*rho(r)^(5/3-1))+K*rho(r)^(5/3))*(4*Pi*r^3*K*rho(r)^(5/3)+m(r))/(K*5/3*rho(r)^(5/3-1)*r*(r-2*m(r)))

diff(m(r),r)=4*Pi*rho(r)*(1+K/(5/3-1)*rho(r)^(5/3-1)

where I have used the EOS P(r)=K*rho(r)^(5/3) and K is a known constant. rho is the density of the star, m it's mass and P the pressure inside the star.

For the initial conditions I have chosen: rho(10^(-10))=rho_0 and m(10^-10)=0. I have chosen r=10^-10 as the innermost point for the integration, since the differential equation for rho is singular at r=0. rho_0 is the central density of the star.

I solve these equations numerically using:

TOV:=dsolve({ode,ics},numeric,output=listprocedure)

where ode is my system of differential equations and ics are my initial conditions. I need now the radius of the star (R_star), which is the maximum value of r, up until which Maple has carried out the integration.

My problem is, I don't know of any efficient way, to do this. What I'm doing currently is defining a procedure TOVr:=rhs(TOV[1]) and I evaluate it at a very high value of r, for which Maple returns me the error message: "Error, (in TOVr) cannot evaluate the solution further right of ..., probably a singularity". I then use the command TOVr('last') to call the maximum value of r and to store it.

I can use the above method, as long as I'm solving the ODEs only for a few different values of rho_0. But I would like to plot m(R_star) for values of rho_0 ranging from 10^(-14) to 10^(-12) in order to find the value of rho_0, for which I can obtain the maximum value for m(R_star). But this requires me to know the value of R_star for every rho_0 and using the above method is not feasible for say hundred different values of rho_0, since I can't write a loop, because it get's terminated as soon as Maple gives me the first error message.

I was thinking of using perhaps the 'events' command in dsolve, to stop the numeric integration once the value for the pressure drops very low, say below 10^(-46), since the radius at which P(r)=0 defines the stellar surface. I tried using:

TOV:=dsolve({ode,ics},numeric, events=[[K*rho(r)^(5/3)-10^(-46),halt]])

but if I try again to evaluate the solution at a large value of r, I get the above error message, and the integration doesn't get canceled, although the value 10^(-46) is bigger than the value for the pressure I would obtain for R_star using TOVr('last') and Maple shouldn't encounter a singularity.

Am I using the 'events' command wrong? And does somebody know of a more efficient method to obtain the maximum value of a variable after carying out a numerical integration using dsolve?

Sorry for the long post and thank you all.

Greetings, seeking an expert to animate a plot.

see worksheet.posterior_graphs_(encapsulted)_1D.mw

before they play each other, each have a law (a normal distribution) plot-output 6.

after DD defeats CC, and a numerical integration is performed the new laws are given by plot-output 18.

as you can see, the laws of DD and CC are closer together.

if the calc was repeated (DD defeats CC again), the laws would be closer again.

so what i require is an animation of the new laws from game 1 to (say) game 6 (DD defeats CC every time). seeing the red and blue distributions merging would be ideal.

as an aside I heard maples FFT could simplify the complicated integration. any suggestions?

cheers

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