## System of equations in matrix form...

I have a system of equations e.g.

A^2+B*A+C=0

where A,B,C are Matrices and I want to solve for A.

Sure I can write every equations in brakets [..=0], but isn'T it possible to just use the matrix notation?

## Error in dsolve/numeric/bvp...

I've been trying to numerically solve (and plot) this equation. Maple tells me that some matrix is singular - I have no idea, what I can do.

eq := diff(y(x), \$(x, 3))-(diff(y(x), x))*(diff(y(x), x))+1 = 0;

cond := (D(y))(0) = 0, (D(y))(1) = 1, ((D@@2)(y))(0) = 0

de := dsolve({cond, eq}, y(x), numeric);

Error, (in dsolve/numeric/bvp) matrix is singular

## Stability of system...

How I can found stabilty of system by Routh, Jury, Liapunov, Nequist on maple?

## Point plot from two arrays...

The array is:

N := vector (20, x -> y[x]);

The maple creat the array

The other is:

N := vector (20, x -> y[x]);

Where y[x] are a list

I do plot

plot( M,N);

But the plot is many lines with the value of the array, i want the fist coordenates of the N with fist coordenate for the M in points or line.

Thanks

## The fsolve command fails, solve doesn't...

Hi Maple community

I'm running an algorithm where a non-linear equation system must be solved, in this case is a 26x26 system.

After 16116 succesful previous computations, fsolve stops giving me results.
I checked why and I was first expecting that, for some reason, the 26x26 system had an error and I ended with something like 25x26 or vice versa. But that was not the case.

So I tried the command solve and it not only worked fine but also gave me two results, but I only need one. I guess I could check for the wrong solution and discard it, but I still wondering why fsolve is failing and if there is anything to help fsolve not to fail.

These are the set of equations if somebody wants to check them:

EQ[16117][1] := W[1, 16117]*(-0.3860115660e-1*HRa[1, 16117]-0.1876793978e-1*ga[1, 16117]+0.7836678184e-1) = 2.040147478*10^6*SR[1, 16118], W[1, 16117]*(-0.3915554290e-1*HRa[1, 16117]-0.1903748329e-1*ga[1, 16117]+0.8260795999e-1) = 3.876387504, W[1, 16117]*(-0.1876794098e-1*HRa[1, 16117]-0.9892449327e-2*ga[1, 16117]+0.3810204607e-1) = 2.040147478*10^6*v[1, 16118], HLa[1, 16117] = .9724029753*ga[1, 16117]+HRa[1, 16117], NRa[1, 16117] = 0.7006679273e-1*HRa[1, 16117]-.1803623678*ga[1, 16117]+1.002451672, NLa[1, 16117] = 0.7006679273e-1*HRa[1, 16117]+.2484955248*ga[1, 16117]+1.002451672, SL[2, 16118] = SR[1, 16118], fra[1, 16117] = HRa[1, 16117]-HLa[2, 16117], fra[1, 16117] = .25*NRa[1, 16117]+.25*NLa[2, 16117], ga[1, 16117] = 0.;

EQ[16117][2] := W[2, 16117]*(-0.3860115660e-1*HRa[2, 16117]-0.1876793978e-1*ga[2, 16117]+0.7836678184e-1) = -2.040147478*10^6*SL[2, 16118]+7.152482840, W[2, 16117]*(-0.3915554290e-1*HRa[2, 16117]-0.1903748329e-1*ga[2, 16117]+0.8260795999e-1) = 3.876387504, W[2, 16117]*(-0.1876794098e-1*HRa[2, 16117]-0.9892449327e-2*ga[2, 16117]+0.3810204607e-1) = -1.983845478*10^6*SL[2, 16118]+5.221405977, HLa[2, 16117] = .9724029753*ga[2, 16117]+HRa[2, 16117], NRa[2, 16117] = 0.7006679273e-1*HRa[2, 16117]-.1803623678*ga[2, 16117]+1.002451672, NLa[2, 16117] = 0.7006679273e-1*HRa[2, 16117]+.2484955248*ga[2, 16117]+1.002451672, SL[3, 16118] = 0.3505865589e-5, fra[2, 16117] = HRa[2, 16117]-HLa[3, 16117];

