MaplePrimes Questions

Is there a way of increasing the spacing between the maple input and output?

Thanks

Hi, i was wondering how you would solve the equation

30+1144*r^4-832*r^2=0, 

exactly in maple.

Using the command

fsolve(30+1144*r^4-832*r^2);

-0.8301954535, -0.1950595709, 0.1950595709, 0.8301954535

Also, if possible how would you get maple to find the two exact positive solutions.

 

Thanks

when i got this error, i am confused i guess t is independant variable, x1,y1,z1 are dependant variables

 

x11 := [0.208408965651696e-3, -0.157194487523421e-2, -0.294739401402979e-2, 0.788206708183853e-2, 0.499394753201753e-2, 0.191468321959759e-3, 0.504980449104750e-2, 0.222150494088535e-2, 0.132091821964287e-2, 0.161118434883258e-2, -0.281236534046873e-2, -0.398055875132037e-2, -0.111753680372819e-1, 0.588868146012489e-2, -0.354191562612469e-2, 0.984082837373291e-3, -0.116041186868374e-1, 0.603027845850267e-3, -0.448778128168742e-2, -0.127561485214862e-1, -0.412027655195339e-2, 0.379387381798949e-2, -0.602550446997765e-2, -0.605986284736216e-2, -0.751396992404410e-2, 0.633613424008655e-2, -0.677581832613623e-2]:
y11 := [ -21321.9719565717, 231.709204951251, 1527.92905167191, -32.8508507060675, 54.9408176234139, -99.4222178124229, -675.771433486265, 42.0838668074923, -12559.3183308951, 5.21412214166344*10^5, 1110.50031772203, 3.67149699000155, -108.543878970269, -8.48861069398811, -521.810552387313, 26.4792411876883, -8.32240296737599, -1085.40982521906, -44.1390030597906, -203.891397612798, -56.3746416571417, -218.205643256096, -178.991498697065, -42.2468018350386, .328546922634921, -1883.18308996621, 111.747881085748]:
z11 := [ 1549.88755331800, -329.861725802688, 8.54200301129155, -283.381775745327, -54.5469129127573, 1875.94875597129, -16.2230517860850, 6084.82381954832, 1146.15489803104, -456.460512914647, 104.533252701641, 16.3998365630734, 11.5710907832054, -175.370276462696, 33.8045539958636, 2029.50029336951, 1387.92643570857, 9.54717543291120, -1999.09590358328, 29.7628085078953, 2.58210333216737*10^6, 57.7969622731082, -6.42551196941394, -8549.23677077892, -49.0081775323244, -72.5156360537114, 183.539911458475]:
a1 := Diff(x1(t),t) = k1*x1(t)+ k2*y1(t)+ k3*z1(t);
b1 := Diff(y1(t),t) = k4*x1(t)+ k5*y1(t)+ k6*z1(t);
c1 := Diff(z1(t),t) = k7*x1(t)+ k8*y1(t)+ k9*z1(t);
ICS:=x1(0)=x11[1],y1(0)=y11[1],z1(0)=z11[1];
sol:=dsolve({a1,b1,c1,ICS}, numeric, method=rkf45, parameters=[k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12]);
ans:=proc(p1,p2,p3) sol(parameters=[x1=p1,y1=p2,z1=p3]); end proc:
tim := [seq(n, n=1..27)];
FitParams:=Statistics:-NonlinearFit(ans, [x11, y11, z11], tim, initialvalues=<0.5,0.5,0.5>, output=parametervalues);

 

 

Hi, i am trying to solve the equations denoted eq1 and eq2 for x and r.

f:=r*(8 - 2*x^2);
g:=subs(x=f,f):
eq1:= g-x:
eq2:= expand(diff(g,x) + 1):

I am having a bit of trouble as these simultaneous equations have many solutions and using the command solve, just basically crashes maple. I just want the commands that would give the positive set of solutions only, ie. excluding all complex and negative solutions. 

Thanks in advance.

 

4th_order.mw Is it possible to solve this ODE with perturbation method using maple? If yes, please give the procedure.

Thanks.

Can one solve nonlinear ODE with perturbation method in maple? If yes, please the procedure.

I was looking at a question on another forum, and tried in Maple also, and Maple also have a problem with this integral. Here is a simple version. The problem is that int() gives different numerical answer from evalf(Int). Maple can't solve this analytically, so values have to be used for the integrand before calling int()

restart;
eq2:=(a/(a + c*z))^L*exp(-z)/sqrt(z);

L:=2:
a:=10^(0.1):
b:=10^(0.1):
c:=0.01*a:
int(eq2,z=0..infinity);   # 177.245
evalf(Int(eq2,z=0..infinity));   # 1.7551


I think the 1.7551 is the correct value. My question is: Why did maple give wrong answer from int()? Is it analytical reason, or purely numerical?

Maple 17.02, windows 7.

[*********************************************************************************]
[* DO NOT EDIT PROBLEMS TO REMOVE THE ORIGINAL QUESTION! -Carl Love as moderator *]
[*********************************************************************************]
% use Euler formula to compute function y for i = 1:N if i ==1 legend('numerical y','exact y','numerical g','exact g') function g = f2g(a,b) % f(x) = x g = (b-a)/6*(a + 4*(a+b)/2 + b);

