Items tagged with numeric numeric Tagged Items Feed

Hello everybody.

I'm trying to obtain the numerical solution of a differential equation. Unfortunately, this prove to be quite challenging. I was able to obtain a rough solution using mathematica, but nothing more. The function is strictly increasing (for sure).

Any help is really REALLY appreciated, thanks!

 

``

deq1 := 1/(b-f(b)) = (2*(3-(1-f(b)*(diff(f(b), b, b)))/((diff(f(b), b))*(diff(f(b), b)))))/(1-2*(b-(1-f(b))/(diff(f(b), b))))

1/(b-f(b)) = 2*(3-(1-f(b)*(diff(diff(f(b), b), b)))/(diff(f(b), b))^2)/(1-2*b+2*(1-f(b))/(diff(f(b), b)))

(1)

ic1 := eval(f(b), b = 3/8) = 0, eval(f(b), b = 1/2) = 1/2

f(3/8) = 0, f(1/2) = 1/2

(2)

digits := 3

3

(3)

dsol1 := dsolve({deq1, ic1}, method = bvp[middefer], numeric, range = 3/8 .. 1/2)

Error, (in dsolve/numeric/bvp) initial Newton iteration is not converging

 

``

 

Download diffeqn.mw

How can i over come convergence error, i am unable to apply approxsoln appropriately and continouation as well. regards

N := 5;

-(1/2)*Pr*n*x*(diff(f(x), x))*(diff(theta(x), x))-(1/2)*Pr*(n+1)*f(x)*(diff(theta(x), x))-(1/2)*(n+1)*(diff(diff(theta(x), x), x))+Pr*gamma*((1/4)*(n^2-3*n+3)*x^2*(diff(f(x), x))*(diff(diff(f(x), x), x))*(diff(theta(x), x))+(1/4)*(2*n^2+5*n+3)*f(x)*(diff(f(x), x))*(diff(theta(x), x))+(1/4)*n(n+1)*x*f(x)*(diff(diff(f(x), x), x))*(diff(theta(x), x))+(1/4)*(2*n^2+3*n-3)*x*(diff(f(x), x))^2*(diff(theta(x), x))+(1/4)*(n-1)*x^2*(diff(diff(f(x), x), x))*(diff(theta(x), x))+(1/2)*n*(n+1)*x*f(x)*(diff(f(x), x))*(diff(diff(theta(x), x), x))+(1/4)*(n^2-1)*(diff(f(x), x))^2*(diff(theta(x), x))+(1/4)*(n+1)^2*f(x)^2*(diff(diff(theta(x), x), x))+(1/4)*(n-1)^2*x^2*(diff(f(x), x))^2*(diff(diff(theta(x), x), x))) = 0

(1)

bc := (D(theta))(0) = -Bi*(1-theta(0)), theta(N) = 0, f(0) = 0, (D(f))(0) = 0, (D(f))(N) = 1;

(D(theta))(0) = -Bi*(1-theta(0)), theta(5) = 0, f(0) = 0, (D(f))(0) = 0, (D(f))(5) = 1

(2)

a1 := dsolve(subs(beta = .1, n = .5, Pr = 10, gamma = .1, Bi = 50, {bc, eq1, eq2}), numeric, method = bvp[midrich], abserr = 10^(-8), output = array([seq(.1*i, i = 0 .. 10*N)]))

Error, (in dsolve/numeric/BVPSolve) initial Newton iteration is not converging

 

``

 

Download ehtasham.mwehtasham.mw

i have attcahed my ode with complex bvp

can anyone solved mine

NULL

restart

with(plots):

NULL

Eq1 := (11-10*d)*(diff(h(eta), eta))+2*f(eta) = 0;

(11-10*d)*(diff(h(eta), eta))+2*f(eta) = 0

 

(11-10*d)*(diff(diff(f(eta), eta), eta))-h(eta)*(diff(f(eta), eta))-f(eta)^2+g(eta)^2 = 0

 

diff(diff(g(eta), eta), eta)-h(eta)*(diff(g(eta), eta))-2*f(eta)*g(eta) = 0

 

diff(p(eta), eta)+2*(diff(f(eta), eta))-2*f(eta)*h(eta) = 0

(1)

NULL

NULL

`Vλ` := [0.5e-1, 1.5, 1.5]:

etainf := 3:

bcs := h(0) = 0, p(0) = 0, (D(f))(0) = lambda*f(0)^(4/3)/(f(0)^2+(1-g(0))^2)^(1/3), (D(g))(0) = -Typesetting:-delayDotProduct(lambda*f(0)^(1/3)*(1-g(0)), 1/(f(0)^2+(1-g(0))^2)^(1/3)), f(etainf) = 0, g(etainf) = 0;

h(0) = 0, p(0) = 0, (D(f))(0) = lambda*f(0)^(4/3)/(f(0)^2+(1-g(0))^2)^(1/3), (D(g))(0) = -f(0)^(1/3)*(1-g(0))*lambda/(f(0)^2+(1-g(0))^2)^(1/3), f(3) = 0, g(3) = 0

(2)

NULL

