## Why the if statement does not work?...

I have a circle equation: F: = x^2+y^2 = 1.
I need to check: x^2+y^2 <= 1.
I tried to get this expression from F like this: lhs(F) <= rhs (F).
The content matches what I need but get: Error, cannot determine if this expression is true or false: x^2+y^2 <= 1.
When I specify just the if x^2+y^2 <= 1 then everything works fine. What am I doing wrong?

## Invalid input algebraic for function...

New to maple here. Having this problem for evaluating my function. If its relevant it is to solve the Ising model analytically. Whats the problem and how do I fix it? Thanks.

## Conditional expectation and filtration...

Hi all

We denote the collecction of sets determined by the first k coin tosses $F_k$

Suppose the imitial stock price is $S_0$ ,with up and down facter being $u$ and $d$.

Up : S1(H)=u S0 and S1(T)=d S0

S_{N+1}= alpha S_N

where alpha =u or d

Let the probability of each $H$ and $T$ be $p$ and $q=1-p$ and   $F_t$ the sigma-lgebra generated by the coin tosses up to (and inchudling) time t:

After three coin tosses.

Can we propose a code computing the element of the filtration F1 and F3 and sigma(S3) (the sigma algebra generated by S3).

For example by hand we have F1={ emptyset, Omega, AH, AT}

Where AH={ w: w1=H}

AT={w: w1=T}

Can we compute

$E[ S_2|F_3] \text { and } E[ S_2|\sigma(S_3) ]$

$E[ \frac{S_2}{S_1} | F_1] \text { and } E[ \frac{S_2}{S_1} | \sigma(S_1) ]$

restart;
with(Finance);
S := [7.9, 7.5, 7.1, 6.5, 5., 3.7, 3.3, 2.95, 2.8];
[7.9, 7.5, 7.1, 6.5, 5., 3.7, 3.3, 2.95, 2.8]
T := BinomialTree(3, S, .3);
TreePlot(T, thickness = 2, axes = BOXED, gridlines = true);

many thanks

## Divide algebraic fraction in a desired form...

Hi! For a process control exercise I'm trying to obtain the coefficients of different powers of the variable to design a PID controller. I have obtained the following equation :

Gc := (s^2*t^2+2*s*t*x+1)*(-b*s+1)/(k(-b*s+1)*s(tc+b))

I want to simplify it into an equation of the following form :

Gc = a( 1 + 1/(b*s) + c*s )

where a, b and c would be determined by Maple from the previous equation. I've tried using simplify() expand(simplify()) in different ways from the documentation and other threads, but to no avail. Any help would be greatly appreciated!

Thanks a lot!

Antoine.

## Unable to get DE functions to start at zero...

Hello all,

I'm trying to do kinetic modeling of sequential dissociations with DE. I'm hitting a snag when modeling the third dissociation. The population should start at zero at t=0, but some of my model functions are non-zero at t=0. Is there anyway to fix this to force the funtions to go through zero?

Scheme:
PPPP -> intermediates -> PPP -> intermediates -> PP -> intermediates -> P
(where P is a subunit and intermediates are confirmational changes before dissociation of a subunit)

a'..d' is the first dissociation
e' is the second dissociation
f'..l' is the third dissociation
Fits are evaluated by the residual sum of squares.

sol := dsolve([a' = -k1*a(x), b' = k1*a(x)-k1*b(x), c' = k1*b(x)-k1*c(x), d' = k1*c(x)-k1*d(x),
e' = k1*d(x)-k2*e(x),
f' = k2*e(x)-k3*f(x), g' = k3*f(x)-k3*g(x), h' = k3*g(x)-k3*h(x), i' = k3*h(x)-k3*i(x), j' = k3*i(x)-k3*j(x), k' = k3*j(x)-k3*k(x), l' = k3*k(x)-k3*l(x),
a(0) = 1, b(0) = 0, c(0) = 0, d(0) = 0, e(0) = 0, f(0) = 0, g(0) = 0, h(0) = 0, i(0) = 0, j(0) = 0, k(0) = 0, l(0) = 0],
{a(x), b(x), c(x), d(x), e(x), f(x), g(x), h(x), i(x), j(x), k(x), l(x)}, method = laplace);

