## 135 Reputation

13 years, 262 days

## MaplePrimes Activity

### These are replies submitted by adel-00

also from the plots are clear many thanks

## actual number of the excepression...

Thanks ..are there any ways to get the actual number of the excepression 0.25*z(t)^2+Re(y(t))^2+Im(y(t))

the results should be 0.06

## brilliant...

many thanks i thought that i have to seperated any whay NOW how do i know the excpression

0.25z(t)^2+Re(y(t))^2

@acer thanks

## explanation...

for exaple

solve( {32*x + 13*y + 42*z = 50, 87*x + 190*y + 112*z = 940, 10*x + 10*y/4 + 10*z = 10}, {x, y, z});

now: the fundtion

f:=4*x+5*y

how to find f

## assign...

It is to long to solve excplicit

any way how to assign the solution.. for example how to use one of the unknown (x or y) in another  function

thanks all

## run+smallest first argument...

1) is this programme work if  there are more that two points have the same value of N'=10^-4 then in this case we take only the smallest  first argument for example (40,10^-4) and (10,10^-4) in this case we take the time 10

2) please can you run the programme its take long time and the figure isn't smooth

restart:Digits:=14:t0:=0.0:tN:=5000.0: N1:=5000:th:=evalf((tN-t0)/N1):N2:=500;
assume(beta,real):
F:=0.85:B:=0.5:

t1:=array(0..N1,[]):u1:=array(0..N1,[]):pt1:=array(0..N1,[]):pt2:=array(0..N1,[]):

var:={N(t)}:ini1:=N(0)=0.61299467707789:
for j from 1 to N2 do
beta[j]:=j*0.005;
K:=3.6631021787038-beta[j]: dsys1 :=diff(N(t),t)=N(t)*((1-N(t)/K)-F*N(t)/(N(t)^2+B^2)); dsol1 :=dsolve({dsys1,ini1},var,numeric, output=listprocedure, abserr=1e-9, relerr=1e-8,range=0..1); dsolu:=subs(dsol1,N(t)): for i from 0 to N1 do t1[i]:=evalf(th*i):u1[i]:=evalf(dsolu(t1[i]));pt1[i]:=[t1[i],u1[i]]:pt2[i]:=[t1[i],dsolu(t1[i])*((1-dsolu(t1[i])/K)-F*dsolu(t1[i])/(dsolu(t1[i])^2+B^2))]:pt4[j]:=[beta[j],C[j]];
od: mytab2:=eval([seq(pt2[i],i=0..N1)]);mytab4:=eval([seq(pt4[j],j=1..N2)]);
Min:= proc(L::{list, set, rtable}, Val)
local x, min:= infinity, v, X;
for x in L do
v:= Val(x);
if v < min then min:= v; X:= x end if
end do;
X
end proc:

Val:= x-> abs(x[2] - 1e-1):

C[j]:=Min(mytab2, Val)[1]; od:

with(plots):plot(mytab4,beta=0.01..0.5,tickmarks=[4, 5],linestyle=1,color=black,axes=boxed,titlefont=[SYMBOL,12],thickness=2,font=[1,1,18],view=[0.1..0.5,100..500]);

## the second line of the procedure...

Many thanks... the second line of i.e min=infinity I keep it as it is??? or change it to 10^-4????

Min:= proc(L::{list, set, rtable}, Val)
local x, min:= infinity, v, X;
for x in L do
v:= Val(x);
if v < min then min:= v; X:= x end if
end do;
X
end proc:

Val:= x-> abs(x[2] - 1e-4):

## N' approaches to 10^(-4)...

Dear Carl;

Thank you for explain how to figure out the first argument and now I can obtained the pair (beta,C[j]:=Min(mytab2, Val)[1])..

I noticed that the condition for N' approaches to infinity, the time will be very large .. this isn't correct.
now how can we change the condition N' approaches to 10^(-4) in this case will take the shortest time. For example  if the pair (t, N'=10^-4)=(60,10^-4) or (70,10^-4) , then here will take the shortest time t=60

restart:Digits:=14:t0:=0.0:tN:=5000.0: N1:=5000:th:=evalf((tN-t0)/N1):N2:=10;
assume(beta,real):
F:=0.85:B:=0.5:

t1:=array(0..N1,[]):u1:=array(0..N1,[]):pt1:=array(0..N1,[]):pt2:=array(0..N1,[]):

var:={N(t)}:ini1:=N(0)=0.61299467707789:
for j from 1 to N2 do
beta[j]:=j*0.01;
K:=3.6631021787038+beta[j]: dsys1 :=diff(N(t),t)=N(t)*((1-N(t)/K)-F*N(t)/(N(t)^2+B^2)); dsol1 :=dsolve({dsys1,ini1},var,numeric, output=listprocedure, abserr=1e-9, relerr=1e-8,range=0..1); dsolu:=subs(dsol1,N(t)): for i from 0 to N1 do t1[i]:=evalf(th*i):u1[i]:=evalf(dsolu(t1[i]));pt1[i]:=[t1[i],u1[i]]:pt2[i]:=[t1[i],dsolu(t1[i])*((1-dsolu(t1[i])/K)-F*dsolu(t1[i])/(dsolu(t1[i])^2+B^2))]:pt4[j]:=[beta[j],C[j]];
od: mytab2:=eval([seq(pt2[i],i=0..N1)]);mytab4:=eval([seq(pt4[j],j=1..N2)]);
Min:= proc(L::{list, set, rtable}, Val)
local x, min:= infinity, v, X;
for x in L do
v:= Val(x);
if v < min then min:= v; X:= x end if
end do;
X
end proc:

Val:= x-> abs(x[2]):

C[j]:=Min(mytab2, Val)[1]; od:

with(plots):plot(mytab4,beta=0.01..0.1,tickmarks=[4, 5],linestyle=1,color=black,axes=boxed,titlefont=[SYMBOL,12],thickness=2,font=[1,1,18]);

## approaches to 10^-4...

@Carl Love Thanks for the procedure I noticed that t ver very larg.. mathematically it is better to make the approches to 10^(-4) how can we make lettle change in your procedure.

Q2: how can i get only the first argument of i.e 4994

Min(mytab2, Val);
[4994.00000000000, -2.784601937964963e-11]

the reson is to make it a point (beta,t)

plz take a look here

restart:Digits:=14:t0:=0.0:tN:=5000.0: N1:=5000:th:=evalf((tN-t0)/N1):
assume(beta,real):
F:=0.85:B:=0.5:

t1:=array(0..N1,[]):u1:=array(0..N1,[]):pt1:=array(0..N1,[]):pt2:=array(0..N1,[]):

var:={N(t)}:ini1:=N(0)=0.61299467707789:
for j from 1 to 1 do
beta[j]:=j*0.01;
K:=3.6631021787038+beta[j]: dsys1 :=diff(N(t),t)=N(t)*((1-N(t)/K)-F*N(t)/(N(t)^2+B^2)); dsol1 :=dsolve({dsys1,ini1},var,numeric, output=listprocedure, abserr=1e-9, relerr=1e-8,range=0..1); dsolu:=subs(dsol1,N(t)): for i from 0 to N1 do t1[i]:=evalf(th*i):u1[i]:=evalf(dsolu(t1[i]));pt1[i]:=[t1[i],u1[i]]:pt2[i]:=[t1[i],dsolu(t1[i])*((1-dsolu(t1[i])/K)-F*dsolu(t1[i])/(dsolu(t1[i])^2+B^2))]:
od: mytab2:=eval([seq(pt2[i],i=0..N1)]);
Min:= proc(L::{list, set, rtable}, Val)
local x, min:= infinity, v, X;
for x in L do
v:= Val(x);
if v < min then min:= v; X:= x end if
end do;
X
end proc:

Val:= x-> abs(x[2]):

C[j]:=Min(mytab2, Val); od:

have a nice vacation and happy new year.

## Nk:= unapply([solve(subs(a=4.34839390939...

Nk:= unapply([solve(subs(a=4.34839390939816894,eq1))]);

the above now is work.

One more thing

the function V wanted to do the same thing max and min???

eq1:=(alpha+(l+alpha)*u+alpha*k*u^2)*a=
u*(alpha+(l+alpha)*u+alpha*k*u^2)*(1+l*alpha*b/((alpha+(l+alpha)*u+alpha*k*u^2)));
eq2:=v=alpha*b*(1+u+k*u^2)/(alpha+(l+alpha)*u+alpha*k*u^2);
factor((rhs-lhs)(eq1));
eq1:=collect(%,u);
params:={l=10,alpha=0.5,b=100,k=20};
U:=[solve(eval(eq1,params),u)]; #3 solutions for u
#plots:-complexplot(U,a=0..20,style=point); #plot in the complex u-plane
vua:=eval(solve(eq2,v),params): #v expressed in terms of u and a
V:=eval~(vua,u=~U): #the 3 solutions for v in terms of a

## PLOT the function V
plot(V,a=0..75,v=0..100,color=black,labels=[a,v],axes=boxed,numpoints=90,linestyle=1,font=[1,1,18],thickness=2,tickmarks=[4,4],view=[0..65,25..100]);

## max...

i did this which is work now

Optimization:-Minimize(a,{eq1},u=1..5);

for maximum and minimum

now wanted to substitute the value of the maximum to which have 2 two values

Nk:= unapply([solve(eq1=9.34, u)], eq1);

thanks

## maximise...

Dear carl

do you remember the previous qaustion that you told me

maximize(eq, u=1..12, location);

minimize(eq, u=1..12, location);

why it doesn't work here

thanks many thanks

## another function...

Also,

these functions I plot them

as

eq1:=(alpha+(l+alpha)*u+alpha*k*u^2)*a=
u*(alpha+(l+alpha)*u+alpha*k*u^2)*(1+l*alpha*b/((alpha+(l+alpha)*u+alpha*k*u^2)));
eq2:=v=alpha*b*(1+u+k*u^2)/(alpha+(l+alpha)*u+alpha*k*u^2);
factor((rhs-lhs)(eq1));
eq1:=collect(%,u);
params:={l=10,alpha=0.5,a=10,k=20};
U:=[solve(eval(eq1,params),u)]: #3 solutions for u
#plots:-complexplot(U,a=0..20,style=point); #plot in the complex u-plane
vua:=eval(solve(eq2,v),params); #v expressed in terms of u and a
V:=eval~(vua,u=~U): #the 3 solutions for v in terms of a
#plots:-complexplot(V,a=0..20,style=point); #plot in the complex v-plane
#plot skips imaginary values of u, but notice 3 colors.
#plot(U,a=0..20,labels=[a,u]);
##
plot(V,b=0..75,v=0..100,color=black,labels=[b,v],axes=boxed,numpoints=90,linestyle=1,font=[1,1,18],thickness=2,tickmarks=[4,4],view=[0..65,0..60]);

any advise how to find the maximum and the mninmum vales in (b,v)

Q2: why this command doesn't work here.. befoure i tried it in ex-example

minimize(eq, u=1..5, location);