EQ[16117][3] := W[3, 16117]*(-0.3860115660e-1*HRa[3, 16117]-0.1876793978e-1*ga[3, 16117]+0.7836678184e-1) = -2.040147478*10^6*SL[3, 16118]+10.82168541, W[3, 16117]*(-0.3915554290e-1*HRa[3, 16117]-0.1903748329e-1*ga[3, 16117]+0.8260795999e-1) = 3.876387504, W[3, 16117]*(-0.1876794098e-1*HRa[3, 16117]-0.9892449327e-2*ga[3, 16117]+0.3810204607e-1) = -1.983845478*10^6*SL[3, 16118]+8.751240594, HLa[3, 16117] = .9724029753*ga[3, 16117]+HRa[3, 16117], NRa[3, 16117] = 0.7006679273e-1*HRa[3, 16117]-.1803623678*ga[3, 16117]+1.002451672, NLa[3, 16117] = 0.7006679273e-1*HRa[3, 16117]+.2484955248*ga[3, 16117]+1.002451672, SL[4, 16118] = 0.5304364281e-5, fra[3, 16117] = HRa[3, 16117];

And after these the solving command that I used was:

SOL[j]:=fsolve({seq(EQ[j][n],n=1..N)},indets({entries(EQ[j],nolist)},assignable(name)));

Which returns

SOL[j]:=

As I said, then I tried the solve command:

SOL[j]:=solve({seq(EQ[j][n],n=1..N)},indets({entries(EQ[j],nolist)},assignable(name)));

which returns:

SOL[16117] :=

{HLa[1, 16117] = 1.011251860, HLa[2, 16117] = .5007913055, HLa[3, 16117] = -0.4240068535e-1, HRa[1, 16117] = 1.011251860, HRa[2, 16117] = .8728245835, HRa[3, 16117] = .2686716410, NLa[1, 16117] = 1.073306847, NLa[2, 16117] = .9685353734, NLa[3, 16117] = .9417827567, NRa[1, 16117] = 1.073306847, NRa[2, 16117] = 1.132612831, NRa[3, 16117] = 1.078974668, SL[2, 16118] = 0.1737463747e-5, SL[3, 16118] = 0.3505865589e-5, SL[4, 16118] = 0.5304364281e-5, SR[1, 16118] = 0.1737463747e-5, W[1, 16117] = 90.12372195, W[2, 16117] = 69.57451714, W[3, 16117] = 49.58407210, fra[1, 16117] = .5104605550, fra[2, 16117] = .9152252689, fra[3, 16117] = .2686716410, ga[1, 16117] = 0., ga[2, 16117] = -.3825916698, ga[3, 16117] = -.3199006320, v[1, 16118] = 8.447574110*10^(-7)},

{HLa[1, 16117] = 3.043461992, HLa[2, 16117] = 2.386862361, HLa[3, 16117] = -0.4240068535e-1, HRa[1, 16117] = 3.043461992, HRa[2, 16117] = 1.087485894, HRa[3, 16117] = .2686716410, NLa[1, 16117] = 1.215697293, NLa[2, 16117] = 1.410701230, NLa[3, 16117] = .9417827567, NRa[1, 16117] = 1.215697293, NRa[2, 16117] = .8376385519, NRa[3, 16117] = 1.078974668, SL[2, 16118] = 0.2032780481e-5, SL[3, 16118] = 0.3505865589e-5, SL[4, 16118] = 0.5304364281e-5, SR[1, 16118] = 0.2032780481e-5, W[1, 16117] = -106.0268094, W[2, 16117] = 265.7250566, W[3, 16117] = 49.58407210, fra[1, 16117] = .6565996307, fra[2, 16117] = 1.129886580, fra[3, 16117] = .2686716410, ga[1, 16117] = 0., ga[2, 16117] = 1.336253076, ga[3, 16117] = -.3199006320, v[1, 16118] = 9.883410782*10^(-7)}

Thanks in advance for any recommendations and suggestions.

## Results of TwoSampleTTest...

Hi,

I did some hypothesis testing exercises and I cross checked the result with Maple. I just used following vectors for an unpaired test

a := [88, 89, 92, 90, 90];
b := [92, 90, 91, 89, 91];

I ended up with the following solution:

HFloat(1.5225682336585966)
HFloat(-3.122568233658591)
for a 0.95 confidence interval.

Using

TwoSampleTTest(a, b, 0, confidence = .95, summarize = embed)

and

TwoSampleTTest(a, b, 0, confidence = .975, summarize = embed)

I get following results:

-2.75177 .. 1.15177

-3.13633 .. 1.53633

respectively. I can not explain the discrepancy.

Best regards,

Oliver

PS:

Maple Code in case files won´t be attached.

