Items tagged with numerical numerical Tagged Items Feed

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

Dear all, I have been trying to use Runge-Kutta method to plot an approximate solution with the following code. However, although I can get the numerical approximation the plot would not show.

h := .1;

x[0] := 0;

y[0] := 1;

xf := 3;

n := floor(xf/h)

f:= (x,y)->1/(3 y-x-2)

x := x[0]

y := y[0]

for i to n do

k1 := f(x, y);

k2 := f(x+(1/2)*h, y+(1/2)*h*k1);

k3 := f(x+(1/2)*h, y+(1/2)*h*k2);

k4 := f(x+h, h*k3+y);

k := (k1+2*k2+2*k3+k4)*(1/6);

y := h*k+y;

x := x+h

end do;

y[n]

data := [seq([x[n], y[n]], n = 0 .. 30)];

p[2] := plot(data, style = point, color = blue);

p[3] := plot(data, style = line, color = blue);
display(seq(p[n], n = 2 .. 3));

Please I need someone to help out with how to solve the below ODE numerically using finite difference method with the necessary maple code:

 

█( S〗_h〗^' (t)=Λ_h-αβ_m I_v S_h-μ_h S_h+πI_m,  

〖I_m〗^' (t)=αβ_m I_v S_h-(σ_m+π+μ_h ) I_m

〖 S〗_v〗^' (t)=Λ_v-αβ_v I_m S_v-μ_v S_v

〖I_v〗^' (t)=αβ_v I_m S_v-μ_v I_v )

The initial conditions can be assumed. Suppose i want to include controls, how do I solve the problem and equally plot the graph.

 

Thank you.

ADENIYI MICHAEL

 

I am numerically solving a nonlinear system of nine equations. How long can I expect it to take?

I have run it for 30 minutes and it has not solved yet.

Here is the system of equations:

0=Lambda-mu.*S-beta.*(H+C+C1+C2).*(S./N)-tau.*(T+C).*(S./N);

0=tau.*(T+C).*(S./N)-beta.*(H+C+C1+C2).*(T./N)-(mu+mu_T).*T;

0=beta.*(H+C+C1+C2).*(S./N)-tau.*(T+C).*(H./N)-(mu+mu_A).*H;

0=beta.*(H+C+C1+C2).*(T./N)+tau.*(T+C).*(H./N)-(mu+psi.*mu_A+mu_T+lambda_T).*C;

0=lambda_T.*C-(mu+mu_A+rho_1+eta_1).*C1;

0=rho_1.*C1-(mu+mu_A+rho_2+eta_2).*C2;

0=eta_1.*C1-(mu+rho_1+gamma).*CT1;

0=eta_2.*C2-(mu+rho_2+gamma.*(rho_1)./(rho_1+rho_2)).*CT2+(rho_1).*CT1;

0 = N - S - T - H - C - C1 - C2 - CT1 - CT2;

and I have numeric values for Lambda, beta, tau, mu, mu_T, mu_A, rho_1, rho_2, psi, gamma. The only parameters left are eta_1, eta_2.

Thank you.

Hi,

I have been trying to solve 2D Diffusion Equation with zero Neumann BC over the unit disk. If I use Gaussian type function with a sharp peak as initial condition, I get huge errors between initial values. Let's say u(r,phi,t) is the solution of the PDE and f(r,phi) is initial value function. The expectation is for the point (r*,phi*) ,  u(r*,phi*,0)=f(r*,phi*), but it is not.

Is Numerical integration in Maple not able to handle such sharp peak? I tried some of the built-in methods such as MonteCarlo,CubaVegas but no difference.

It might be a good idea to specify some nodes arround the peak. There is a command called "peaks", but I could not use it, error message says "invalid arguments".

Thanks in advance.

Soln_2D_Gaussian.mw

Hello,

I wanted to get the following function integrated with Maple 17:

I used the following command to get a numerical solution for my choise of limits:

Unfortunately, I just get the Integral itself back. Also, taking pi/2 as the upper limit for x does improve anything. I also tried the AllSolutions option but it does not help as well as first trying to integrate only over y and leaving x as it is in order to get at least one integration done.

I hope someone can help. I do not necessarily need to solve it for myself, so if someone gets the result and posts it here, I'm okay with that. Anyway, being able to calculate it myself would be even better.

See AAAA.mw

The alpha and beta are 'randomly' chosen, both >0, to produce some values, hence a value for the target function to optimize.

I am having trouble to evaluate the expression in the middle of the calculation.

Sometimes, the 'chosen' alpha and beta works fine with 'method = _d01amc' for numerical integration. and such way is really "fast".

 

But sometimes, the the 'chosen' alpha and beta will fail. Even when both of them are perfectly defined. and the integral can be easily evaluated using Int() and then evalf().

 

So what's be best way to proceed?

Thanks,

casperyc

1 2 3 4 5 6 7 Page 1 of 8