f1 := sol[6];
f1 := rhs(f1);
g1 := sol[7];
g1 := rhs(g1);
h1 := sol[8];
h1 := rhs(h1);
i1 := sol[9];
i1 := rhs(i1);
j1 := sol[10];
j1 := rhs(j1);
kk := sol[11];
kk := rhs(kk);
l1 := sol[12];
l1 := rhs(l1);

xdata := Vector([0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,200,210,220,230,240,250,260,270,280,290,300,310,320,330,340,350,360,370,380,390,400], datatype = float);
ydata := Vector([0.0034,0.00392,0.00184,0.00782,0.01873,0.03683,0.11016,0.09838,0.18402,0.24727,0.20901,0.2972,0.37635,0.49235,0.57845,0.4457,0.50285,0.5672,0.62783,0.57264,0.54918,0.44792,0.49795,0.55218,0.47512,0.46473,0.37989,0.32236,0.3323,0.20894,0.28473,0.21273,0.19855,0.13548,0.12725,0.13277,0.0784,0.07969,0.06162,0.03855], datatype = float);

k1 := 0.391491454107626e-1;
k2 := 0.222503562261129e-1;

z1:=f1;
z2:=f1+g1;
z3:=f1+g1+h1;
z4:=f1+g1+h1+i1;
z5:=f1+g1+h1+i1+j1;
z6:=f1+g1+h1+i1+j1+kk;
z7:=f1+g1+h1+i1+j1+kk+l1;

Statistics[NonlinearFit](z1,xdata, ydata, x, initialvalues = [k3=0.1], output = [parametervalues, residualsumofsquares]);
A:=plot(xdata, ydata, style=point, symbol=solidcircle, color=blue, symbolsize=12,labels = ["time (minutes)", "Relative Abundance"], labeldirections = [horizontal, vertical]):
F:=Statistics[NonlinearFit](z1,xdata, ydata, x,initialvalues = [k3=0.1]):
B:=plot(F, x=xdata[1]..xdata[-1], color=red):
plots[display](A, B);

Statistics[NonlinearFit](z2,xdata, ydata, x, initialvalues = [k3=0.1], output = [parametervalues, residualsumofsquares]);
A:=plot(xdata, ydata, style=point, symbol=solidcircle, color=blue, symbolsize=12,labels = ["time (minutes)", "Relative Abundance"], labeldirections = [horizontal, vertical]):
F:=Statistics[NonlinearFit](z2,xdata, ydata, x,initialvalues = [k3=0.1]):
B:=plot(F, x=xdata[1]..xdata[-1], color=red):
plots[display](A, B);

Statistics[NonlinearFit](z3,xdata, ydata, x, initialvalues = [k3=0.1], output = [parametervalues, residualsumofsquares]);
A:=plot(xdata, ydata, style=point, symbol=solidcircle, color=blue, symbolsize=12,labels = ["time (minutes)", "Relative Abundance"], labeldirections = [horizontal, vertical]):
F:=Statistics[NonlinearFit](z3,xdata, ydata, x,initialvalues = [k3=0.1]):
B:=plot(F, x=xdata[1]..xdata[-1], color=red):
plots[display](A, B);

Statistics[NonlinearFit](z4,xdata, ydata, x, initialvalues = [k3=0.1], output = [parametervalues, residualsumofsquares]);
A:=plot(xdata, ydata, style=point, symbol=solidcircle, color=blue, symbolsize=12,labels = ["time (minutes)", "Relative Abundance"], labeldirections = [horizontal, vertical]):
F:=Statistics[NonlinearFit](z4,xdata, ydata, x,initialvalues = [k3=0.1]):
B:=plot(F, x=xdata[1]..xdata[-1], color=red):
plots[display](A, B);

Statistics[NonlinearFit](z5,xdata, ydata, x, initialvalues = [k3=0.1], output = [parametervalues, residualsumofsquares]);
A:=plot(xdata, ydata, style=point, symbol=solidcircle, color=blue, symbolsize=12,labels = ["time (minutes)", "Relative Abundance"], labeldirections = [horizontal, vertical]):
F:=Statistics[NonlinearFit](z5,xdata, ydata, x,initialvalues = [k3=0.1]):
B:=plot(F, x=xdata[1]..xdata[-1], color=red):
plots[display](A, B);