dsys := {Eq1, Eq2, Eq3, Eq4, bcs}:

for i to 3 do lambda := `Vλ`[i]; dsol[i] := dsolve(dsys, numeric, continuation = d); print(lambda); print(dsol[i](0)) end do

Error, (in dsolve/numeric/bvp) singularity encountered

 

NULL

NULL

NULL

 

Download compre1.mw

and attch back

Hi there, fellow primers, it's good to be back after almost 5 years! I just want to share a worksheet on Numerov's algorithm in Maple using procedures as I've recently found out that google could not find any Maple procedure that implements Numerov's algorithm to solve ODEs.   numerov.mw   Reference.pdf 

Hi,
I want to plot stream lines from a stream function given by " psi = x*f(eta)+int(h(s), s = 0 .. eta) " where "f(eta)" and "h(eta)" are the solution of the differential equation given below:

restart;
with(linalg);
Digits := 24;

eq1:=diff(f(eta),eta,eta,eta)+f(eta)*diff(f(eta),eta,eta)-(diff(f(eta),eta))^2+1;
eq2 := diff(h(eta),eta,eta)+f(eta)*diff(h(eta),eta)-diff(f(eta),eta)*h(eta);
bc:=f(0)=0,D(f)(0)=0,D(f)(6)=1,h(0)=0,D(h)(6)=1;
A1:=dsolve({eq1,eq2,bc},numeric,method=bvp[midrich],abserr = 1.*10^(-10),output=operator):

How can I do this?

I'm trying to plot the varying results to a second degree differential function with different values for one constant in one graph. Here is what I have so far, which is already working.

______________________________________________________________________

> with(plots);
> m := 0.46e-1; d := 0.42e-1; v := 60; alpha0 := convert(12*degrees, radians); g := 9.81; pa := 1.205; cd := .2; n := 4000; omega := 2*Pi*(1/60);
                           
> p := 6*m/(Pi*d^3);
                           
> k1 := (3/4)*cd*pa/(d*p); k2 := (3/8)*omega*n*pa/p;
                  
> gl1 := vx(t) = diff(x(t), t);
                          
> gl2 := vy(t) = diff(y(t), t);
                     
> gl3 := diff(vx(t), t) = -k1*vx(t)*(vx(t)^2+vy(t)^2)^(1/2)-k2*vy(t);
       
> gl4 := diff(vy(t), t) = -g-k1*vy(t)*(vx(t)^2+vy(t)^2)^(1/2)+k2*vx(t);
 
> init1 := x(0) = 0;
> init2 := y(0) = 0;
> init3 := vx(0) = v*cos(alpha0);
> init4 := vy(0) = v*sin(alpha0);
> sol := dsolve({gl1, gl2, gl3, gl4, init1, init2, init3, init4}, {vx(t), vy(t), x(t), y(t)}, type = numeric);

> sol(.5);
> odeplot(sol, [x(t), y(t)], t = 0 .. 6.7);

______________________________________
What I'd like to do now is, for example, plot the solutions in one graph (preferably as a gif) for when n=1500, n=3000, n=4500 etc. Is there a simple way to achieve this? I've tried various methods so far without success.

Hi

Dear friends

I use the command "dsolve(`union`(deq, initial), numeric, method = lsode)" for solving a fourth order ODE.

But for some numerical values of the parameters the bellow error is occurred:

" an excessive amount of work (greater than mxstep) was done ".

I have three questions:

1- how can I increase the mxstep from default amount (i.e. 500) to a greater value?

2- how can I ensure that the absolute error is less than 10E-6?

3- when I use lsode which way of numerical solution is applied (Euler,midpoint, rk3, rk4, rkf, heun, ... )?

 

Thanks a lot for your help

I'm trying to solve a 2nd order system of pde's with couplded BC but it gives me the following error

Error, (in pdsolve/numeric) initial/boundary conditions must be defined at one or two points for each independent variable

Here is the code

> T01 := 273; T02 := 26; L1 := .1; L2 := .2; h1 := 100; h2 := 200; k1 := 1; k2 := 2; rho1 := 1000; rho2 := 2000; c1 := 0.1e6; c2 := 0.2e6; alpha1 := 1; alpha2 := 2

> PDE := {diff(T1(x, t), t) = (diff(T1(x, t), x, x))/alpha1, diff(T2(x, t), t) = (diff(T2(x, t), x, x))/alpha2}

> IBC:={k1*(D[1](T1))(L1, t) = k2*(D[1](T2))(L1, t), T1(L1, t) = T2(L1, t), T1(x, 0) = T02, T2(x, 0) = T02, (D[1](T1))(0, t) = -h1*(T1(0, t)-T01)/k1, (D[1](T2))(L1+L2, t) = h2*(T2(L1+L2, t)-T02)/k2}

> pds := pdsolve(PDE, IBC, numeric)

Its basically a 1D heat equation in a 2 layers plate with conduction BC on both sides

solarsysem.mw Sorry for the repost but this is my newest document.

I have to create a solar system model on maple by defining a force equation then using the seq function to create a diffeq and then solving those differential equations using the initial conditions with the sun at (0, 0, 0) in xyz coordinates.

