MaplePrimes Questions

Display integers between -10 and 20. Put integers between -10 and 20 in a list.

Display the odd integers between 115 and 231, then put them in a list

Construct a procedure that takes as argument a sorted list, an element n and returns the place of n if it belongs to the list, the sequence NULL otherwise.

Hi, I am trying to run the following command in a Maple worksheet

P:= 1979 #(this is the1000-th prime);
S:=5000; k:=5:
a:=[0$i=1..k];
f:=[0$i=1..k];
a[1]:=S;
f:=x->a[1];
with(RandomTools):
for i from 2 to k do
a[i]:=Generate(integer(range=1..P-1));
f:=x->f(x)+a[i]*x^(k-1);
print(f(x));
od;

(This is a beginning step to create the Shamir's secret sharing).
However, I get the following output (with explanations)

                              5000          (This is correct. the value a[1])
x -> a[1]                                   (This should be the initial function f = 5000)
                              7005          (This is correct, the value a[2])
x -> f(x) + a[i] x^(k-1)               (one of the main problems, see below)

The main problems are in the last output above:
1. The f(x) is not as it should be: f(x) = a[1] = 5000;
2. The index i isn't changed when it should be i = 2;
3.  An error message: too many levels of recursion  

The output (I expect) should be: 5000 + 7005x, ...., etc.

Thanks in advanced for any help.

I have two lines:

line(l1, [point(p1, [15, 6, 3.4]), vector([-4, 12, .3])]) and line(l2, [point(p2, [-17, 54, 3.2]), vector([6, -6, .2])])

They Intersect in this point: point(p3, [7, 30, 4]) (Tested it with IsOnObject)

When i use intersection(i1, l1, l2) it says "intersection: the given objects do not intersect"

Where is my Mistake?

Thank you for your Help!

I am trying to find an eigenspace of a matrix, but I am getting an error. I have attached a screenshot of the error and my work to help. 

int(exp(-sec(t))*cos(t)/(-1/4+sin(t)^2), t = 0 .. (1/2)*Pi, CauchyPrincipalValue = true, numeric = true);

Returns unevaluated for me.

I tried all the methods in HELP documentation and I failed.
Integral is singular at point 1/4.

Thank you.

Hello my friends

I have a problem with initial condition for below system of differential equation

sys := {6*(diff(a(t), t))^2+12*a(t)*(diff(a(t), t$2))-3*a(t)^2*phi(t)^(-2*c)*sqrt(1-alpha*(diff(phi(t), t))^2), 2*c*a(t)^3*phi(t)^(-2*c-1)*sqrt(1-alpha*(diff(phi(t), t))^2)-3*alpha*a(t)^2*phi(t)^(-2*c)*(diff(a(t), t))*(diff(phi(t), t))/sqrt(1-alpha*(diff(phi(t), t))^2)-alpha*a(t)^3*phi(t)^(-2*c)*(diff(phi(t), t$2))/sqrt(1-alpha*(diff(phi(t), t))^2)+2*c*alpha*a(t)^3*phi(t)^(-2*c-1)*(diff(phi(t), t))^2/sqrt(1-alpha*(diff(phi(t), t))^2)-alpha^2*a(t)^3*phi(t)^(-2*c)*(diff(phi(t), t))^2*(diff(phi(t), t$2))/(1-alpha*(diff(phi(t), t))^2)^(3/2), R(t) = 6*((diff(a(t), t))^2/a(t)^2+(diff(a(t), t$2))/a(t)), W(t) = -phi(t)^(-2*c)*sqrt(1-alpha*(diff(phi(t), t))^2)/(1/a(t)^3+a(t)^3+phi(t)^(-2*c)/sqrt(1-alpha*(diff(phi(t), t))^2))}

I set {c,alpha}={1,1} but initial conditon is problem ... since I got the following message from maple to illustrate diagrams of W(t), a(t) and even phi(t)

Warning, cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up
 

please help me.

 

with the best regard

 

Dear Friends

Do I want to know how to merge these two loops in one? how to apply if-else loop? help me in this regard. the source file is attached. Thank you! 

restart; M := 5;
for i1 while i1 <= M do N[i1, 0](u) = 1 end do;
                         N[1, 0](u) = 1
                         N[2, 0](u) = 1
                         N[3, 0](u) = 1
                         N[4, 0](u) = 1
                         N[5, 0](u) = 1
for k1 while k1 <= M do N[0, k1](u) = 0 end do;
                         N[0, 1](u) = 0
                         N[0, 2](u) = 0
                         N[0, 3](u) = 0
                         N[0, 4](u) = 0
                         N[0, 5](u) = 0

 

Hi All!

Is there a way to

1) sechedule the job