x11 := Vector([0.208408965651696e-3, -0.157194487523421e-2, -0.294739401402979e-2, 0.788206708183853e-2, 0.499394753201753e-2, 0.191468321959759e-3, 0.504980449104750e-2, 0.222150494088535e-2, 0.132091821964287e-2, 0.161118434883258e-2, -0.281236534046873e-2, -0.398055875132037e-2, -0.111753680372819e-1, 0.588868146012489e-2, -0.354191562612469e-2, 0.984082837373291e-3, -0.116041186868374e-1, 0.603027845850267e-3, -0.448778128168742e-2, -0.127561485214862e-1, -0.412027655195339e-2, 0.379387381798949e-2, -0.602550446997765e-2, -0.605986284736216e-2, -0.751396992404410e-2, 0.633613424008655e-2, -0.677581832613623e-2]):
y11 := Vector([ -21321.9719565717, 231.709204951251, 1527.92905167191, -32.8508507060675, 54.9408176234139, -99.4222178124229, -675.771433486265, 42.0838668074923, -12559.3183308951, 5.21412214166344*10^5, 1110.50031772203, 3.67149699000155, -108.543878970269, -8.48861069398811, -521.810552387313, 26.4792411876883, -8.32240296737599, -1085.40982521906, -44.1390030597906, -203.891397612798, -56.3746416571417, -218.205643256096, -178.991498697065, -42.2468018350386, .328546922634921, -1883.18308996621, 111.747881085748]):
z11 := Vector([ 1549.88755331800, -329.861725802688, 8.54200301129155, -283.381775745327, -54.5469129127573, 1875.94875597129, -16.2230517860850, 6084.82381954832, 1146.15489803104, -456.460512914647, 104.533252701641, 16.3998365630734, 11.5710907832054, -175.370276462696, 33.8045539958636, 2029.50029336951, 1387.92643570857, 9.54717543291120, -1999.09590358328, 29.7628085078953, 2.58210333216737*10^6, 57.7969622731082, -6.42551196941394, -8549.23677077892, -49.0081775323244, -72.5156360537114, 183.539911458475]):
a1 := Diff(x1(t),t) = k1*x1(t)+ k2*y1(t)+ k3*z1(t)+k4*u(t);
b1 := Diff(y1(t),t) = k5*x1(t)+ k6*y1(t)+ k7*z1(t)+k8*u(t);
c1 := Diff(z1(t),t) = k9*x1(t)+ k10*y1(t)+ k11*z1(t)+k12*u(t);
ICS:=x1(0)=x11[1],y1(0)=y11[1],z1(0)=z11[1],u(0)=7;
Zt := rhs(dsolve({a1,b1,c1,ICS},[x1(t),y1(t),z1(t),u(t)]));
Params := NonlinearFit(Re(Zt),<seq(k,k=0..N)>, C, [t], parameternames=[k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12], output=parametervalues):
A := eval(a, Params):
B := eval(b, Params):
a = A;
b = B;

 

i wait for a long time for dsolve still evaluating

I have the command;

> restart: Digits:=20: N:=10000: M:=100: x_max:=1: r_min:=2.5:
> r_max:=4: for n from 0 to N do r:=r_min+n/N*(r_max-r_min):
> x:=evalf(x_max*rand()/10^12):for m from 0 to M do x:=r*x*(1-x): od:
> X[n]:=x: od:
> with(plots):
> bifpoint:=[seq([r_min+j/N*(r_max-r_min),X[j]],j=0..N)]:
> pitchf:=pointplot(bifpoint,symbol=point):display(pitchf);

 

This plots the bifurcation diagram for the logistic model f(x) = r*x*(1-x).

How do i plot the bifurcation diagram for f(x) = r*(8 - 2*x^2). 

I've tried just replacing the function but it does not work.

 

 

we were given a function that counts the number of primes among the arguments after the
rst and returns the result in the rst argument. When calling this, you must make sure
that the rst argument is a name. 

this is it.

cp := proc (YY) local count, i ;
print("nargs=", nargs, "args=", args) ;
count := 0 ;
for i from 2 to nargs do
if isprime(args[i]) then
count := count+1 ;
end if ;
print("i=", i, "count=", count) ;
end do ;
print("count=", count) ;
YY := count ;
end proc ;

EX: cp('noprimes',2,4,5,6,7,9,19)

and this works grand, but then we were given this function with slight adjustments to it and asked to fix it. the hints we were given were to try and forve evaluation at the right places.

This is the function we have to fix...

xcp := proc (count) local i;
print("nargs=", nargs, "args=", args) ;
count := 0 ;
for i from 2 to nargs do
if isprime(args[i]) then
count := count+1 ;
end if ;
print("i=", i, "count=", count) ;
end do ;
print("count=", count) ;
end proc ;

 

any help is appreciated!

Greetings to all.

I have run into a curious numeric event while computing Master theorem recurrences at this math.stackexchange.com link.

