## 355 Reputation

11 years, 284 days

## definite integral?...

Its a definite integral, how we are suppose to plot it?

restart:

a:=1:

f:=(a*cos(u*x)+u*sin(u*x))/a^2+u^2;

1/Pi*int(f,x=-1..3,u=0...20);

evalf(%);

3396.626292

or you want to just plot the function

f(u,x)=(a*cos(u*x)+u*sin(u*x))/a^2+u^2 ?

or you want to plot the  1/Pi*int(f,u=0..20)?

If this is the case then

1/Pi*int(f,u=0..20);

f1:=evalf(%);

plot(f1,x=-1..3,color=green);

## plot...

restart:with(plots):
a:=1: k:=10^(-6):
U:=1-1/2*erf((x+a)/(2*sqrt(k*t)))+1/2*erf((x-a)/(2*sqrt(k*t)));

plot([subs(t=10^(5),U),subs(t=10^(6),U)],x=-5..5,color=[red,green]);

## white hand button...

When there is an operation going on you will see a white hand button on the tool/taskbar which can be used to stop the current operations/calculations.

Thanks

## syntax error...

restart:

u:=integrate(q[i],i=0..M); # this is wrong

Edit:

u:=int(q(i),i=0..M);

q(i) is an unknow function, how can we int or diff?

## dsolve/numeric/classical...

What @Carl Love  is trying to say is that there are variety of numerical build in methods available in maple LAB.

For Runge Kutta 4th order method, you need to convert your ode to a system of first order equations then you can try to solve it numerically. So, to avoid that much work, @Carl Love is suggesting that you should use a buildin numerical method for IVPs. (@Carl Love, If my interpretation is wrong then please feel free to correct me?)

Anyway, here is what I think you are looking for,

restart:with(plots):

k_1:=1:sigma:=1: # @Carl Love correctly mentioned that we need values for k_1 and sigma.

dsys1 := {diff(theta(eta), eta, eta)+sigma*sqrt(1+k_1)*(1-exp(-eta/sqrt(1+k_1)))*

(diff(theta(eta), eta)) = 0, theta(0) = 1, (D(theta))(0) = 0}:

p:=dsolve(dsys1, numeric, method=classical[rk4], output=listprocedure): # I have updated the method as was suggested by Carl (dsolve/numeric/classical)

odeplot(p, [eta,theta(eta)], 0..10, numpoints=250); The plotting result of your ode.

Thanks

## syntax issues...

FIrst of all you need to type in the correct synatx for a system of ODE or just ODE.

Which should be

restart:with(plots):

Eq1:=diff(x(t),t)+.01(.1*x(t)+.1)^2*a+.01*.03*y(t)*(1+x(t))*b+.02*.01*c*(z(t)+5)*(x(t)+1)=0;

Eq2:=diff(y(t),t)+.01*.03*y(t)*(1+x(t))*a+.01*.09*y(t)^2+.01*.06*y(t)*(z(t)+5)*c=0;

Eq3:=diff(z(t),t)+.02*.01*a*(z(t)+5)*(x(t)+1)+.01*.06*y(t)*(z(t)+5)*b+.01*.04*(z(t)+5)^2*c=0;

I was unable to find the analytical solution, so tried numerical.

For which I took bcs of this type

bc:=x(0)=0,y(0)=0,z(0)=0;

assumed the constant to be

a:=1:b:=1:c:=1:

sol:=dsolve([Eq1,Eq2,Eq3,bc],numeric,output = array([seq(0.1e-1*i, i = 0 .. 110)]));

p1 := odeplot(sol, [t, x(t)], linestyle = 1, color = black ):

p2 := odeplot(sol, [t, y(t)], linestyle = 2, color = red):

p3 := odeplot(sol, [t, z(t)], linestyle = 4, color = green):

plots[display]({p1, p2, p3});

## some thing like this?...

Is this what you are looking for?

