Items tagged with ode ode Tagged Items Feed

Hello,

 

I have a complex set of non linear diff eqns in the form :

y1'' = f(y1',y1,y2'',y2',y2,y3'',y3',y3,y4'',....,y6'',y6',y6,u1,u2,u3,u4) ;

y2'' = f(y1'',y1',y1,y2',y2,y3'',y3',y3,y4'',....,y6'',y6',y6,u1,u2,u3,u4)

and so on ... y6''=(...)

As I want to resolve this coupled systeme in matlab using @ODE45... I wanted the equations in the form : y1''=f(y1',y1,y2',y2,....) and so on ... => X'[] = f(X[],U[])

 

How can I force maple to rearrange a system of coupled eqns with only the variables i want ?

 

I know this is possible beacause it is a nonlinear state space model but maple do not work with nonlinear state space model... It give me error when I tried to create statespace model with my non linear diff eqns.

 

Thanks a lot !

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

 

 

 

 

Dear all

I have the following equaion

Eq := diff(phi(x, k), x, x)+(k^2+2*sech(x))*phi(x, k) = 0;
          
The solution is given by 

phi := (I*k-tanh(x))*exp(I*k*x)/(I*k-1);

My question : At what value of k is there a bound state and in this case can we give a simple form of the solution phi(x,k)

 

With best regards

 

Dear Maple researchers

 

I have a problem in solving a system of odes that resulted from discretizing, in space variable, method of lines (MOL).

The basic idea of this code is constructed from the following paper:

http://www.sciencedirect.com/science/article/pii/S0096300313008060

If kindly is possible, please tell me whas the solution of this problem.

With kin dregards,

Emran Tohidi.

My codes is here:

> restart;
> with(orthopoly);
print(`output redirected...`); # input placeholder
> N := 4; Digits := 20;
print(`output redirected...`); # input placeholder

> A := -1; B := 1; rho := 3/4;
> g1 := proc (t) options operator, arrow; 1/2+(1/2)*tanh((1/2)*(A-(2*rho-1)*t/sqrt(2))/sqrt(2)) end proc; g2 := proc (t) options operator, arrow; 1/2+(1/2)*tanh((1/2)*(B-(2*rho-1)*t/sqrt(2))/sqrt(2)) end proc;
print(`output redirected...`); # input placeholder
> f := proc (x) options operator, arrow; 1/2+(1/2)*tanh((1/2)*x/sqrt(2)) end proc;
print(`output redirected...`); # input placeholder
> uexact := proc (x, t) options operator, arrow; 1/2+(1/2)*tanh((1/2)*(x-(2*rho-1)*t/sqrt(2))/sqrt(2)) end proc;
print(`output redirected...`); # input placeholder
> basiceq := simplify(diff(uexact(x, t), `$`(t, 1))-(diff(uexact(x, t), `$`(x, 2)))+uexact(x, t)*(1-uexact(x, t))*(rho-uexact(x, t)));
print(`output redirected...`); # input placeholder
                                      0
