Items tagged with numeric numeric Tagged Items Feed

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

Hi,

I am solving a system of differential equations with 2 variables. I can find numerical solution using dsolve with numeric option. I can also plot curves. But I also would like to extract data at time t0 and store into a file. I don't know how to extract numerical values from dsolve and store into a text file at various time, t0, t1, t2 etc. I would like to store data in tabular format with first, sceond and third columns are time, x and y respectively.

 

Just as an example, we can use

x'(t) = y(t), 

y'(t) = 6x(t) - y(t)

with x(0)=1 and y(0) = 2

 

Thanks.

Hello!

I am calculating the temperature of a rod which has one end at the temperature T1 and the other end at T2 and it's evolution. We were already given the formula for the numeric calculation and after a short while I managed to obtain a small program that would calculate the temperature of each segment of the T(x,t) grid:

>restart: with(plots): nx:=20: tmax:=50: T1:=1: T2:=10: L:=1: k:=1: rho:=1: cp:=1: chi:=k/rho/cp: h:=L/(nx-1): t:=1e-3:
>for k from 0 to nx do T(k,0):=T1 od:
for w from 1 to tmax do
T(0,w):=T1: T(nx,w):=T2:
for q from 1 to nx-1 do
T(q,w):=T(q,w-1)+chi*t/h^2*(T(q+1,w-1)+T(q-1,w-1)-2*T(q,w-1));
od: od:

With L the Length of the rod, t and h the time and space increment [h=L/(nx-1), where nx is the number of intervals we divide the x-axis, although I'm not quite sure the '-1' should be there], chi a constant different for each rod and tmax total time we want to calculate. The formula from the 5th line was given to us, so in that part there is no mistake.

Up until here everything works perfectly fine.

Now I want to be able to draw this and here is where all the problems appear. I want to draw this in a 2D graph with position in the x-axis and time in the y-axis. I have tried "densityplot(T(x,y),x=0..nx,y=0..tmax)" which would seem to be the logical whay to continue this. As I understand it, this plot would draw an nx times tmax grid and colour the whole plpot black-white acording to the maximum and the minimum value (as shown in the maple help page of this plot).

However, when I do this a black square appears (or red if I add colorstyle=HUE). I have tried a lot of things and none seemed to work.

I would also like to be able to draw the isotherms on the plot but that is secondary.

 

I am pretty new to Maple. I have studied the most basic things but don't really understand the whole complexity of this program. Thanks a lot in advance and forgive my faulty english,

Enrique

I have a system of PDEs with 3 dependent variables (U, V, W) and 3 independent variables (x, y, t).

I need an explicit numerical solution, i.e., a table with the values of U, V and W, corresponding to several values of x, y and t.

Can anybody help me?

 

Hello

I am trying to slve the second order differential equation with initial conditions  t0=0.dy/dt=0,y0=10000

-(diff(y, t, t))-9.81+0.563e-3*(0.1832e-2*abs(diff(y, t))+0.51702e-1*abs(diff(y, t))^(3/2)+.4*(diff(y, t))^2) = 0

using 4th order runge kutta.do i need to declare a step parameter like (D(y))(t) = u or is a command that can be applied automatically?

Thanks

 rk4.mw

I am trying to solve the folowing ODE with initial conditions t0=0,v0=0 and tf =80 with step 0.01 but the matrix that appears is not having the values!please help

f := proc (t, V) options operator, arrow; -9.81+0.563e-3*(0.1832e-2*abs(V)+0.51702e-1*(abs(V)^(3/2))+.4*V^2) end proc

V0 := 0:

t0 := 0:

tf := 80:

n := 1000

h := evalf((tf-t0)/n):

t := t0:

V := V0:

``

rk := proc (x0, tf, V0, n) local t, V, h, i, k1, k2, k3, k4, k, R; t := t0; V := V0; R := t, V; h := evalf((tf-t0)/n); for i to n do k1 := f(t, V); k2 := f(t+(1/2)*h, V+(1/2)*h*k1); k3 := f(t+(1/2)*h, V+(1/2)*h*k2); k4 := f(t+h, V+h*k3); k := (1/6)*k1+(1/3)*k2+(1/3)*k3+(1/6)*k4; V := V+h*k; t := t+h; R := R, t, V end do end proc:

R := rk(0, 80, 0, 300):

0, 0

 

.2666666667, -2.615998110

 

.5333333334, -5.231986045

 

.8000000001, -7.847954569

 

1.066666667, -10.46389463

 

1.333333334, -13.07979725

 

1.600000001, -15.69565351

 

1.866666668, -18.31145452

 

2.133333335, -20.92719143

 

2.400000002, -23.54285541

 

2.666666669, -26.15843764

 

2.933333336, -28.77392932

 

3.200000003, -31.38932166

 

3.466666670, -34.00460588

 

3.733333337, -36.61977321

 

4.000000004, -39.23481490

 

4.266666671, -41.84972219

 

4.533333338, -44.46448634

 

4.800000005, -47.07909861

 

5.066666672, -49.69355027

 

5.333333339, -52.30783259

 

5.600000006, -54.92193685

 

5.866666673, -57.53585433

 

6.133333340, -60.14957632

 

6.400000007, -62.76309410

 

6.666666674, -65.37639897

 

6.933333341, -67.98948223

 

7.200000008, -70.60233518

 

7.466666675, -73.21494912

 

7.733333342, -75.82731536

 

8.000000009, -78.43942520

 

8.266666676, -81.05126996

 

8.533333343, -83.66284095

 

8.800000010, -86.27412949

 

9.066666677, -88.88512689

 

9.333333344, -91.49582448

 

9.600000011, -94.10621358

 

9.866666678, -96.71628551

 

10.13333334, -99.32603160

 

10.40000001, -101.9354432

 

10.66666668, -104.5445116

 

10.93333335, -107.1532281

 

11.20000002, -109.7615841

 

11.46666669, -112.3695709

 

11.73333336, -114.9771799

 

12.00000003, -117.5844024

 

12.26666670, -120.1912297

 

12.53333337, -122.7976532

 

12.80000004, -125.4036642

 

13.06666671, -128.0092541

 

13.33333338, -130.6144142

 

13.60000005, -133.2191358

 

13.86666672, -135.8234103

 

14.13333339, -138.4272290

 

14.40000006, -141.0305833

 

14.66666673, -143.6334645

 

14.93333340, -146.2358640

 

15.20000007, -148.8377732

 

15.46666674, -151.4391834

 

15.73333341, -154.0400859

 

16.26666675, -159.2403334

 

16.53333342, -161.8396611

 

16.80000009, -164.4384465

 

17.06666676, -167.0366810

 

17.33333343, -169.6343560

 

17.60000010, -172.2314629

 

17.86666677, -174.8279930

 

18.13333344, -177.4239376

 

18.40000011, -180.0192882

 

18.66666678, -182.6140360

 

18.93333345, -185.2081725

 

19.20000012, -187.8016890

 

19.46666679, -190.3945769

 

19.73333346, -192.9868275

 

20.00000013, -195.5784322

 

20.26666680, -198.1693824

 

20.53333347, -200.7596694

 

20.80000014, -203.3492846

 

21.06666681, -205.9382194

 

21.33333348, -208.5264652

 

21.60000015, -211.1140133

 

21.86666682, -213.7008550

 

22.13333349, -216.2869818

 

22.40000016, -218.8723850

 

22.66666683, -221.4570560

 

22.93333350, -224.0409862

 

23.20000017, -226.6241669

 

23.46666684, -229.2065895

 

23.73333351, -231.7882454

 

24.00000018, -234.3691260

 

24.26666685, -236.9492226

 

24.53333352, -239.5285266

 

24.80000019, -242.1070294

 

25.06666686, -244.6847224

 

25.33333353, -247.2615969

 

25.60000020, -249.8376443

 

25.86666687, -252.4128560

 

26.13333354, -254.9872234

 

26.40000021, -257.5607378

 

26.66666688, -260.1333906

 

26.93333355, -262.7051732

 

27.20000022, -265.2760770

 

27.46666689, -267.8460934

 

27.73333356, -270.4152137

 

28.00000023, -272.9834293

 

28.26666690, -275.5507316

 

28.53333357, -278.1171120

 

28.80000024, -280.6825619

 

29.06666691, -283.2470726

 

29.33333358, -285.8106356

 

29.60000025, -288.3732422

 

29.86666692, -290.9348838

 

30.13333359, -293.4955517

 

30.40000026, -296.0552374

 

30.66666693, -298.6139322

 

30.93333360, -301.1716276

 

31.20000027, -303.7283149

 

31.46666694, -306.2839855

 

31.73333361, -308.8386307

 

32.00000028, -311.3922420

 

32.26666695, -313.9448108

 

32.53333362, -316.4963284

 

32.80000029, -319.0467862

 

33.06666696, -321.5961756

 

33.33333363, -324.1444880

 

33.60000030, -326.6917148

 

33.86666697, -329.2378474

 

34.13333364, -331.7828772

 

34.40000031, -334.3267955

 

34.66666698, -336.8695937

 

34.93333365, -339.4112633

 

35.20000032, -341.9517956

 

35.46666699, -344.4911820

 

35.73333366, -347.0294139

 

36.00000033, -349.5664827

 

36.26666700, -352.1023797

 

36.53333367, -354.6370964

 

36.80000034, -357.1706242

 

37.06666701, -359.7029544

 

37.33333368, -362.2340784

 

37.60000035, -364.7639877

 

37.86666702, -367.2926736

 

38.13333369, -369.8201275

 

38.40000036, -372.3463408

 

38.66666703, -374.8713049

 

38.93333370, -377.3950112

 

39.20000037, -379.9174511

 

39.46666704, -382.4386159

 

39.73333371, -384.9584971

 

40.00000038, -387.4770861

 

40.26666705, -389.9943742

 

40.53333372, -392.5103529

 

40.80000039, -395.0250135

 

41.06666706, -397.5383474

 

41.33333373, -400.0503461

 

41.60000040, -402.5610009

 

41.86666707, -405.0703032

 

42.13333374, -407.5782444

 

42.40000041, -410.0848159

 

42.66666708, -412.5900091

 

42.93333375, -415.0938154

 

43.20000042, -417.5962262

 

43.46666709, -420.0972329

 

43.73333376, -422.5968269

 

44.00000043, -425.0949996

 

44.26666710, -427.5917424

 

44.53333377, -430.0870466

 

44.80000044, -432.5809037

 

45.06666711, -435.0733051

 

45.33333378, -437.5642421

 

45.60000045, -440.0537062

 

45.86666712, -442.5416888

 

46.13333379, -445.0281812

 

46.40000046, -447.5131749

 

46.66666713, -449.9966612

 

46.93333380, -452.4786316

 

47.20000047, -454.9590775

 

47.46666714, -457.4379902

 

47.73333381, -459.9153612

 

48.00000048, -462.3911818

 

48.26666715, -464.8654435

 

48.53333382, -467.3381376

 

48.80000049, -469.8092556

 

49.06666716, -472.2787888

 

49.33333383, -474.7467287

 

49.60000050, -477.2130666

 

49.86666717, -479.6777940

 

50.13333384, -482.1409022

 

50.40000051, -484.6023827

 

50.66666718, -487.0622268

 

50.93333385, -489.5204260

 

51.20000052, -491.9769716

 

51.46666719, -494.4318551

 

51.73333386, -496.8850678

 

52.00000053, -499.3366012

 

52.26666720, -501.7864466

 

52.53333387, -504.2345955

 

52.80000054, -506.6810393

 

53.06666721, -509.1257693

 

53.33333388, -511.5687770

 

53.60000055, -514.0100537

 

53.86666722, -516.4495909

 

54.13333389, -518.8873800

 

54.40000056, -521.3234124

 

54.66666723, -523.7576794

 

54.93333390, -526.1901725

 

55.20000057, -528.6208831

 

55.46666724, -531.0498026

 

55.73333391, -533.4769224

 

56.00000058, -535.9022339

 

56.26666725, -538.3257285

 

56.53333392, -540.7473976

 

56.80000059, -543.1672326

 

57.06666726, -545.5852249

 

57.33333393, -548.0013659

 

57.60000060, -550.4156470

 

57.86666727, -552.8280597

 

58.13333394, -555.2385953

 

58.40000061, -557.6472452

 

58.66666728, -560.0540009

 

58.93333395, -562.4588537

 

59.20000062, -564.8617951

 

59.46666729, -567.2628164

 

59.73333396, -569.6619091

 

60.00000063, -572.0590645

 

60.26666730, -574.4542741

 

60.53333397, -576.8475293

 

60.80000064, -579.2388215

 

61.06666731, -581.6281420

 

61.33333398, -584.0154823

 

61.60000065, -586.4008338

 

61.86666732, -588.7841879

 

62.13333399, -591.1655361

 

62.40000066, -593.5448697

 

62.66666733, -595.9221801

 

62.93333400, -598.2974587

 

63.20000067, -600.6706970

 

63.46666734, -603.0418863

 

63.73333401, -605.4110181

 

64.00000068, -607.7780837

 

64.26666735, -610.1430746

 

64.53333402, -612.5059822

 

64.80000069, -614.8667979

 

65.06666736, -617.2255130

 

65.33333403, -619.5821190

 

65.60000070, -621.9366073

 

65.86666737, -624.2889694

 

66.13333404, -626.6391966

 

66.40000071, -628.9872803

 

66.66666738, -631.3332119

 

66.93333405, -633.6769829

 

67.20000072, -636.0185846

 

67.46666739, -638.3580085

 

67.73333406, -640.6952460

 

68.00000073, -643.0302885

 

68.26666740, -645.3631274

 

68.53333407, -647.6937540

 

68.80000074, -650.0221599

 

69.06666741, -652.3483364

 

69.33333408, -654.6722749

 

69.60000075, -656.9939668

 

69.86666742, -659.3134036

 

70.13333409, -661.6305766

 

70.40000076, -663.9454773

 

70.66666743, -666.2580971

 

70.93333410, -668.5684273

 

71.20000077, -670.8764594

 

71.46666744, -673.1821848

 

71.73333411, -675.4855950

 

72.00000078, -677.7866813

 

72.26666745, -680.0854351

 

72.53333412, -682.3818479

 

72.80000079, -684.6759110

 

73.06666746, -686.9676159

 

73.33333413, -689.2569539

 

73.60000080, -691.5439165

 

73.86666747, -693.8284951

 

74.13333414, -696.1106811

 

74.40000081, -698.3904660

 

74.66666748, -700.6678411

 

74.93333415, -702.9427978

 

75.20000082, -705.2153276

 

75.46666749, -707.4854218

 

75.73333416, -709.7530719

 

76.00000083, -712.0182693

 

76.26666750, -714.2810054

 

76.53333417, -716.5412716

 

76.80000084, -718.7990593

 

77.06666751, -721.0543600

 

77.33333418, -723.3071650

 

77.60000085, -725.5574658

 

77.86666752, -727.8052537

 

78.13333419, -730.0505202

 

78.40000086, -732.2932567

 

78.66666753, -734.5334546

 

78.93333420, -736.7711053

 

79.73333421, -743.4686884

 

``

 

 

Download runge_kutta4.mw

Leading on from this post I made before:

http://www.mapleprimes.com/questions/210359-Integrating-Very-Large-Sums

I have a script that can now integrate larger sums thanks to the tips I was given. I now have a question regarding cpu usage when the calculation is run through a loop. I have attached two files. One contains the sum (large_sum.txt) which is then read in to the main Maple script (large_sum_int.mw).

When the loop is run, the first few points are calculated quite consistently with very similar cpu times. However, as the calculation progresses the cpu time suddenly increases (with larger sums than the one given it is a very severe increase) it then decreases again and returns to the time it took for the initial points to be calculated.

Is there a reason there is a sticking point in this calculation? is there a more efficient way to simplify it before it reaches the integration stage? When using simplify(...,size) the initial block takes a very long time to execute hence is not included here. This is not the largest sum that needs to be processed so I am looking for means to speed up calculation time/make it more consistent.

Any help is appreciated

large_sum.txt

large_sum_int.mw

-Yeti

Dear All

I have an numerical integral to solve over set of 10 discrete values. The problem is, this integral have two dependent variables. Please see following:

Numerical_Integration.mw

How to Solve following integral numerically over discrete data values?

I[k] = int(rho(x)*x^4*eta[k](x)^2, x)

I[k] = int(rho(x)*x^4*eta[k](x)^2, x)

(1)

where we have data values are given as under

x=1, 2, 3, 4, 5, 6, 7, 8, 9, 10

rho(x)= 0.045, 0.0459, 0.0564, 0.05689, 0.06015, 0.06235, 0.0654, 0.0687, 0.07012, 0.07251

eta[k](x)= 1.15, 1.256, 1.56, 1.85, 1.86, 2.01, 2.35, 2.56, 2.86, 2.901

 

Download Numerical_Integration.mw

Regards

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