Unpaired t Test
restart;
Unpaired test-test dataset
a := [88, 89, 92, 90, 90];
b := [92, 90, 91, 89, 91];
The seÂ² estimate is given by:
seÂ²=var(a)+var(b)+2*cov(a*b)=var(a)+var(b)
seÂ²=
sigma[a]^2/Na+sigma[b]^2/Nb;
with Na, Nb being the length of vector a and b respectively.
2                              2
sigma[[88, 89, 92, 90, 90]]    sigma[[92, 90, 91, 89, 91]]
---------------------------- + ----------------------------
Na                             Nb
sigma[a]^2;
and
sigma[b]^2;
are approximated by
S[a]^2;
and
S[b]^2;
2
sigma[[88, 89, 92, 90, 90]]
2
sigma[[92, 90, 91, 89, 91]]
2
S[[88, 89, 92, 90, 90]]
2
S[[92, 90, 91, 89, 91]]
with
S[X]^2;
defined as
S[X]*Â² = (sum(X[i]-(sum(X[j], j = 1 .. N))/N, i = 1 .. N))^2/N;
2
S[X]
2
/      /         N       \\
|      |       -----     ||
|  N   |        \        ||
|----- |         )       ||
| \    |        /    X[j]||
|  )   |       -----     ||
| /    |       j = 1     ||
|----- |X[i] - ----------||
\i = 1 \           N     //
S[X] ï¿ï¾² = ----------------------------
N
with(Statistics);
Sa := Variance(a);
HFloat(2.1999999999999993)
Sb := Variance(b);
HFloat(1.3000000000000003)
Now we are ready to do hypothesis testing (0.95).
We have (with k=min(Na,Nb)=5):
C = mean(a)-mean(b); Deviation := t_(alpha/a, k-1)*se(Sa/k-Sb/k);
c := Mean(a)-Mean(b); deviation := 2.776*sqrt((1/5)*Variance(a)+(1/5)*Variance(b));
HFloat(-0.7999999999999972)
HFloat(2.3225682336585938)
upperlimit := c+deviation; lowerlimit := c-deviation;
HFloat(1.5225682336585966)
HFloat(-3.122568233658591)

Execution of built in student test
TwoSampleTTest(a, b, 0, confidence = .95, summarize = embed);

How can I modify the appearance of the arrowheads on the vectors displayed in phaseportrai? In particular, how can I "fill in" the arrowheads so that the arrowhead is not just an outline?

My code is:

phaseportrait([D(x)(t)=-0.4*x(t)+(0.5+4*x(t))*y(t),D(y)(t)=0.4*x(t)-(4.5+4*x(t))*y(t)],[x(t),y(t)],t=0..100,[[x(0)=1,y(0)=0.0]],x=0..1,y=0..0.1,stepsize=0.01,scaling=UNCONSTRAINED,linecolour=BLACK,dirgrid=[17,17],linestyle=1,arrows=SLIM,axes=BOXED);

Thank you

## Get pdoslve/numeric value ...

Hi evrey ones in pdsolve we have these commande to use U(x,t)

> U:= subs(pds:-value(output=listprocedure), u(x,t));


id like to get du(x,t)/dt

i tried these

U:= subs(pds:-value(output=listprocedure), du(x,t)/dt);  but is not work

thank you

## Problem with plot...

Hi

I want to draw  plot y(x) against x but I can't. a, b , _C1 are parameter.

## Where is oscilloscope icon?...

where i can found oscilloscope icon for cisuit simulation?thanks

## Error in optimal control problem...

I am unable to solve the attached optimal control problem,please any one who many help  me in guideing .tnx

restart:
unprotect('gamma');

