# Items tagged with numericalnumerical Tagged Items Feed

### Finding zeroes of a numerical solution of an ODE i...

April 22 2014
2 4

I have numerically solved a system of ODEs and plotted the graphs of a[j](t) for each j=0..21.

It was clear from the picture that each a[j] has a unique zero. Is there a maple command to

locate these zeroes?

### comparison numerical and analytic...

April 05 2014
1 11

Dear all;

Please how can I plot the error between the two function.

### plot numerical solution explicite schemae...

March 25 2014
0 1

Dear All, I need your help to plot the numerical solution. many thanks.

The variable t in [0,T], x in [0,1], b in [0,2].

Difference finie for waves equation is :

pde:=diff(u(x, y,t), t$2) = c^2*(diff(u(x, y,t),x$2)+diff(u(x,y,t),y$2)); i: according to x, j according to y, and k according to t. u[i,j,k+1]=2*u[i,j,k]-u[i,j,k-1]+(c*dt/dx)^2*(u[i-1,j,k]-2*u[i,j,k]+u[i+1,j,k])+ (c*dt/dy)^2*(u[i,j-1,k]-2*u[i,j,k]+u[i,j+1,k]) Boundary condition: u(t=0)=1, diff(u(x,y,t),t=0)=0, and the normal derivative on the boundary of Omega =0. How can solve this problem and plot the numerical solution. ### Numerical integration... March 21 2014 1 4 I am trying to numerically evaluate the following integral $\int_{-1}^0\int_{-\infty}^y&space;e^{10(-2y^2+y^4)}e^{-10(-2z^2+z^4)}dzdy$ 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? ### Order of error ... March 17 2014 0 2 HI. I need your remarks in this problem. I have ode. diff(y(x),x)=f(x,y); x in [0,a]; h:=a/(2*N); stepsize. When the the true solution is not Known, we can test the rate of convergence, of numerical solution. The Numerical solution generated when the stepsize is 2*h denoted by y_i^(2h) and the numerical solution with step size h will be denoted by y_i^(h). if we define the epsilon(h):=sqrt ( 1/(N+1)*add( (y_i^(2h) -y_(2i)^(h) )^2, i=0..N)); If we useForward Euler ( it's Known that the golbal error isof order 1 and local error of order 2) in the case when the exact solution is know. But, If we use epsilon(h), and for the same method can some one know the order of Error =h^?????. Thank you. ### how do i solve a nonlinear differential equation i... March 10 2014 2 2 hi, I am new here I want to solve these toe coupled equations with the following boundary condition numerically: 1) diff(f(eta),eta$3)+(1)/(2)*f(eta)*diff(f(eta),eta$2)-xi*(2*f(eta)*(diff(f(eta),eta))* (diff(f(eta),eta,eta))+f(eta)^2*(diff(f(eta),eta,eta,eta))+eta*(diff(f(eta),eta))^2*(diff(f(eta),eta$2)))-K*

(diff(f(eta),eta)-1)=0

2)   diff(theta(eta),eta,eta)+(1)/(2)*Pr*f(eta)*(diff(theta(eta),eta))=0

boundary conditions: 1)  f(0) = 0   2)  D(f)(0) = 0   3)  D(f)(infinity=10) = 1

1) theta(infinity=10) = 1      2) theta(0)=0

xi=0.2 ... 1    K=0.2     pr=0.7

### Deviation between solve and fsolve ...

March 03 2014
1 3

Dear All,

I analyzed some example of linear equation systems and tried to distinguish the difference between the solve and fsolve in these cases.

1. In general case, the deviation between solve and fsolve is less than 10^-8, for example:

But, in some case, the deviation is more than 10^-7, for example:

how to reduce the error of solving the problem by fsolve?

2. It seems that solve will automatically translate the answer into numerical result while the system is composed with decimals, for example, we redo the second case with no decimals:

Is it possible to get the exact solution while the decimal is involved in the system?

The related file is attached. I'd appreciate any help on this topic. Thank a lot.

solve_and_fsolve.mw

### differential equations +plot scale...

March 02 2014
0 1

Hell

I write this code and didn't work , I have some erorrs as

Warning, The use of global variables in numerical ODE problems is deprecated, and will be removed in a future release. Use the 'parameters' argument instead (see ?dsolve,numeric,parameters)
Warning, cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up

also I have question " How I can change the scale of plot"

parameters := [z = 0, Omega = 2.2758, tau = 13.8, T2 = 200, omega0 = 1, r = .7071, s = 2.2758, H = 1.05457173*10^(-34), omega = .5, k = 1666666.667, Delta = 1.7758]

sys1 := {diff(u(t), t) = s*v(t)-u(t)/T2, diff(v(t), t) = -s*u(t)-2*Omega*exp(-r^2/omega0^2-t^2*1.177^2/tau^2)*cos(kz-&omega;t)*w(t)-v(t)/T2, diff(w(t), t) = 2*Omega*exp(-r^2/omega0^2-t^2*1.177^2/tau^2)*cos(kz-&omega;t)*v(t)}; ICs1 := {u(-20) = 0, v(-20) = 0, w(-20) = -1}

ans1 := dsolve(union(eval(sys1, parameters), ICs1), numeric, output = listprocedure); plots:-odeplot(ans1, [[t, u(t)], [t, v(t)], [t, w(t)]], t = -20 .. 20, legend = [w, v, u])

U := eval(u(t), ans1); F := eval(((-2*10^33*Omega*H*r*U(t))*(1/omega0^2))*exp(-r^2/omega0^2-t^2*1.177^2/tau^2)*cos(kz-&omega;t), parameters)