> alpha := 0; beta := 0; pol := P(N-1, alpha+1, beta+1, x); pol := unapply(pol, x); dpol := simplify(diff(pol(x), x)); dpol := unapply(dpol, x);
print(`output redirected...`); # input placeholder
> nodes := fsolve(P(N-1, alpha+1, beta+1, x));
%;
> xx[0] := -1;
> for i to N-1 do xx[i] := nodes[i] end do;
print(`output redirected...`); # input placeholder
> xx[N] := 1;
> for k from 0 to N do h[k] := 2^(alpha+beta+1)*GAMMA(k+alpha+1)*GAMMA(k+beta+1)/((2*k+alpha+beta+1)*GAMMA(k+1)*GAMMA(k+alpha+beta+1)) end do;
print(`output redirected...`); # input placeholder
> w[0] := 2^(alpha+beta+1)*(beta+1)*GAMMA(beta+1)^2*GAMMA(N)*GAMMA(N+alpha+1)/(GAMMA(N+beta+1)*GAMMA(N+alpha+beta+2));
print(`output redirected...`); # input placeholder
> for jj to N-1 do w[jj] := 2^(alpha+beta+3)*GAMMA(N+alpha+1)*GAMMA(N+beta+1)/((1-xx[jj]^2)^2*dpol(xx[jj])^2*factorial(N-1)*GAMMA(N+alpha+beta+2)) end do;
print(`output redirected...`); # input placeholder
> w[N] := 2^(alpha+beta+1)*(alpha+1)*GAMMA(alpha+1)^2*GAMMA(N)*GAMMA(N+beta+1)/(GAMMA(N+alpha+1)*GAMMA(N+alpha+beta+2));
print(`output redirected...`); # input placeholder
> for j from 0 to N do dpoly1[j] := simplify(diff(P(j, alpha, beta, x), `$`(x, 1))); dpoly1[j] := unapply(dpoly1[j], x); dpoly2[j] := simplify(diff(P(j, alpha, beta, x), `$`(x, 2))); dpoly2[j] := unapply(dpoly2[j], x) end do;
print(`output redirected...`); # input placeholder
print(??); # input placeholder
> for n to N-1 do for i from 0 to N do BB[n, i] := sum(P(jjj, alpha, beta, xx[jjj])*dpoly2[jjj](xx[n])*w[i]/h[jjj], jjj = 0 .. N) end do end do;
> for n to N-1 do d[n] := BB[n, 0]*g1(t)+BB[n, N]*g2(t); d[n] := unapply(d[n], t) end do;
print(`output redirected...`); # input placeholder
> for nn to N-1 do F[nn] := simplify(sum(BB[nn, ii]*u[ii](t), ii = 1 .. N-1)+u[nn](t)*(1-u[nn](t))*(rho-u[nn](t))+d[nn](t)); F[nn] := unapply(F[nn], t) end do;
print(`output redirected...`); # input placeholder
> sys1 := [seq(d*u[q](t)/dt = F[q](t), q = 1 .. N-1)];
print(`output redirected...`); # input placeholder
[d u[1](t)                                                                
[--------- = 40.708333333333333334 u[1](t) + 52.190476190476190476 u[2](t)
[   dt                                                                    

                                                                  2          3
   + 39.958333333333333334 u[3](t) - 1.7500000000000000000 u[1](t)  + u[1](t)

   + 7.3392857142857142858

   - 3.6696428571428571429 tanh(0.35355339059327376220

   + 0.12500000000000000000 t) - 3.6696428571428571429 tanh(
                                                     d u[2](t)   
-0.35355339059327376220 + 0.12500000000000000000 t), --------- =
                                                        dt       
-20.416666666666666667 u[1](t) - 25.916666666666666667 u[2](t)

                                                                  2          3
   - 20.416666666666666667 u[3](t) - 1.7500000000000000000 u[2](t)  + u[2](t)

   - 3.7500000000000000000

   + 1.8750000000000000000 tanh(0.35355339059327376220

   + 0.12500000000000000000 t) + 1.8750000000000000000 tanh(
                                                     d u[3](t)                
-0.35355339059327376220 + 0.12500000000000000000 t), --------- = 29.458333333\
                                                        dt                    

  333333333 u[1](t) + 38.476190476190476190 u[2](t)

                                                                  2          3
   + 30.208333333333333333 u[3](t) - 1.7500000000000000000 u[3](t)  + u[3](t)

   + 5.4107142857142857144

   - 2.7053571428571428572 tanh(0.35355339059327376220

   + 0.12500000000000000000 t) - 2.7053571428571428572 tanh(
                                                   ]
-0.35355339059327376220 + 0.12500000000000000000 t)]
                                                   ]
> ics := seq(u[qq](0) = evalf(f(xx[qq])), qq = 1 .. N-1);
print(`output redirected...`); # input placeholder
    u[1](0) = 0.38629570659055483825, u[2](0) = 0.50000000000000000000,

      u[3](0) = 0.61370429340944516175