I do have to say that this one has me worried. I am referring to Maple 15 (X86 64 LINUX).

Try the following program in a new Maple session.

T := proc(n)
option remember;
    if n = 0 then return 0 end if; 9*T(floor(1/3*n)) + n*(1 + ilog[3](n))^3
end proc;

T_ex := proc(n)
local m, d;
option remember;
    d := convert(n, base, 3);
    m := ilog[3](n);
    add(3^j*(1 + m - j)^3*add(d[k + 1]*3^k, k = j .. m), j = 0 .. m)
end proc;

T(3^22-1)-T_ex(3^22-1);

The result is the following error message:

Error, (in T_ex) invalid subscript selector

Now try it again, in a new Maple session, but enter the following command first.

Digits := 50;

Now the result is

0

Consider the following program:

T := proc(n)
option remember;
    if n = 0 then return 0 end if; 9*T(floor(1/3*n)) + n*(1 + ilog[3](n))^3
end proc;

T_upper := proc(n)
local m;
option remember;
    m := ilog[3](n); 3^(2*m + 2)*sum(3^(-j)*j^3*(1 - 3^(-j)), j = 1 .. m + 1)
end proc;

T(3^22-1)-T_upper(3^22-1);

The result is

-30454808964204479209326

But if you precede the program with the command

Digits:=50;

the result is once more

0

This is reproducible (restart Maple every time) and quite frankly, seems rather serious to me. Could someone please look into this.

 

Marko Riedel

Hi. I'd like to find the solution closest to zero for sum(abs(f(k, m, n)+g(k, m, n)), n = i .. j) , when a < m, n < b . 

Have trouble wrapping my head around how to do that and would appreciate any help.

Even better would be to find a solution where the maximum absolute value of f(k, m, n) + g(k, m, n) is minimized for n = i .. j) and when a < m, n < b , but I'm guessing the sum would be easier, and close enough.

Maybe I'm barking up the wrong tree getting this done with Maple, but I'm hopeful.

Thank you for looking

Dear experts;

How can I solve this problem with maple?

restart:


 X[3](0):=6.3096*10^9;
 c:=0.67;
 d:=3.7877*10^(-8);
 delta:=3.259*d;
 lambda:=(2/3)*10^8*d;
 R[0]:=1.33;
 p:=(c*X[3](0)*delta*R[0])/(lambda*(R[0]-1));
beta:=(d*delta*c*R[0])/(lambda*p);

ode:=diff(x[1](t), t)=(lambda-d*x[1](t)-(1-beta*x[1](t)*x[3](t)*(psi[1](t)-psi[2](t))/A[1])*beta*x[1](t)*x[3](t)),
 diff(x[2](t), t) =((1-beta*x[1](t)*x[3](t)*(psi[1](t)-psi[2](t))/A[1])*beta*x[1](t)*x[3](t)-delta*x[2](t)),
 diff(x[3](t), t) =((1+psi[3](t)*p*x[2](t)/A[2])*p*x[2](t)-c*x[3](t)),diff(psi[1](t), t) =-1+1/A[1]*beta^2*x[1](t)*(x[3](t))^2*(psi[1](t)-psi[2](t))^2-psi[1](t)*(-d+beta^2*(x[3](t))^2*(psi[1](t)-psi[2](t))/A[1]*x[1](t)-(1-beta*x[1](t)*x[3](t)*(psi[1](t)-psi[2](t))/A[1])*beta*x[3](t))-psi[2](t)*(-beta^2*(x[3](t))^2*(psi[1](t)-psi[2](t))/A[1]*x[1](t)+(1-beta*x[1](t)*x[3](t)*(psi[1](t)-psi[2](t))/A[1])*beta*x[3](t)),
 diff(psi[2](t), t) =1/A[2]*psi[3](t)^2*p^2*x[2](t)+psi[2](t)*delta-psi[3](t)*(psi[3](t)*p^2/A[2]*x[2](t)+(1+psi[3](t)*p*x[2](t)/A[2])*p),
 diff(psi[3](t), t) = 1/A[1]*beta^2*(x[1](t))^2*x[3](t)*(psi[1](t)-psi[2](t))^2-psi[1](t)*(beta^2*(x[1](t))^2*(psi[1](t)-psi[2](t))/A[1]*x[3](t)-(1-beta*x[1](t)*x[3](t)*(psi[1](t)-psi[2](t))/A[1])*beta*x[1](t))-psi[2](t)*(-beta^2*(x[1](t))^2*(psi[1](t)-psi[2](t))/A[1]*x[3](t)+(1-beta*x[1](t)*x[3](t)*(psi[1](t)-psi[2](t))/A[1])*beta*x[1](t))+psi[3](t)*c;

ics := x[1](0)=5.5556*10^7, x[2](0)=1.1111*10^7,x[3](0)=6.3096*10^9,psi[1](100)=0,psi[2](100)=0,psi[3](100)=0;

dsolve([ode, ics],numeric);?????????????????????????

Please help me

ode.mws

First 1497 1498 1499 1500 1501 1502 1503 Last Page 1499 of 2433