It works until my last "ic1" entry and I get an error in dsolve/numeric/process_input

I'm pretty desperate, I'll appreciate any help I can get

 

 

 

 

I read in the net that the method used in pdsolve numeric is the theta method, my question: is it the most efficient with regard to rate of convergence of the numerical solution of the PDE?

If not then why is it used as the default method?

 

Thanks.

 

I want to solve system of non linear odes numerically.

I encounter following error

Error, (in dsolve/numeric/bvp) cannot determine a suitable initial profile, please specify an approximate initial solution

how to correct it

regards

Hi All, 

 

I'm trying to numerically solve a differential equation which has a numeric function in it. 

For example, consider the function f. 

f:=(r)-> evalf(Int( <some messy function>, <some range>)) ;  <- This can be solved numerically and returns an answer quickly. i.e

f(23) gives 102;

 

Now, I want to numericaly solve something like.

Eq:= diff(p(r),r,r) + diff(p(r),r) - f(p(r));

ICS:=D(p)(0.001)=0, p(0.001) = 3

dsolve({Eq,ICS},numeric).

dsolve will not attempt to solve it due to the numeric integration in f. Is there a way I can just use numeric techniques to solve this kind of problem?

Thanks in advance.  

hi.i calculate this integral numerically but after use this result in my differential equation which is involve f3(x), i enconter with error

i found that this problem is due to answer of this integtal.may i use another way to calculte it?as shown power in result are very large!!!

``

restart; Digits := 15; g3 := theta^2*(theta-1)^2; beta := 100; chi := 5; kappa := 5; a := 0

0

(1)

with(Student[Calculus1]); -1; a31 := evalf(ApproximateInt(-beta^2*g3/((1-g3*f3(x))*ln(2*kappa*(1-g3*f3(x)))^2), theta = a .. 1, method = simpson)); -1; a32 := evalf(ApproximateInt(-chi*g3/(1-g3*f3(x))^4, theta = a .. 1, method = simpson))

-1.33333333333333*(-0.191597582462488e152*f3(x)-0.863011826221205e146*f3(x)^9-0.706378636532818e148*f3(x)^7+0.846944805095211e147*f3(x)^8+0.130151241709538e151*f3(x)^4-0.283379399043279e150*f3(x)^5+0.493554199542613e149*f3(x)^6+0.117104095781373e152*f3(x)^2-0.459581479474515e151*f3(x)^3+0.151119505345015e152+0.755561753647024e145*f3(x)^10+0.175123383079432e97*f3(x)^36-0.244416009548583e100*f3(x)^35+0.163803382818292e103*f3(x)^34-0.704973843312161e105*f3(x)^33+0.219681545650952e108*f3(x)^32-0.529211072065593e110*f3(x)^31+0.102639576866076e113*f3(x)^30-0.164658103849427e115*f3(x)^29+0.222629381398692e117*f3(x)^28-0.257124576224432e119*f3(x)^27+0.256176429040311e121*f3(x)^26-0.221804182616290e123*f3(x)^25+0.167834727658308e125*f3(x)^24-0.111474607475097e127*f3(x)^23+0.652137994527267e128*f3(x)^22-0.336921770775584e130*f3(x)^21+0.154034904897255e132*f3(x)^20-0.624063631993155e133*f3(x)^19+0.224251041670249e135*f3(x)^18-0.714943093769717e136*f3(x)^17+0.202175772822691e138*f3(x)^16-0.506683948932158e139*f3(x)^15+0.112368506172683e141*f3(x)^14-0.220033360070981e142*f3(x)^13+0.379271084508473e143*f3(x)^12-0.573179869691401e144*f3(x)^11)/((-160000.+9801.*f3(x))^4*(-16.+f3(x))^4*(-256.+9.*f3(x))^4*(-10000.+441.*f3(x))^4*(-160000.+8281.*f3(x))^4*(-625.+36.*f3(x))^4*(-160000.+361.*f3(x))^4*(-10000.+81.*f3(x))^4*(-160000.+2601.*f3(x))^4*(-625.+16.*f3(x))^4)

(2)

``

 

Download integral.mwintegral.mw

thanks..

I have written a code which generates a Gaussian like curve as a set of points and have written some basic commands to find several important quantities from the plot. The three of importance here are the peak position, peak height and Full Width at Half Maximum.

See the attached minimal working example maple worksheet.

It can find the peak position and the peak height no problem, but another quantity I want it to find is the Full Width at Half Maximum (FWHM). I use the aforementioned calculated values to find the left and right components of the FWHM but the fsolve command just hangs.

In the worksheet this is not evident but in the much longer full code which I run through the terminal and prints the values to a file, it begins the fsolve command and reaches a particular value and it just hangs. No amount of waiting time makes it continue the calculation.

However if I use an approximate integration scheme (such as Riemann sums) then the fsolve part executed perfectly. fslove seems to get stuck during the numerical integration step.

There is probably an easy answer to this problem which I am missing. Any help is appreciated.

fsolve_numerical_integration.mw

 

- Yeti

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