plot(F, t = -20 .. 20)

### Using numerical sol of ODE in another ODE...

February 19 2014
0 2

Say we solve numerically and ODE using Maple. Say ode1:= { diff(Q(x),x)= Q(x)/3x , Q(1)=1 }

The solution is a procedure so now suppose we have another ODE where the solution appears.Say  ode2:= { diff(f(x),x)= Q(x)*x , f(1)=4}.

To extract the solution of the first ODE I set sol1:=dsolve(ode1,numeric) and Q:=proc(x) local s: return rhs(sol(x)[2]): end proc:

But now I got an error message when I trying sol2:=dsolve(ode2,numeric).

Is it possible to use a procedure in the definition of the ODE one wants to solve?

### Should Maple be able to numerically integrate this...

February 12 2014
3 6

I'm trying to numerically calculate the following:

int(e^(-1.5*t)/sqrt(t*(t+1)), t = 1 .. infinity)

But Maple can't do it.

I then made it a lot simpler and tried to calculate the following:

evalf(int ((e^(-t)), t=1..infinity));

Thats just e^(-t), integrated from t=1 to t=infinity.

Maple just gives me back the original equation in the first case, and in the second gives me a limit that I can see has a numerical answer, but Maple can't. Is this something Maple should be able to do and I'm just now pushing the right buttons? I'm using Maple 12, which I know is old and limited, but these really aren't very complicated numerical integrations.

### not converge by newton method in maple...

February 01 2014
0 2

hi, I am new here I want to solve these toe coupled equations with the following boundary condition numerically:

1)  diff(f(eta),eta$3)+(1)/(2)*f(eta)*diff(f(eta),eta$2)-Pe*(2*f(eta)*(diff(f(eta),eta))*

(diff(f(eta),eta,eta))+f(eta)^2*(diff(f(eta),eta,eta,eta))+eta*(diff(f(eta),eta))^2*(diff(f(eta),eta$2)))-K* (diff(f(eta),eta)-1)=0 2) diff(theta(eta),eta,eta)+(1)/(2)*Pr*f(eta)*(diff(theta(eta),eta))=0 boundary conditions: 1) f(0) = 0 2) D(f)(0) = 0 3) D(f)(infinity=8) = 1 1) theta(infinity=8) = 1 2) theta(0)=0 Pe=0.1..1 K=0.2,0.5 Pr=0.7 ### Numerical Integration... January 09 2014 2 32 Hello. Could not evaluate numerical integral with constant in it. I use method = _cuhre. Maple print solution like this: Int(Int(Int(max(0., (0.9483573506e-3*(-1.*sin(a)*cos(w)-1.*cos(a)*sin(w)*sin(b)))*cos(a)*cos(b)^2*(-58.5*signum(cos(b)*sin(w)*sin(b))*kk+200.*cos(b)*sin(w)*sin(b))*Heaviside(-58.5+200.*cos(b)*sin(w)*sin(b)*signum(cos(b)*sin(w)*sin(b))*kk)*Heaviside(1.-.98*cos(b)^2)/sqrt(1.-.98*cos(b)^2)), a = 0. .. 6.283185308), b = 0. .. 1.570796327), w = 0. .. 6.283185308)+Int(Int(Int(min(0., (0.9483573506e-3*(-1.*sin(a)*cos(w)-1.*cos(a)*sin(w)*sin(b)))*cos(a)*cos(b)^2*(-58.5*signum(cos(b)*sin(w)*sin(b))*kk+200.*cos(b)*sin(w)*sin(b))*Heaviside(-58.5+200.*cos(b)*sin(w)*sin(b)*signum(cos(b)*sin(w)*sin(b))*kk)*Heaviside(1.-.98*cos(b)^2)/sqrt(1.-.98*cos(b)^2)), a = 0. .. 6.283185308), b = 0. .. 1.570796327), w = 0. .. 6.283185308) How could it be taken. Thank!!! ### How do I plot multiple pde numerical solutions on ... December 30 2013 1 2 Please, I solved a pde system of equation problem numerically, using maple 17. But I dont know how to plot multiple solutions on one graph. I want to vary one of the parameters.... e.g Pr=0.71, Pr=7, Pr=10 where other parameters are kept constant My working is attachedtobi_msc_solution.mw  (1) Download tobi_msc_solution.mw Please, Any help will be gracefully appreciated ### How to solve nonlinear equation numerically in Map... December 20 2013 1 3 restart; diffeq := diff(w(r), $(r, 1))+2*beta*(diff(w(r), \$(r, 1)))^3-(1/2)*S*(r-m^2/r) = 0;

con := w(1) = 1;

ODE := {con, diffeq};

sol := dsolve(ODE, w(r), type = numeric);

How can i have numerical solution of the above differential equation with corresponding boundary condition?

### Events in dsolve...

December 16 2013
1 5

Hi

I  have a system of second order differential equation to be solved numerically. I would like to set up events to halt integration  to find the values of phi when r(phi)=2/3 . Here is my code

DE:=diff(1/r(phi),phi,phi)+(1/r(phi))=(G*M/h^2)+(3*G*M/c^2*r(phi)^2));

ics:=r(0)=2/3,D(r)(0)=0;G:=1;M:=1;h:=1;c:=1;

p:=dsolve({DE,ics},numeric,events=[[r(phi),r(phi),halt]],[diff(r(phi),phi)=0,halt]]);

The code only works for the second event so it halts for r(phi)=1.63... etc

How do i stop this?

Thanks for any help.

 1 2 3 4 5 6 Page 1 of 6
﻿