L:=b[1]*c(t)+b[2]*i(t)+w[1]*(u[1])^2/2+w[2]*(u[2])^2/2+w[3]*(u[3])^2/2;
1 2 1 2 1 2
b[1] c(t) + b[2] i(t) + - w[1] u[1] + - w[2] u[2] + - w[3] u[3]
2 2 2
H:=L+lambda[1](t)*((1-p*Psi)*tau+phi* v + delta *r-lambda*(1-u[3])*s-u[1]*varphi*s -mu*s ) +lambda[2](t)*(p*Psi*tau + u[1]*vartheta*s -gamma*lambda* (1-u[3])*v-(mu+phi)*v ) +lambda[3](t)*( (1-u[3])*rho*lambda* (s +gamma*v)+(1-q)* u[2]*eta*i -(mu +beta +chi)*c ) +lambda[4](t)* ((1-rho)*(1-u[3])*lambda*( s +gamma*v) +chi*c - u[2]*eta*i - (mu +alpha )*i) +lambda[5](t)*( beta*c + u[2]*q*eta*i -(mu +delta)*r);
1 2 1 2 1 2
b[1] c(t) + b[2] i(t) + - w[1] u[1] + - w[2] u[2] + - w[3] u[3] + lambda[1](t
2 2 2

) ((1 - p Psi) tau + phi v + delta r - lambda (1 - u[3]) s - u[1] varphi s

- mu s) + lambda[2](t) (p Psi tau + u[1] vartheta s

- gamma lambda (1 - u[3]) v - (mu + phi) v) + lambda[3](t) ((1 - u[3]) rho

lambda (s + gamma v) + (1 - q) u[2] eta i - (mu + beta + chi) c) + lambda[4](t

) ((1 - rho) (1 - u[3]) lambda (s + gamma v) + chi c - u[2] eta i

- (mu + alpha) i) + lambda[5](t) (beta c + u[2] q eta i - (mu + delta) r)
du1:=diff(H,u[1]);

w[1] u[1] - lambda[1](t) varphi s + lambda[2](t) vartheta s
du2:=diff(H,u[2]);du3:=diff(H,u[3]);
w[2] u[2] + lambda[3](t) (1 - q) eta i - lambda[4](t) eta i

+ lambda[5](t) q eta i
w[3] u[3] + lambda[1](t) lambda s + lambda[2](t) gamma lambda v

- lambda[3](t) rho lambda (s + gamma v)

- lambda[4](t) (1 - rho) lambda (s + gamma v)

ddu1 := -A[1] u[1] + psi[1](t) beta x[1] x[3] - psi[2](t) beta x[1] x[3]

ddu2 := -A[2] u[2] - psi[3](t) k x[2]
sol_u1 := solve(du1, u[1]);
s(t) (lambda[1](t) varphi - lambda[2](t) vartheta)
--------------------------------------------------
w[1]
sol_u2 := solve(du2, u[2]);sol_u3 := solve(du3, u[3]);
eta i (-lambda[3](t) + lambda[3](t) q + lambda[4](t) - lambda[5](t) q)
----------------------------------------------------------------------
w[2]
1
---- (lambda (-lambda[1](t) s - lambda[2](t) gamma v + lambda[3](t) rho s
w[3]

+ lambda[3](t) rho gamma v + lambda[4](t) s + lambda[4](t) gamma v

- lambda[4](t) rho s - lambda[4](t) rho gamma v))
Dx2:=subs(u[1]= s*(lambda[1](t)*varphi-lambda[2](t)*vartheta)/w[1] ,u[2]= eta*i*(-lambda[3](t)+lambda[3](t)*q+lambda[4](t)-lambda[5](t)*q)/w[2], u[3]=-lambda*(lambda[1](t)*s+lambda[2](t)*gamma*v-lambda[3](t)*rho*s-lambda[3](t)*rho*gamma*v-lambda[4](t)*s-lambda[4](t)*gamma*v+lambda[4](t)*rho*s+lambda[4](t)*rho*gamma*v)/w[3] ,H );
2 2
s (lambda[1](t) varphi - lambda[2](t) vartheta)
b[1] c(t) + b[2] i(t) + -------------------------------------------------
2 w[1]

2 2 2
eta i (-lambda[3](t) + lambda[3](t) q + lambda[4](t) - lambda[5](t) q)
+ ------------------------------------------------------------------------- +
2 w[2]

1 / 2
------ \lambda (lambda[1](t) s + lambda[2](t) gamma v - lambda[3](t) rho s
2 w[3]

- lambda[3](t) rho gamma v - lambda[4](t) s - lambda[4](t) gamma v

/
\ |
+ lambda[4](t) rho s + lambda[4](t) rho gamma v)^2/ + lambda[1](t) |(1
\

/ 1
- p Psi) tau + phi v + delta r - lambda |1 + ---- (lambda (lambda[1](t) s
\ w[3]

+ lambda[2](t) gamma v - lambda[3](t) rho s - lambda[3](t) rho gamma v

- lambda[4](t) s - lambda[4](t) gamma v + lambda[4](t) rho s

\
+ lambda[4](t) rho gamma v))| s
/

2 \
s (lambda[1](t) varphi - lambda[2](t) vartheta) varphi |
- ------------------------------------------------------- - mu s| +
w[1] /

/
|
lambda[2](t) |p Psi tau
\