2) make it parallel

for computing Ax=B where A is a matrix (n*n) and B is a vector (n).

thanks.

Lamba is meant to be reserved for liouville function plotting some data i just realized it isn't that, so if the people that make the numtheory package please unprotec lamba in the future, or protec it but changed its proc assignment to the liouville function
function that would really sweet thanks

I wanted to have 3 graphs in 1 coordinate system. The Maple command I used was,

restart;
g := x -> (10*x)/(3+x);

f := x -> (10*x)/(5+x);

h := x -> (8*x)/(5+x);

plots:-display(
  plot( [g(x),f(x), h(x)], x=0..30, color=[red,blue, green], legend = ["k=3,c=10", "k=5, c=10","k=5,c=8"]));


Warning, unable to evaluate 1 of the 3 functions to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

 

The error comes up. only f(x) and h(x) were shown. How do I fix this? Thank you.

 

Monod Growth Model.

The function given was f(x)= cx/k+x , where c is the saturation value and k is the half-saturation constant.

I wanted to have the 2 graphs in 1 coordinate system, where both have c=5 but k= 2 and 3.

Is there also a way to clearly label and show that c=5 and extrapolate the point where k=2 and 3?

 

Thank you.

I have multiple curves of the same function with different initial conditions, trying to find the most suitable initial condition (for initial cond's less than the optimal one the function breaks down at 0 and for ic's > the optimal value the function decreases to a minimum before blowing up to infinity) See below:

In trying to find this optimal initial condition (or there abouts) for lots of different curves of the same form, I've tried to store the minimum values of each curve somewhere using Minimize, but for the curves that break down I get the error

Error, (in Optimization:-NLPSolve) cannot evaluate the solution further right of xxxxx, maxfun limit exceeded (see ?dsolve,maxfun for details)

And the program exits the loop and doesn't move on to the next curve, I'd like to find a way for Minimize to just return zero or better NA (or equivalent) when it encounters this problem and move on. Is there any way to do this? My code is below

 

with(Optimization):

f1 := proc (r) options operator, arrow; (diff(p(r), r))/(r*p(r)) end proc:

f2 := proc (r) options operator, arrow; (1/4)*(diff(p(r), r))^2/p(r)^2 end proc:

f3 := proc (r) options operator, arrow; (1/2)*(diff(p(r), r, r))/p(r) end proc:

ode := 2*(diff(f1(r), r)-(diff(f2(r), r))+diff(f3(r), r))/r+diff(f1(r), r, r)-(diff(f2(r), r, r))+diff(f3(r), r, r)-mu(2*(diff(p(r), r))/r+diff(p(r), r, r)) = p(r):

ic3 := Array([seq(-.9 .. -.8, 0.1e-1)]):

curve := Array(1 .. 11):

for i to 11 do ics := p(0.1e-4) = 1, (D(p))(0.1e-4) = 0, ((D@@2)(p))(0.1e-4) = ic3[i], ((D@@3)(p))(0.1e-4) = 0; sol := dsolve({ics, ode}, p(r), numeric, output = listprocedure); curve[i] := rhs(sol[2]); mincurve[i] := Minimize(curve[i](r), assume = nonnegative) end do

Error, (in Optimization:-NLPSolve) cannot evaluate the solution further right of 3.7209455, maxfun limit exceeded (see ?dsolve,maxfun for details)

 