Statistics[NonlinearFit](z6,xdata, ydata, x, initialvalues = [k3=0.1], output = [parametervalues, residualsumofsquares]);
A:=plot(xdata, ydata, style=point, symbol=solidcircle, color=blue, symbolsize=12,labels = ["time (minutes)", "Relative Abundance"], labeldirections = [horizontal, vertical]):
F:=Statistics[NonlinearFit](z6,xdata, ydata, x,initialvalues = [k3=0.1]):
B:=plot(F, x=xdata[1]..xdata[-1], color=red):
plots[display](A, B);

Statistics[NonlinearFit](z7,xdata, ydata, x, initialvalues = [k3=0.1], output = [parametervalues, residualsumofsquares]);
A:=plot(xdata, ydata, style=point, symbol=solidcircle, color=blue, symbolsize=12,labels = ["time (minutes)", "Relative Abundance"], labeldirections = [horizontal, vertical]):
F:=Statistics[NonlinearFit](z7,xdata, ydata, x,initialvalues = [k3=0.1]):
B:=plot(F, x=xdata[1]..xdata[-1], color=red):
plots[display](A, B);

3rd_diss.mw

## Physics Package - Question to new features for ten...

Hi,

I have a private license of Maple 2018, and am interested in advances in terms of tensor calculus in Maple 2019, in particular concerning applications in general relativity. Three questions:

(1) Is there a way for me to buy the package without having to buy Maple 2019 in full, or would I have to upgrade?

(2) I have seen in the preview video that the features can for instance calculate the Christoffel symbols, the Rieman tensor, etc., from a prescribed metric in a coordinate basis, correct? Can the formalism also handle Expressions expressed in a non-coordinate frame though? So a frame field, for which the commutaror of the basis vector fields does not vanish?

(3) Is there somewhere a nice documentation, with exaples, where I can read on what I can do with the package? The documentation in the "what's new" section on the website is mainly concerned with applications for quantum mechanics, which is not what I am interested in.

Cheers!

## Maple 2019 mw file format issue...

If I create  and save a worksheet in Maple 2019, then try to up load it here, it uploads but contents won't display

No issue if I have an "identical" worksheet in Maple 2018.

See the attachment attempts below

#### Result of trying to upload Maple 2019 file here

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/fibon2019.mw .

But "same" file from Maple 2018 "works"

 > # # Recursive Fibonacci generator #   myFib:= proc(n::integer)                option remember;                if   n=1                then return 1                elif n=0                then return 0                else return myFib(n-1)+myFib(n-2):                fi:           end proc:   seq(myFib(j), j=0..20);
 (1)
 >

## Parallel processing ...

Hello,

I have a matrix of size m*n and I want to apply a procedure "f" to each entry of the matrix. But I want to do this in parallel to reduce the computation time.

I used: Matrix(n, m, (i,j) -> Grid:-Seq( f (M (i,j) ) ,i=1..n, j=1..m) );

but I'm not satisfied with the result, I want the calculation to be faster. Are there any other methods?

## Error in Maple program. ...

Dear All,

Gretting from me. I have faced a problem in Maple program due to some errors. Could you please help me about the solution of that problem?
Thanks

@Preben Alsholm
@tomleslie
Sourse File: solution.mw

## why still not able to install Physics package from...

I've always had problems installing Physics package from inside Maple.

I thought by buying Maple 2019 this problem will go away, but I am still not able to install this package.

I get this error

Fetching package "Physics Updates" from MapleCloud...
ID: 5137472255164416
Version: 326
URL: https://maple.cloud

File size is 10764288 bytes(10 MB).

Installing package...

ERROR: The package could not be installed.
error PackageTools:-Install, "this package is intended to work
with Maple %1; it can not be installed in the version you
are using -- %2", "2018", "2019"

Here is screen shot

I am on windows 10 professional. Maple 2019 installed with no problems.

any suggestion to try (other what was suggeted in link at top, which is to manually download the physics package each time and update maple.ini to point to the new version)?

Is Physics package updated to work/install in Maple 2019 or does one need to wait few more days untill this happens?

## How do I solve a DE in maple it shows me an error...

I cant get the error. Any one can help me?