2
s (lambda[1](t) varphi - lambda[2](t) vartheta) vartheta /
+ --------------------------------------------------------- - gamma lambda |1 +
w[1] \

1
---- (lambda (lambda[1](t) s + lambda[2](t) gamma v - lambda[3](t) rho s
w[3]

- lambda[3](t) rho gamma v - lambda[4](t) s - lambda[4](t) gamma v

\
\ |
+ lambda[4](t) rho s + lambda[4](t) rho gamma v))| v - (mu + phi) v| +
/ /

// 1
lambda[3](t) ||1 + ---- (lambda (lambda[1](t) s + lambda[2](t) gamma v
\\ w[3]

- lambda[3](t) rho s - lambda[3](t) rho gamma v - lambda[4](t) s

\
- lambda[4](t) gamma v + lambda[4](t) rho s + lambda[4](t) rho gamma v))|
/

1 / 2 2
rho lambda (s + gamma v) + ---- \(1 - q) eta i (-lambda[3](t)
w[2]

\ \
+ lambda[3](t) q + lambda[4](t) - lambda[5](t) q)/ - (mu + beta + chi) c| +
/

/
| / 1
lambda[4](t) |(1 - rho) |1 + ---- (lambda (lambda[1](t) s
\ \ w[3]

+ lambda[2](t) gamma v - lambda[3](t) rho s - lambda[3](t) rho gamma v

- lambda[4](t) s - lambda[4](t) gamma v + lambda[4](t) rho s

\
+ lambda[4](t) rho gamma v))| lambda (s + gamma v) + chi c
/

2 2
eta i (-lambda[3](t) + lambda[3](t) q + lambda[4](t) - lambda[5](t) q)
- ------------------------------------------------------------------------
w[2]

\ /
| |
- (mu + alpha) i| + lambda[5](t) |beta c
/ \

+

2 2
eta i (-lambda[3](t) + lambda[3](t) q + lambda[4](t) - lambda[5](t) q) q
--------------------------------------------------------------------------
w[2]

\
|
- (mu + delta) r|
/
ode1:=diff(lambda[1](t),t)=-diff(H,s);ode2:=diff(lambda[2](t),t)=-diff(H,v);ode3:=diff(psi[3](t),t)=-diff(H,c);ode4:=diff(lambda[4](t),t)=-diff(H,i);ode5:=diff(lambda[5](t),t)=-diff(H,r);
d
--- lambda[1](t) = -lambda[1](t) (-lambda (1 - u[3]) - u[1] varphi - mu)
dt

- lambda[2](t) u[1] vartheta - lambda[3](t) (1 - u[3]) rho lambda

- lambda[4](t) (1 - rho) (1 - u[3]) lambda
d
--- lambda[2](t) = -lambda[1](t) phi
dt

- lambda[2](t) (-gamma lambda (1 - u[3]) - mu - phi)

- lambda[3](t) (1 - u[3]) rho lambda gamma

- lambda[4](t) (1 - rho) (1 - u[3]) lambda gamma
d
--- psi[3](t) = -lambda[3](t) (-mu - beta - chi) - lambda[4](t) chi
dt

- lambda[5](t) beta
d
--- lambda[4](t) = -lambda[3](t) (1 - q) u[2] eta
dt

- lambda[4](t) (-u[2] eta - mu - alpha) - lambda[5](t) u[2] q eta
d
--- lambda[5](t) = -lambda[1](t) delta - lambda[5](t) (-mu - delta)
dt
restart:
#Digits:=10:

unprotect('gamma');
lambda:=0.51:
mu:=0.002:
beta:=0.0115:
delta:=0.003:
alpha:=0.33:
chi:=0.00274:
k:=6.24:
gamma:=0.4:
rho:=0.338:;tau=1000:;Psi:=0.1:;p:=0.6:;phi:=0.001:;eta:=0.001124:q:=0.6:varphi:=0.9:;vatheta:=0.9:
b[1]:=2:;b[2]:=3:;w[1]:=4:;w[2]:=5:;w[3]:=6:
#u[1]:=s(t)*(lambda[1](t)*varphi-lambda[2](t)*vartheta)/w[1]:
#u[2]:=eta*i*(-lambda[3](t)+lambda[3](t)*q+lambda[4](t)-lambda[5](t)*q)/w[2]:;u[3]:=lambda*(-lambda[1](t)*s-lambda[2](t)*gamma*v+lambda[3](t)*rho*s+lambda[3](t)*rho*gamma*v+lambda[4](t)*s+lambda[4](t)*gamma*v-lambda[4](t)*rho*s-lambda[4](t)*rho*gamma*v)/w[3]:
ics := s(0)=8200, v(0)=2800,c(0)=1100,i(0)=1500,r(0)=200,lambda[1](20)=0,lambda[2](20)=0,lambda[3](20)=0,lambda[4](20)=0,lambda[5](20)=0:
ode1:=diff(s(t),t)=(1-p*Psi)*tau+phi* v(t) + delta *r(t)-lambda*(1-u[3])*s(t)-u[1]*varphi*s(t) -mu*s(t),
diff(v(t), t) =p*Psi*tau + u[1]*vartheta*s(t) -gamma*lambda* (1-u[3])*v(t)-(mu+phi)*v(t) ,
diff(c(t), t) =(1-u[3])*rho*lambda* (s(t) +gamma*v(t))+(1-q)* u[2]*eta*i(t) -(mu +beta +chi)*c(t),
diff(i(t), t) =(1-rho)*(1-u[3])*lambda*( s(t) +gamma*v(t)) +chi*c(t) - u[2]*eta*i(t) - (mu +alpha )*i(t),
diff(r(t), t) = beta*c(t) + u[2]*q*eta*i(t) -(mu +delta)*r(t),
diff(lambda[1](t), t) = -lambda[1](t)*(-lambda*(1-u[3])-u[1]*varphi-mu)-lambda[2](t)*u[1]*vartheta-lambda[3](t)*(1-u[3])*rho*lambda-lambda[4](t)*(1-rho)*(1-u[3])*lambda,diff(lambda[2](t),t)=-lambda[1](t)*phi-lambda[2](t)*(-gamma*lambda*(1-u[3])-mu-phi)-lambda[3](t)*(1-u[3])*rho*lambda*gamma-lambda[4](t)*(1-rho)*(1-u[3])*lambda*gamma,diff(lambda[3](t),t)=-lambda[3](t)*(-mu-beta-chi)-lambda[4](t)*chi-lambda[5](t)*beta,diff(lambda[4](t),t)=-lambda[3](t)*(1-q)*u[2]*eta-lambda[4](t)*(-u[2]*eta-mu-alpha)-lambda[5](t)*u[2]*q*eta,diff(lambda[5](t),t)=-lambda[1](t)*delta-lambda[5](t)*(-mu-delta);
d
--- s(t) = (1 - p Psi) tau + phi v(t) + delta r(t) - lambda (1 - u[3]) s(t)
dt

d
- u[1] varphi s(t) - mu s(t), --- v(t) = p Psi tau + u[1] vartheta s(t)
dt

d
- gamma lambda (1 - u[3]) v(t) - (mu + phi) v(t), --- c(t) = (1 - u[3]) rho lambda
dt

(s(t) + gamma v(t)) + (1 - q) u[2] eta - (mu + beta + chi) c(t), 0 = (1

- rho) (1 - u[3]) lambda (s(t) + gamma v(t)) + chi c(t) - u[2] eta - mu

d d
- alpha, --- r(t) = beta c(t) + u[2] q eta - (mu + delta) r(t), ---
dt dt

lambda[1](t) = -lambda[1](t) (-lambda (1 - u[3]) - u[1] varphi - mu)

- lambda[2](t) u[1] vartheta - lambda[3](t) (1 - u[3]) rho lambda

d
- lambda[4](t) (1 - rho) (1 - u[3]) lambda, --- lambda[2](t) =
dt
-lambda[1](t) phi - lambda[2](t) (-gamma lambda (1 - u[3]) - mu - phi)

- lambda[3](t) (1 - u[3]) rho lambda gamma

d
- lambda[4](t) (1 - rho) (1 - u[3]) lambda gamma, --- lambda[3](t) =
dt
d
-lambda[3](t) (-mu - beta - chi) - lambda[4](t) chi - lambda[5](t) beta, ---
dt

lambda[4](t) = -lambda[3](t) (1 - q) u[2] eta

- lambda[4](t) (-u[2] eta - mu - alpha) - lambda[5](t) u[2] q eta,

d
--- lambda[5](t) = -lambda[1](t) delta - lambda[5](t) (-mu - delta)
dt