plot([curve[1](r), curve[2](r), curve[3](r), curve[4](r), curve[5](r), curve[6](r), curve[7](r), curve[8](r), curve[9](r), curve[10](r), curve[11](r)], r = 0 .. 10, y = 0 .. 1.05, labels = [r, rho])

 

``


 

Download checkmin.mw


Cheers!

 

EDIT the initial conditions were originally defined at 0.00001 as my previous function was undefined at zero, forgot to change this when I changed my function. However, with these now corrected the problem still stands.

Series 2:Hi i was wondering if someone could explain how i can get series like this to evaluate to infinity, or a float placeholder for i mean.

Series 1:Any then also explain the mathematics as to how the this series converges to a negative limit please.

seq(evalf[10](eval(sum(2^n*floor(2^n), n = 1 .. N), [N = 10^k])), k = 1 .. 3)

1398100., 0.2142584059e61, 0.1530840927e603

(1)

evalf[10](sum(2^n*floor(2^n), n = 1 .. infinity))

-1.333333333

(2)

``


 

Download WHY_NO_EVAL.mw


 

seq(evalf[10](eval(sum(5^(n-1)*floor((1/4)*5^n), n = 1 .. N), [N = 10^k])), k = 1 .. 3)

0.4967053121e13, 0.3241153791e139, 0.4536359279e1397

(1)

evalf[10](sum(5^(n-1)*floor((1/4)*5^n), n = 1 .. infinity))

sum(5^(n-1)*floor((1/4)*5^n), n = 1 .. infinity)

(2)

``


 

Download WHY_NO_EVAL.mw

We have a hessian matrix in which we want to substitute values of three variables and we are unable to do so...can someone pls help and we also want to calculate the value of the determinant of the matrix
 

A := 2500

2500

(1)

alpha := 4

4

(2)

beta := 0.2e-1

0.2e-1

(3)

c := 5

5

(4)

x[w] := 10

10

(5)

x[1] := 8

8

(6)

delta := 5

5

(7)

t[d] := .5

.5

(8)

a := 20

20

(9)

b := 25

25

(10)

theta := .5

.5

(11)

m := theta*(1-exp(-.5*xi))

.5-.5*exp(-.5*xi)

(12)

TC(t[1], t[2], xi) := (A+alpha*((1/2)*a*t[d]^2+(1/3)*a*t[d]^3)+beta*((1/6)*a*t[d]^3+(1/8)*a*t[d]^4)+t[d]*(a/(theta-m)+b*(t[d]-1/(theta-m))/(theta-m)-exp((theta-m)*(t[1]-t[d]))*(a/(theta-m)+b*(t[1]-1/(theta-m))/(theta-m)))-a*(-6*beta*b-(6*(theta-m))*(-a*beta+alpha*b)+6*(theta-m)^2*(a*beta*t[1]+alpha*b*t[d])+3*b*beta*(theta-m)^2*(-t[1]^2+t[d]^2)+6*a*alpha*(theta-m)^2+2*b*beta*(theta-m)^3*(t[1]^3-t[d]^3)+3*a*beta*(theta-m)^3*(t[1]^2-t[d]^2)+3*b*alpha*(theta-m)^3*(t[1]^2-t[d]^2)+6*a*alpha*(theta-m)^3*(t[1]-t[d])+6*exp((theta-m)*(t[1]-t[d]))*((6*(theta-m))*(-a*beta+alpha*b)-6*b*beta*(theta-m)*(t[1]-t[d])-6*((theta-m)^2*(-b*beta*t[1]*t[d]+a*beta*t[d]+alpha*b*t[1]+a*alpha)+beta*b)))/(6*(theta-m)^4)+x[1]*(2*a*t[2]*delta^2+2*b*t[1]*t[2].(delta^2)+b*t[2]*delta-2*a*delta*ln(delta*t[2]+1)-2*b*ln(delta*t[2]+1)-2*b*t[1]*delta*ln(delta*t[2]+1)-2*b*t[2]*delta*ln(delta*t[2]+1)+2*b*t[2]*delta)/(2*delta^2)+x[w]*(2*a*t[2]*delta^2+b*t[2]^2*delta^2+2*b*t[1]*t[2].(delta^2)+2*a*delta*t[2]+2*b*t[2]*delta*ln(1/(delta*t[2]+1))+2*b*ln(1/(delta*t[2]+1))+2*a*delta*ln(1/(delta*t[2]+1))+2*b*t[1]*delta*ln(1/(delta*t[2]+1)))/(2*delta^3)+c*(a*t[d]+(1/2)*b*t[d]^3+a/(theta-m)+b*(t[d]-1/(theta-m))/(theta-m)-exp((theta-m)*(t[1]-t[d]))*(a/(theta-m)+b*(t[1]-1/(theta-m))/(theta-m))-a*ln(1/(delta*t[2]+1))/delta-b*(1+delta*(t[1]+t[2]))*ln(delta*t[2]+1)/delta^2-b*t[2]/delta))/(t[1]+t[2])