Testing_2...mw

## f0(x) and q0(x)??...

You need to specify what is f0(x) and q0(x).

## some thing like this?...

 > restart:
 > with(plots):Digits:=30:
 > eq1:=diff(x1(t),t)+x1(t)+0.03*x2(t)+0.01*y1(t)+0.02499*y2(t)+.009*y3(t)=0:
 > eq2:=diff(x2(t),t)+0.833*x1(t)+0.69985*x2(t)+0.13745*x3(t)+0.02499*y1(t)+ 0.06245*y2(t)+.00227159*y3(t)=0:
 > eq3:=diff(x3(t),t)+0.109073*x2(t)+0.195455*x3(t)+0.00909*y1(t)+0.02271591*y2(t)+ .00826281*y3(t)=0:
 > eq4:=diff(y1(t),t)=0:
 > eq5:=diff(y2(t),t)=0:
 > eq6:=diff(y3(t),t)=0:
 > ics:=x1(0)=0,x2(0)=.83,x3(0)=-4.54,x1(100)=0,x2(100)=0,x3(100)=0:
 > A:=dsolve({eq1,eq2,eq3,eq4,eq5,eq6,ics},numeric,abserr=10^(0.1)):
 > p1 := odeplot(A, [t, x1(t)], linestyle = 1, color = black,legend=["x1(t)"] ):
 > p2 := odeplot(A, [t, x2(t)], linestyle = 2, color = red,legend=["x2(t)"] ):
 > p3 := odeplot(A, [t, x3(t)], linestyle = 3, color = green,legend=["x3(t)"] ):
 > plots[display]({p1, p2, p3},axes=boxed,thickness=2,labels=[t,"X's"]);
 >

## Graphical approach...

 > restart:with(LinearAlgebra):with(plots):
 > eq1:=a*x + y +z +u =  1;
 >
 (1)
 > eq2:=x  -y  -z +u  = -a;
 >
 (2)
 > eq3:=y +z -a*u = b;
 >
 (3)
 >
 > eq4:=x- y +b*z +u =-2*a;
 >
 (4)
 > sol:=solve({eq1,eq2,eq3,eq4},{x,y,z,u});
 (5)
 > sol[1];
 (6)
 > u1:=(-b*a-b+a^2+1)/(a^2+1);
 (7)
 > x1:=-(-2*b+a^2+1)/(a^2+1);
 (8)
 > y1:=(-b^2*a+b*a^3+b^2+b+2*a^3+2*a)/((a^2+1)*(b+1));
 (9)
 > z1:=-a/(b+1);
 (10)
 > implicitplot([u1,x1,y1,z1],a=-10..10,b=-20..30,gridrefine = 2, resolution = 1000, crossingrefine = 3, color=["green", "Teal","black","red"],thickness=2,legend=["u","x","y","z"],axes=boxed);
 >
 > eqs:={eq1, eq2,eq3,eq4};
 (11)
 > #If you want to write it in a matrix form then use "GenerateMatrix"
 > A,B:=GenerateMatrix(eqs,[x,y,z,u]);
 (12)
 > #To combine A and B use "" as suggested by @Adri vanderMeer van der Meer
 > M := ;
 (13)
 > #Infinite solutions (As suggested by @rlopez)
 > ReducedRowEchelonForm(subs(a=0,b=-1,M));
 (14)
 > #No solutions (As suggested by @rlopez)
 > ReducedRowEchelonForm(subs(a=1,b=-1,M));
 (15)
 > #Unique solution (As suggested by @rlopez)
 > ReducedRowEchelonForm(subs(a=1,b=2,M));
 (16)
 >

## proc...

restart:

`g:=proc(a,b) local s; s:=a/b;end proc;`
`g(1,2);`
`  1/2`

## Examples...

Example 1 (From Maple help)

Find the sum of all two-digit odd numbers from 11 to 99.

