Items tagged with numerical numerical Tagged Items Feed

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

Hello, I need a person who can help me with task from numerical methods.

I'd like to know how to ask Maple to find numerical solutions to underspecified systems of nonlinear equations.  For example, suppose I had a system of equations like this:

eq1 := y1 = tanh(x1);

eq2 := y2 = cosh(x1 + x2);

eq3 := y1 + y2 = 2.0;

Typing this:

fsolve([eq1, eq2, eq3]);

results in the following error:

Error, (in fsolve) number of equations, 3, does not match number of variables, 4

In this situation I can easily artificially restrict the system to find a solution.  For example, I can do:

eq4 := x1 = 0.0;

fsolve([eq1, eq2, eq3, eq4]);

which will result in the following solution:

{x1 = 0., x2 = 1.316957897, y1 = 0., y2 = 2.000000000}

The issue here is that I pulled x1 = 0.0; out of thin air.  Setting a single variable to zero would not work to solve an arbitrary set of nonlinear equations.  How can I ask Maple to find a single (not necessarily unique) solution to an underspecified system of nonlinear equations?

Hi all,

I'm having some trouble trying to make it so the answer Max(3,1,x,4) turns into Max(x,4), that is, only the greates number and the non numerical values are returned. I've tried a bunch of different things, but have gone out of ideas.

This is the link to the Maple file :6-1.mw and this is the code:

``

#Improve the general Max procedure on page 224 so that Max(3,x,1,4)returns Max(x,4). That is, the procedure returns the maximum numerical value along with all nonnumerical values.

Max:=proc() local m, i;
m:=-infinity;
for i in (args) do
  if not type(i, numeric) then
    return 'procname'(args):
  end if;
  if i>m then
    m:=i
  end if;
end do;
m;
end proc;

proc () local m, i; m := -infinity; for i in args do if not type(i, numeric) then return ('procname')(args) end if; if m < i then m := i end if end do; m end proc

(1)

Max(3,1,x,4);

Max(3, 1, x, 4)

(2)

 

``


Would really appreaciate your help with this

Download 6-1.mw

I tried to run a few calculation on maple, the numerical output is, e.g.

 

0.3 10^(-5)

 

Is there any simple way to set it as 0.3e-5? I am not intened to write the data into a file, hence, i am not sure if writedata is a suitable option.

 

Thank you very much! 

 

>restart:
>with(LinearAlgebra):
>with(Student[NumericalAnalysis]):
s := {E[1], E[2], E[3]};
v := {x[1], x[2], x[3]};
A := GenerateMatrix(s, v);
B := augment(A)
Then what i do that for any matric i can use same program.

Hye,

Have a good day Sir.

can u help me how to solve my problem using the Implicit Crank Nicolson Finite different Method. I have attached the problem and what I have done in Word file. I have to modify my Equations in order to get the graphs (that is wrong actually). Can you help how to get the graphs by not change the sign of my equations?:( 

 

Thank you in advance.

God Bless you.

 

 

Hi all,

I am trying to solve the following differential equation numerically using dsolve,

 

y * abs (y''') = -1

y(0) =1, y'(0) = 0, y''(0)=0

 

it works fine when tthe absolute function is not there, i.e. yy''' = -1. 

Do you have any suggestion?

Hi,

I'm trying to solve the following non-linear ODE numerically:

by ececuting

but maple gives me this error-message:

"Error, (in dsolve/numeric/make_proc) Could not convert to an explicit first order system due to 'RootOf'"

I couldnt find any useful information in the manual. What does this error mean? Is there something wrong with my maple code or is there just no solution for this particulare differential equation?

 

Thanks in advance

1 2 3 4 5 6 7 Page 1 of 8