(2571.157291+220.0000000/exp(-.5*xi)+275.0000000*(.5-2.000000000/exp(-.5*xi))/exp(-.5*xi)-5.5*exp(.5*exp(-.5*xi)*(t[1]-.5))*(40.00000000/exp(-.5*xi)+50.00000000*(t[1]-2.000000000/exp(-.5*xi))/exp(-.5*xi))-53.33333334*(-3.00-298.800*exp(-.5*xi)+1.50*(exp(-.5*xi))^2*(.40*t[1]+50.0)+.3750*(exp(-.5*xi))^2*(-t[1]^2+.25)+120.00*(exp(-.5*xi))^2+.12500*(exp(-.5*xi))^3*(t[1]^3-.125)+37.65000*(exp(-.5*xi))^3*(t[1]^2-.25)+60.000*(exp(-.5*xi))^3*(t[1]-.5)+6*exp(.5*exp(-.5*xi)*(t[1]-.5))*(298.800*exp(-.5*xi)-1.500*exp(-.5*xi)*(t[1]-.5)-1.50*(exp(-.5*xi))^2*(99.750*t[1]+80.200)-3.00))/(exp(-.5*xi))^4+243*t[2]+250*t[1]*t[2]-40*ln(5*t[2]+1)-40*t[1]*ln(5*t[2]+1)-40*t[2]*ln(5*t[2]+1)+25*t[2]^2+10*t[2]*ln(1/(5*t[2]+1))-10*ln(1/(5*t[2]+1))+10*t[1]*ln(1/(5*t[2]+1))-5*(1+5*t[1]+5*t[2])*ln(5*t[2]+1))/(t[1]+t[2])

(13)

H := Matrix(3, 3, {(1, 1) = diff(TC(t[1], t[2], xi), t[1], t[1]), (1, 2) = diff(TC(t[1], t[2], xi), t[1], t[2]), (1, 3) = diff(TC(t[1], t[2], xi), t[1], xi), (2, 1) = diff(TC(t[1], t[2], xi), t[1], t[2]), (2, 2) = diff(TC(t[1], t[2], xi), t[2], t[2]), (2, 3) = diff(TC(t[1], t[2], xi), t[2], xi), (3, 1) = diff(TC(t[1], t[2], xi), xi, t[1]), (3, 2) = diff(TC(t[1], t[2], xi), xi, t[2]), (3, 3) = diff(TC(t[1], t[2], xi), xi, xi)})

Matrix(%id = 18446746207931281886)

(14)

t[1] := -64.35385218

-64.35385218

(15)

t[2] := -.1999803

-.1999803

(16)

xi := 8.906818845

8.906818845

(17)

eval(H, {xi = 8.906818845, t[1] = -64.35385218, t[2] = -.1999803})

Error, invalid sequence

"eval(H,{ t[1]:=-64.35385218, t[2]:=-0.1999803, xi:=8.906818845});"

 

``

``


 

Download 1.mw

First 831 832 833 834 835 836 837 Last Page 833 of 2428