sol := dsolve({c(0) = 0, i(0) = 0, r(0) = .1, s(0) = 0, v(0) = 0, diff(c(t), t) = (1-u[3])*rho*lambda*(s(t)+gamma*v(t))+(1-q)*u[2]*eta*i(t)-(mu+beta+chi)*c(t), diff(i(t), t) = (1-rho)*(1-u[3])*lambda*(s(t)+gamma*v(t))+chi*c(t)-u[2]*eta*i(t)-(mu+alpha)*i(t), diff(r(t), t) = beta*c(t)+u[2]*q*eta*i(t)-(mu+delta)*r(t), diff(s(t), t) = (1-p*Psi)*tau+phi*v(t)+delta*r(t)-lambda*(1-u[3])*s(t)-u[1]*varphi*s(t)-mu*s(t), diff(v(t), t) = p*Psi*tau+u[1]*vartheta*s(t)-gamma*lambda*(1-u[3])*v(t)-(mu+phi)*v(t), diff(lambda[1](t), t) = -lambda[1](t)*(-lambda*(1-u[3])-u[1]*varphi-mu)-lambda[2](t)*u[1]*vartheta-lambda[3](t)*(1-u[3])*rho*lambda-lambda[4](t)*(1-rho)*(1-u[3])*lambda, diff(lambda[2](t), t) = -lambda[1](t)*phi-lambda[2](t)*(-gamma*lambda*(1-u[3])-mu-phi)-lambda[3](t)*(1-u[3])*rho*lambda*gamma-lambda[4](t)*(1-rho)*(1-u[3])*lambda*gamma, diff(lambda[3](t), t) = -lambda[3](t)*(-mu-beta-chi)-lambda[4](t)*chi-lambda[5](t)*beta, diff(lambda[4](t), t) = -lambda[3](t)*(1-q)*u[2]*eta-lambda[4](t)*(-u[2]*eta-mu-alpha)-lambda[5](t)*u[2]*q*eta, diff(lambda[5](t), t) = -lambda[1](t)*delta-lambda[5](t)*(-mu-delta), lambda[1](20) = 0, lambda[2](20) = 0, lambda[3](20) = 0, lambda[4](20) = 0, lambda[5](20) = 0}, type = numeric);
Error, (in dsolve/numeric/process_input) invalid specification of initial conditions, got 1 = 0

sol:=dsolve([ode1,ics],numeric, method = bvp[midrich],maxmesh=500);

Error, (in dsolve/numeric/process_input) system must be entered as a set/list of expressions/equations

dsolve[':-interactive']({});
Error, := unexpected
sol:=dsolve([ode1,ics],numeric, method = bvp[midrich],maxmesh=500);
Error, (in dsolve/numeric/process_input) system must be entered as a set/list of expressions/equations

eq1:=diff(s(t), t)=(1-p*Psi)*tau+phi* v(t) + delta *r(t)-lambda*(1-u[3])*s(t)-u[1]*varphi*s(t) -mu*s(t);
eq2:diff(v(t), t) =p*Psi*tau + u[1]*vartheta*s(t) -gamma*lambda* (1-u[3])*v(t)-(mu+phi)*v(t);
eq3:=diff(c(t), t) =(1-u[3])*rho*lambda* (s(t) +gamma*v(t))+(1-q)* u[2]*eta*i(t) -(mu +beta +chi)*c(t);
eq4:=diff(i(t), t) =(1-rho)*(1-u[3])*lambda*( s(t) +gamma*v(t)) +chi*c(t) - u[2]*eta*i(t) - (mu +alpha )*i(t);
eq5:=diff(r(t), t) = beta*c(t) + u[2]*q*eta*i(t) -(mu +delta)*r(t);

d
--- s(t) = (1 - p Psi) tau + phi v(t) + delta r(t) - lambda (1 - u[3]) s(t)
dt

- u[1] varphi s(t) - mu s(t)
d
--- v(t) = p Psi tau + u[1] vartheta s(t) - gamma lambda (1 - u[3]) v(t)
dt

- (mu + phi) v(t)
d
--- c(t) = (1 - u[3]) rho lambda (s(t) + gamma v(t)) + (1 - q) u[2] eta i(t)
dt

- (mu + beta + chi) c(t)
d
--- i(t) = (1 - rho) (1 - u[3]) lambda (s(t) + gamma v(t)) + chi c(t)
dt