> dsolve([sys1, ics], numeic);
%;
Error, (in dsolve) invalid input: `PDEtools/sdsolve` expects its 1st argument, SYS, to be of type {set({`<>`, `=`, algebraic}), list({`<>`, `=`, algebraic})}, but received [[d*u[1](t)/dt = (20354166666666666667/500000000000000000)*u[1](t)+(13047619047619047619/250000000000000000)*u[2](t)+(19979166666666666667/500000000000000000)*u[3](t)-(7/4)*u[1](t)^2+u[1](t)^3+36696428571428571429/5000000000000000000-(36696428571428571429/10000000000000000000)*tanh(1767766952966368811/5000000000000000000+(1/8)*t)-(36696428571428571429/10000000000000000000)*tanh(-1767766952966368811/5000000000000000000+(1/8)*t), d*u[2](t)/dt = -(20416666666666666667/1000000...

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.  

I'm having trouble plotting a couple things. I have

eq := diff(y(x), x$3)+3*diff(y(x),x$2)+12*y(x);
soln := dsolve(eq, y(x));
soln := evalf(soln);
PartSoln1 := dsolve({eq, y(0) = a,y'(0) = 0,y''(0) = 0}, y(x));
curves := {seq(PartSoln1, a = -3 .. 3)};
Then when I try plot(curves, x = -1..5, y = -5..5); I get Warning, expecting only range variable x in expression PartSoln1 to be plotted but found name PartSoln1.

Also,
charEq := r^3+r+1 = 0;
soln := solve(charEq, r);
soln := [evalf(soln, 5)];
soln := map(Re, soln);

I tried a few things, but can't figure out how to plot charEq, including the real roots.

Thanks for any help,

Heather

I'm trying to solve a system of 4 ODE's.

 

 

however I have 4 equations and six unknowns. I dont know how else to describe the functions a,b,c,d

 

cause these just represent vector valued functions at points (x1,y1) and (x2,y2) where i have chosing (x1,y1)=(-1,0) and (x2,y2) = (1,0)

 

I have that

 

dx1/dt = (u,v)

dx2/dt=(f,g)

I know that if i graph these functions I should get vertical lines, but I keep getting circles if I instead consider a(t) to be x(t) and b(t) to be y(t)...

 

I need to solve this system and plot it but i am misinterpreting something somewhere..

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

Sorry for disturbing you. I am wondering if there is an easier approach in Maple that could convert a system of second order differential equations into matrix form. Of course, we could do it by hand easily if the degrees of freedom is small. I would like to know if we could use Maple to do so. 

Here is an example with 6 degrees of freedom: the variables are u, v, w, alpha, beta and gamma. And, this is a uncoupled system.

Vector(6, {(1) = 2*R^2*(diff(w(t), t))*Pi*Omega*h*rho+R^2*(diff(u(t), t, t))*Pi*h*rho-R^2*u(t)*Pi*Omega^2*h*rho = 0, (2) = R^2*(diff(v(t), t, t))*Pi*h*rho = 0, (3) = -2*R^2*(diff(u(t), t))*Pi*Omega*h*rho+R^2*(diff(w(t), t, t))*Pi*h*rho-R^2*w(t)*Pi*Omega^2*h*rho = 0, (4) = (1/4)*R^4*Pi*(diff(alpha(t), t, t))*h*rho+(1/12)*R^2*Pi*(diff(alpha(t), t, t))*h^3*rho+(1/6)*R^2*Pi*(diff(gamma(t), t))*Omega*h^3*rho-(1/12)*R^2*Pi*alpha(t)*Omega^2*h^3*rho = 0, (5) = (1/2)*R^4*Pi*(diff(beta(t), t, t))*h*rho-(1/2)*R^4*Pi*beta(t)*Omega^2*h*rho = 0, (6) = (1/4)*R^4*Pi*(diff(gamma(t), t, t))*h*rho+(1/12)*R^2*Pi*(diff(gamma(t), t, t))*h^3*rho-(1/6)*R^2*Pi*(diff(alpha(t), t))*Omega*h^3*rho-(1/12)*R^2*Pi*gamma(t)*Omega^2*h^3*rho = 0});

The objective is to reform it into matrix form : M*diff(X(t), t, t)+C*diff(X(t), t)+K*X(t)=F.

Thank you in advance for taking a look. 

Howdy,

I am trying to create a mathmatical model that shows a predator-prey relationship along with seasonal variations (hibernation). I made two piecewise functions where one is "on" during the winter and the other is "off" during the winter and the model worked well for one unit of time. 

My problem is that I would like the piecewise functions to apply over an arbitrary amount of time units periods without having to set the range within the function itself for 100 units of time. I was thinking that a for loop would work but i'm not sure how I would impliment that.

Thanks in advance!!

Edit: 

Here's a little bit more info on the problem.

I have three O.D.E's in an array..

ode := {r'(t),h'(t),c'(t)}

which are dependent on a list of parameters..

constants := {a,b,...,s,w,c0,h0,r0};

where s and w are my piecewise functions.

I am able to solve the three odes using dsolve for one period of s and w.

Again, I'm really not sure where to start to make my model periodic.

Hi,

 

I want to solve the Falkner-Skan equation numbercally using maple. The Falkner-Skan equation is 

f′′′ + ff′′ + (1 − (f′)^2)=0 ,

with subject to the boundary conditions,

f(0) =0 ; f′(0) = 0,

f′(∞) = 1. 

could you  please help me to have loop to solve this problem from t=0..30.

And then save the data in DATfile in order to plot using Gnuplot?

 

Regards

 

I have a set of differential equations on 3 variables, B[1],B[2] and C. Its not physically meaningful for B[1]+B[2]>0.5 so i would ideally like to replace the cube that the solutions are displayed on (the axis take the limits B[1]=0...0.5,B[2]=0...0.5,C=0...100 ) with a triangular prism (the axis take the limits B[1]=0...0.5,B[2]=0...0.5,B[1]+B[2]<0.5,C=0...100 ).

Failing that i'd like the plot to display a plane showing where the meaningful values for the variables end.

here is the code I use to put the ODEplot together

Model := [diff(B[1](t), t) = k[a1]*C(t)*(R-B[1](t)-B[2](t))-k[d1]*B[1](t), diff(B[2](t), t) = k[a2]*C(t)*(R-B[1](t)-B[2](t))-k[d2]*B[2](t), diff(C(t), t) = (-(k[a1]+k[a2])*C(t)*(R-B[1](t)-B[2](t))+k[d1]*B[1](t)+k[d2]*B[2](t)+k[m]*((I)(t)-C(t)))/h];
DissMod := subs((I)(t) = 0, Model);
AssMod := subs((I)(t) = C[T], Model);

Pars1a := [k[a1] = 6*10^(-4), k[d1] = 7*10^(-3), k[a2] = 6*10^(-4), k[d2] = (7/5)*10^(-3), R = .5, k[m] = 10^(-4), C[T] = 100, h = 10^(-6)];

Pars := Pars1a; thing11 := subs(Pars, AssMod[1]), subs(Pars, AssMod[2]); thing12 := diff(C(t), t) = piecewise(t <= 100, subs(Pars, rhs(AssMod[3])), subs(Pars, rhs(DissMod[3]))); sol := dsolve({thing11, thing12, C(0) = 0, B[1](0) = 0, B[2](0) = 0}, {C(t), B[1](t), B[2](t)}, numeric, output = listprocedure, maxstep = 2, maxfun = 1000000); ParsPlot1a := odeplot(sol, [B[1](t), B[2](t), C(t)], t = 0 .. 700, color = blue, view = [0 .. .5, 0 .. .5, 0 .. 100], tickmarks = [[0 = 0, .5 = R], [0 = 0, .5 = R], [0 = 0, 25 = (1/4)*C[T], 50 = (1/2)*C[T], 100 = C[T]]]);


But I can't see a way of either making the plane or making the ODEplot axis into something other than a cube.

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