`tot := 0:for i from 11 by 2 while i < 100 do   tot := tot + iend do:tot;`
`For further details see ?do(while) and`
`http://www.mapleprimes.com/questions/36926-Is-There-A-do-While-Loop-In-Maple`
`http://www.mapleprimes.com/questions/127845-How-Do-I-Create-while-Loops-In-Maple`
` `
`Example 2 (http://www.math.tamu.edu/~sottile/conferences/Summer_IMA07/maple_tutorial/`
`introduction-maple/node5.html)`
` `
`collatz := proc(n)`
```  local m,count;
count := 0;
m := n;
while ( m > 1 ) do
if ( modp(m,2) = 0 ) then
m := m/2;
else
m := 3*m+1;
end;
count := count + 1;
end;
return(count);
end;```
` `
`Thanks`

## syntax error...

`restart:`
`with(plots):R:=1:ode1 := diff(f(eta), [`\$`(eta, 4)])+R*(eta*(diff(f(eta), [`\$`(eta, 3)]))+3*(diff(f(eta),`
` [`\$`(eta, 2)]))-f(eta)*(diff(f(eta), [`\$`(eta, 3)]))+(diff(f(eta), eta))*(diff(f(eta),`
` [`\$`(eta, 2)]))) = 0:`
`soln := dsolve({ode1, f(0) = 0, f(1) = 1, (D(f))(0) = 0, (D(f))(1) = 0}, f(eta), numeric):p1 := odeplot(soln, [eta, f(eta)], 0 .. 1, color = black, thickness = 2, scaling = constrained):g:=eta:#sayp2 := plot(g,eta=0..1, color = blue, scaling = constrained):display({p1,p2});`
` `
`Thanks`

## syntax issues...

 > restart; with(plots): with(LinearAlgebra): with(linalg):
 > m1 := 2280: m2 := 2243: m3 := 2220: k1 := 300: k2 := 200: k3 := 100: F0 := 4.1: omega1 :=evalf( sqrt(abs((k1+k2)/m1))); omega2 := evalf(sqrt(abs((k2+k3)/m2))); omega3 := evalf(sqrt(abs(k3/m3)));
 (1)
 > eq1:=m1*(diff(u1(t), t\$1))+(k1+k2)*u1(t)-k2*u2(t) = F0*cos(omega1*t);
 (2)
 > eq2:=m2*(diff(u2(t), t\$2))-k2*u1(t)+(k2+k3)*u2(t)-k3*u3(t) = F0*cos(omega2*t);
 (3)
 > eq3:=m3*(diff(u3(t), t\$2))-k3*u2(t)+k3*u3(t) = F0*cos(omega3*t);
 (4)
 > sys:={eq1,eq2,eq3};
 (5)
 > ics:= u1(0) = 0, u2(0) = 0, u3(0) = 0, D(u2)(0) = 0, D(u3)(0) = 0;
 (6)
 > csol := dsolve(sys union {ics}, type=numeric);
 (7)
 > p1:=odeplot(csol, [[t,u1(t), color=red,style=point]]):
 > p2:=odeplot(csol, [[t,u2(t), color=blue,style=line]]):
 > p3:=odeplot(csol, [[t,u3(t), color=green,style=point]]):
 > display(p1, p2, p3,axes=boxed,labels=['t','u'],title = "red=First Floor,blue=Second Floor,green=Third Floor");

`restart:`
`eq1:=(4-(3/2)*q+(1/2)*sqrt(28-24*q+5*q^2))*(1/2-(1/2)*q);`
`eq2:=(3-q+(1/4)*sqrt(84-58*q+10*q^2)+(1/4)*sqrt((4-2*q)*(3-q)))*(1/2-(1/2)*q);`
`solve( {eq1<1, eq2<1}, {q} );`
`evalf(%);`
`                     {q <= 2., .6040681398 < q}, {3. <= q, q < 4.744826078}`