- u[2] eta i(t) - (mu + alpha) i(t)
d
--- r(t) = beta c(t) + u[2] q eta i(t) - (mu + delta) r(t)
dt
eq6:=diff(Q(t),t)=b[1]*c(t)+b[2]*i(t)+w[1]*(u[1])^2/2+w[2]*(u[2])^2/2+w[3]*(u[3])^2/2;
d 1 2 1 2 1 2
--- Q(t) = b[1] c(t) + b[2] i(t) + - w[1] u[1] + - w[2] u[2] + - w[3] u[3]
dt 2 2 2
ics:=s(0)=8200, v(0)=2800,c(0)=1100,i(0)=1500,r(0)=200,Q(0)=6700;
s(0) = 8200, v(0) = 2800, c(0) = 1100, i(0) = 1500, r(0) = 200, Q(0) = 6700
sol0:=dsolve({eq1,eq2,eq3,eq4,eq5,eq6,ics},type=numeric,stiff=true,'parameters'=[u[1],u[2],u[3]],abserr=1e-15,relerr=1e-12,maxfun=0,range=0..50):
Error, (in dsolve/numeric/process_input) system must be entered as a set/list of expressions/equations
with(plots):
Q0:=6700;
6700
obj:=proc(u)
global sol0,Q0;
local ob1;
try
sol0('parameters'=[u[1],u[2],u[3]]):
ob1:=subs(sol0(20.),Q(t)):
catch :
ob1:=0;
end try;
#ob1:=subs(sol0(20.),Q(t));
if ob1>Q0 then Q0:=ob1;print(Q0,u);end;
ob1;
end proc;
proc(u) ... end;
obj([1,1,1]);
0
obj([3,2.5],4);
0
u0:=Vector(3,[0.,0.,0.],datatype=float[8]);
Vector[column](%id = 85973880)

Q0:=0;
Q0 := 0
with(Optimization);
[ImportMPS, Interactive, LPSolve, LSSolve, Maximize, Minimize, NLPSolve,

QPSolve]
sol2:=NLPSolve(3,obj,initialpoint=u0,method=nonlinearsimplex,maximize,evaluationlimit=100):
sol0('parameters'=[3.18125786060723, 2.36800986932868]);
sol0(parameters = [3.18125786060723, 2.36800986932868])
for i from 1 to 3 do odeplot(sol0,[t,x[i](t)],0..20,thickness=3,axes=boxed);od;
Error, (in plots/odeplot) input is not a valid dsolve/numeric solution

## How to perform Fourier transfrom?...

Hi

I want to write the functional Z of J with in terms of the fourier transform of J: .

Actually I'm in Minkowski space and all the integrals should be over 4 dimensions, x,y,k,p should all be four-vectors, but I wanted to keep things short. (The only way I have found to express a 4D integral is using Physics-Intc with the singleparameters of the four vector. Is there a more convenient way to get ?) But still in 1D I cannot solve it.

To find the solution, an exponential of only one integral, is actually pretty easy, since there are integrals over e. g. deliver a delta distribution, but I cannot reproduce this in Maple since he doesn't perform the integral over x.

I have found that I can/have to use the command inttrans-fourier to gain the delta distribution, but when I try to use it for the problem mentioned above I run into all kinds of problems. Not to mention that I cannot manage to perform a fourier transformation in 4D.

Does anybody know how to solve this problem? Thanks!

## An issue with the solve function...

Hi,

I am using the solve command to solve an equation of the form "linear over quadratic is equal to a constant" where the constant is assumed to be nonzero. This is easily solved by hand, of course, but I to use the solution in other computations. So I asked maple to solve it for me. But when I check maple's solution (i.e. just plug the two solutions in on the left hand side and simplify) maple does not return the original constant. Can anyone help me understand what is going wrong?

## C expression generated on the RHS?...

Dear Forum,

I am a new Maple user, and its symbolic prowess is really amazing. So we are trying to interface it with a C library. I want to generate some C code through Maple, and am trying the CodeGeneration package.

But the default conversion of C(a, b) is b = C language equivalent of expression a.

Now this should be fine for most purposes, but the C library that we are working with, "ACADOToolkit" in this case, requires the equations to be formatted in a certain way. So, I need the following equation in C:

f << dot(v) == (u-0.2*v*v)/m

Now the LHS part of == is to be hard-coded, but we want to generate the equation on the right using maple. Even if I define an equation as

eq1:=  and then use C(rhs(eq1)), I get the result in the form of cg = u - 0.2 ...., whereas I want this to be assigned to something else, in this case - "f << dot(v)= ".

How can I achieve this ?

Thanks

Chintan Pathak

Research Scholar,

University of Washington

## Get result from pdsolve...

hello ,

how i can exract value from pdsolve ,i need to use dU(x,R)/dR

thank you

 >
 >
 (1)
 >
 (2)
 >
 (3)
 >
 (4)
 >
 (5)
 >
 (6)
 >
 >
 >
 >