restart;
with(plots);
r := 0.5e-2; k := 10000; a := .4; alpha := .25; epsilon := 0.2e-1; mu := 0.4e-1; delta := 0.3e-2; Lambda := 0.2e-1;
beta[2] := .45; beta[1] := .2; c[1] := 2; c[2] := 5; w[1] := 10; w[2] := 30; T := 3;
u[1] := min(max(0, z), 1); z := beta[2]*s(t)*i(t)*(lambda[2](t)-lambda[1](t))/(w[1]*(s(t)+i(t)+e(t))); u[2] := min(max(0, c), 1); c := (beta[1]*s(t)*p(t).(lambda[2](t)-lambda[1](t)))/(w[2]*(a+p(t)))+(lambda[2](t).e(t)+(i(t)+alpha.e(t)).lambda[3](t)-(gamma.i(t)+p(t)).lambda[4](t))/w[2];

sys := diff(s(t), t) = r*s(t)*(1-(s(t)+i(t)+e(t))/k)-beta[1]*s(t)*p(t)*(1-u[2])/(a+p(t))-beta[2]*s(t)*i(t)*(1-u[1])/(s(t)+i(t)+e(t)), diff(e(t), t) = beta[1]*s(t)*p(t)*(1-u[2])/(a+p(t))+beta[2]*s(t)*i(t)*(1-u[1])/(s(t)+i(t)+e(t))-(mu+alpha+u[2])*e(t), diff(i(t), t) = (alpha+u[2]).e(t)-(mu+epsilon+u[2])*i(t), diff(p(t), t) = Lambda+(epsilon+u[2]).i(t)-delta*p(t), diff(lambda[1](t), t) = -lambda[1](t)*(r*(1-(2*s(t)+i(t)+e(t))/k)-beta[1]*p(t)*(1-u[2])/(a+p(t))-beta[2]*i(t)*(1-u[1])/(s(t)+i(t)+e(t)))-lambda[2](t).(beta[1]*p(t)*(1-u[2])/(a+p(t))-beta[2]*i(t)*(1-u[1])/(s(t)+i(t)+e(t))), diff(lambda[2](t), t) = -c[1]+lambda[1](t)*r*s(t)/k+lambda[2](t)*(mu+alpha+u[2])-(1-u[2]).alpha.lambda[3](t), diff(lambda[3](t), t) = -c[2]+lambda[1](t).(r*s(t)/k+beta[2]*s(t)*(1-u[1])/(s(t)+i(t)+e(t)))-lambda[2](t)*beta[2]*s(t)*(1-u[1])/(s(t)+i(t)+e(t))+lambda[3](t)*(u[2]+mu+gamma)-lambda[4](t).gamma.(1-u[2]), diff(lambda[4](t), t) = ((lambda[1](t).beta[1])*s(t).a.(1-u[2]))/(a+p(t))^2-((lambda[2](t).beta[1])*s(t).a.(1-u[2]))/(a+p(t))^2-lambda[4](t)*(delta+u[2]), s(0) = 1000, e(0) = 10, i(0) = 0, p(0) = 100, lambda[1](T) = 0, lambda[2](T) = 0, lambda[3](T) = 0, lambda[4](T);
p1 := dsolve({sys}, type = numeric, abserr = 0.1e-3, maxmesh = 2400);
Error, (in fproc) unable to store '-1.*HFloat(0.0)[1]' when datatype=float[8]
p2o := odeplot(p1, [t, i(t)], 0 .. 2, numpoints = 100, labels = ["Time (months)", " infectious "*Maize"], labeldirections = [horizontal, vertical], style = line, color = red, axes = boxed);
Error, (in plots/odeplot) input is not a valid dsolve/numeric solution

## Solution of the boundary value problem for ODE usi...

Example of Duffing equation with boundary conditions.
y'' + 0.2y' + y^3 - 0.3cos(s) = 0;
y(0) = y (2Pi);
y'(0) = y'(2Pi);
For convenience, we replace the original equation with a system of two first order equations:
--------------------------------------------------------------------------
x1'(t) = 2*Pi*x2(t);
x2'(t) = - 0.4*Pi*x2(t) - 2*Pi*x1(t)^3 +0.6*Pi*cos(2*Pi*t);
x1(0) = x1(1);
x2(0) = x2(1);
--------------------------------------------------------------------------
I have long wanted to apply an optimization package to solve a boundary value problem for ODE. The decision helped procedure for solving ODE, written by forum member vv.
It seems to me that two solutions have been found and that the solutions are weakly sensitive to the initial approximations. These are two closed trajectories. For example, these are points that belong to these solutions:
(0.5966963,  1.0482816) , ( - 0.3132584, 0.0664941).
I am wondering: are the solutions right, and how justified is the use of optimization methods for such tasks?
At the end of the program, the solution is checked on the original Duffing equation using standard Maple functions.   Duffing_equation_BC.mw

(In the figures, the trajectory bypass occurs three times.)

## evaluate a modulo n mod 2; where n is an integer...

For some reason when I do n mod 2, it spits out n. Im trying to figure out what is wrong. I have to evaluate at two points in order for this to work. modulo.mw

Thanks

## Probably a singularity in system of ODE...

Hello,

I have a problem in the solution of this system of ODEs:

de[1] := M*(diff(x(t), t, t))+sum(FxjR, j = 1 .. m)+sum(FxjL, j = 1 .. m) = M*g+Us*omIn^2*cos(omIn*t); ini[1] := x(10^(-6)) = 1.00013081730872*10^(-6); ini[2] := (D(x))(10^(-6)) = 0.261632327671976e-3;

de[2] := M*(diff(y(t), t, t))+sum(FyjR, j = 1 .. m)+sum(FyjL, j = 1 .. m) = Us*omIn^2*sin(omIn*t); ini[3] := y(10^(-6)) = 9.99989124246935*10^(-8); ini[4] := (D(y))(10^(-6)) = -2.50318090194868*10^(-6);

de[3] := M*(diff(z(t), t, t))+sum(FzjR, j = 1 .. m)+sum(FzjL, j = 1 .. m) = 0; ini[5] := z(10^(-6)) = 9.99065455347471*10^(-9); ini[6] := (D(z))(10^(-6)) = -0.186933812655399e-4;

de[4] := Ix*(diff(thx(t), t, t))+Iz*(diff(thy(t), t))*omIn+sum(MxjL, j = 1 .. m)-sum(MxjR, j = 1 .. m) = 0; ini[7] := thx(10^(-6)) = 8.60546055625759*10^(-7); ini[8] := (D(thx))(10^(-6)) = 1.72109307183424;

de[5] := Iy*(diff(thy(t), t, t))-Iz*(diff(thx(t), t))*omIn+sum(MyjL, j = 1 .. m)-sum(MyjR, j = 1 .. m) = 0; ini[9] := thy(10^(-6)) = 1.02142988540396*10^(-10); ini[10] := (D(thy))(10^(-6)) = 0.285764338010142e-3;

sys_ode := seq(de[n], n = 1 .. 5);
ICs := seq(ini[n], n = 1 .. 10);
F := dsolve([sys_ode, ICs], type = numeric, range = 10^(-6) .. 0.1);

Then I found this response:

Warning, cannot evaluate the solution further right of .10473416e-4, probably a singularity
F:=proc(x_rkf45) ... end proc

The details of the parameters inside the SUMMATION sign are very complicated and it is useless to mention them (in my point of view). Each one of (FxjR) and its similars is more than 20 Word pages, so it is useless to mention, but I can confirm that all of them include the (time and the 5 variables of ODE and their first derivatives only).

How can I solve that?
Any ideas to get rid of this singularity problem?

I am thinking of using a fixed step method, but I do not know if this will solve the problem? Also, I do not know how can I use a fixed step and what are the methods that use fixed step in maple?

## Repunits and primes...

I am trying to write a code to calculate, for a given prime p the string length k of the repunit

R_k=1111111....1111 (with k 1s) such that the number R_kpR_k is prime.

Example: If p=59, then k=42 is the smallest k such that R_k59R_k is prime. Note that for some primes it can be shown that no such k exists (2,11,37,101..)

I can usually figure out from the factor cycle of a “repunit wrapped” prime whether such a k exists or not. But if the indications are that a k does exist then finding it is very time consuming. Eg for p =71, 167.

What i want to do, for given p is set an upper limit N for k then check to see if R_kpR_k is prime for values of k from 1 to N

The bit I can’t handle is expressing the “wrapped” number for a given p and k, and also indexing from k to k+1, until N is reached or a prime found.

Best regards

David.

 First 402 403 404 405 406 407 408 Last Page 404 of 2119
﻿