LeeHoYeung

Mr. Ho Yeung Lee

535 Reputation

10 Badges

12 years, 235 days

Social Networks and Content at Maplesoft.com

Seldom to ask question after retired math hobby Welcome August, February, July, May born girl And waited for her email to mavio@protonmail.com

MaplePrimes Activity


These are questions asked by LeeHoYeung

f(f(z,a),b) = f(z, a + b) 

i googled this axiom is diff(x(t),t) = xi(f);

then i think 

diff(x(t),t$2) = xi(f);

is it f(f(f(z,a),b),c) = f(z, a + b+c) ?

then think again

whether  f(f(f(z,a),b),c) + f(f(z,a),b) = f(z, a + b+c)  is diff(x(t),t$2)+diff(x(t),t)= xi(f);

however do not know how to construct right hand side  f(z, a + b+c), this is my guess

any books teaching this?

 

i think that if any matrix group be created from  f(f(f(z,a),b),c) + f(f(z,a),b)

that can help to convert to differential equations

 

hope that there is a solvable group which can represent solvable differential equation or differential system

 

if xi is Infinitesimal in maple,

how to find Infinitesimal from f(f(z,a),b) = f(z, a + b) ?

it seems impossible to draw all DE system in one time.

quite easy to get error when can not solve

 

> newsys := [Diff(x1(t), t) = VectorCalculus[`-`](VectorCalculus[`*`](2, x3(t)^2)), Diff(x2(t), t) = VectorCalculus[`-`](u(t)), Diff(x3(t), t) = u(t), Diff(u(t), t) = 0];
[ d 2 d d
[--- x1(t) = -2 x3(t) , --- x2(t) = -u(t), --- x3(t) = u(t),
[ dt dt dt

d ]
--- u(t) = 0]
dt ]
> DEplot3d(value(newsys), [x1(t), x2(t), x3(t), u(t)], t = 0 .. 1, [[x1(0) = 1, x2(0) = 1, x3(0) = 1, u(0) = 1]], scene = [x1(t), x2(t)]);
Error, (in DEtools/DEplot) 'scene' must specify three variables in DEplot3d: scene = [x1(t), x2(t)]
> Sol := dsolve(`union`(newsys, {u(0) = .5, x1(0) = .5, x2(0) = .5, x3(0) = .5}), range = 0 .. 15, numeric); plots:-odeplot(Sol, [x1(t), x2(t), x3(t), u(t)], t = 0 .. 15);
Error, invalid input: `union` received [Diff(x1(t), t) = -2*x3(t)^2, Diff(x2(t), t) = -u(t), Diff(x3(t), t) = u(t), Diff(u(t), t) = 0], which is not valid for its 1st argument
Error, (in plots/odeplot) input is not a valid dsolve/numeric solution

got error when draw root locus

and would like to know how to set feasibility tolerance, less than 0.1 is also ok

 

with(DynamicSystems):

x11 := [1.05657970467127, .369307407127487, .400969917393968, .368036162749865, .280389875142339, .280523489139136, .283220960827744, .373941285224253, .378034013792196, .384412762008662, .358678988563716, .350625923673556, .852039817522304, .362240519978640, 1.03197080591829, .343650441408896, .982510654490390, .404544012440991, .422063867224247, 1.20938803285209, .455708586000668, 1.22503869712995, .388259397947667, .472188904769827, 1.31108028794286, 1.19746589728366, .572669348193002];

y11 := [.813920951682113, 10.3546712426210, 2.54581301217449, 10.2617298458172, 3.82022939508992, 3.81119683373741, 3.90918914917183, 10.5831132713329, 10.8700088489538, 11.0218056177585, 10.5857571473115, 9.89034057997145, .271497107157453, 9.77706473740146, 2.23955104698355, 4.16872072216206, .806710906391666, 11.9148193656260, 12.0521411908477, 2.52812993540440, 12.6348841508094, 2.72197067934160, 5.10891266728297, 13.3609183272238, 3.03572692234234, 1.07326033849793, 15.4268962507711];

z11 := [8.93290500985527, 8.96632856524217, 15.8861149154785, 9.16576669760908, 3.20341865536950, 3.11740291181539, 3.22328961317946, 8.71094047480794, 8.60596466961827, 9.15440788281943, 10.2935566768586, 10.5765776143026, 16.3469510439066, 9.36885507010739, 2.20434678689869, 3.88816077008078, 17.9816287534802, 10.1414228793737, 10.7356141216242, 4.00703203725441, 12.0105837616461, 3.77028605914906, 5.01411979976607, 12.7529165152417, 3.66800269682059, 21.2178824031985, 13.9148746721034];

u11 := [5.59, 5.74, 5.49, 5.19, 5.37, 5.56, 5.46, 5.21, 5.55, 5.56, 5.61, 5.91, 5.93, 5.98, 6.28, 6.24, 6.44, 6.58, 6.75, 6.78, 6.81, 7.59, 7.73, 7.75, 7.69, 7.73, 7.79];

a1 := Diff(x1(t),t) = k1*x1(t)+ k2*y1(t)+ k3*z1(t)+k4*u1(t);

b1 := Diff(y1(t),t) = k5*x1(t)+ k6*y1(t)+ k7*z1(t)+k8*u1(t);

c1 := Diff(z1(t),t) = k8*x1(t)+ k9*y1(t)+ k10*z1(t)+k12*u1(t);

d1 := Diff(u1(t),t) = 0;

ICS:=x1(1)=x11[1],y1(1)=y11[1],z1(1)=z11[1],u1(1)=u11[27];

sol:=dsolve({a1,b1,c1,d1,ICS}, numeric, method=rkf45, parameters=[k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12],output=listprocedure);

X,Y,Z,U:=op(subs(sol,[x1(t),y1(t),z1(t),u1(t)]));

tim := [seq(n, n=1..27)];

N:=nops(tim):

ans:=proc(k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12) sol(parameters=[k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12]);

 add((X(tim[i])-x11[i])^2,i=1..N)+add((Y(tim[i])-y11[i])^2,i=1..N)+add((Z(tim[i])-z11[i])^2,i=1..N)+add((U(tim[i])-u11[i])^2,i=1..N)

 end proc;

ans(.001,.002,.003,.001,.002,.003,.001,.002,.003,.001,.002,.003);

result1 := Optimization:-Minimize(ans,initialpoint=[.001,.002,.003,.001,.002,.003,.001,.002,.003,.001,.002,.003]);

x11 := [1.05657970467127, .369307407127487, .400969917393968, .368036162749865, .280389875142339, .280523489139136, .283220960827744, .373941285224253, .378034013792196, .384412762008662, .358678988563716, .350625923673556, .852039817522304, .362240519978640, 1.03197080591829, .343650441408896, .982510654490390, .404544012440991, .422063867224247, 1.20938803285209, .455708586000668, 1.22503869712995, .388259397947667, .472188904769827, 1.31108028794286, 1.19746589728366, .572669348193002];

y11 := [.813920951682113, 10.3546712426210, 2.54581301217449, 10.2617298458172, 3.82022939508992, 3.81119683373741, 3.90918914917183, 10.5831132713329, 10.8700088489538, 11.0218056177585, 10.5857571473115, 9.89034057997145, .271497107157453, 9.77706473740146, 2.23955104698355, 4.16872072216206, .806710906391666, 11.9148193656260, 12.0521411908477, 2.52812993540440, 12.6348841508094, 2.72197067934160, 5.10891266728297, 13.3609183272238, 3.03572692234234, 1.07326033849793, 15.4268962507711];

z11 := [8.93290500985527, 8.96632856524217, 15.8861149154785, 9.16576669760908, 3.20341865536950, 3.11740291181539, 3.22328961317946, 8.71094047480794, 8.60596466961827, 9.15440788281943, 10.2935566768586, 10.5765776143026, 16.3469510439066, 9.36885507010739, 2.20434678689869, 3.88816077008078, 17.9816287534802, 10.1414228793737, 10.7356141216242, 4.00703203725441, 12.0105837616461, 3.77028605914906, 5.01411979976607, 12.7529165152417, 3.66800269682059, 21.2178824031985, 13.9148746721034];

u11 := [5.59, 5.74, 5.49, 5.19, 5.37, 5.56, 5.46, 5.21, 5.55, 5.56, 5.61, 5.91, 5.93, 5.98, 6.28, 6.24, 6.44, 6.58, 6.75, 6.78, 6.81, 7.59, 7.73, 7.75, 7.69, 7.73, 7.79];

k1 := result1[2][1];

k2 := result1[2][2];

k3 := result1[2][3];

k4 := result1[2][4];

k5 := result1[2][5];

k6 := result1[2][6];

k7 := result1[2][7];

k8 := result1[2][8];

k9 := result1[2][9];

k10 := result1[2][10];

k11 := result1[2][11];

k12 := result1[2][12];

a1 := Diff(x1(t),t) = k1*x1(t)+ k2*y1(t)+ k3*z1(t)+k4*u1(t);

b1 := Diff(y1(t),t) = k5*x1(t)+ k6*y1(t)+ k7*z1(t)+k8*u1(t);

c1 := Diff(z1(t),t) = k8*x1(t)+ k9*y1(t)+ k10*z1(t)+k12*u1(t);

d1 := Diff(u1(t),t) = 0;

diff_eq := [a1, b1, c1, d1];

sys6 := DiffEquation(diff_eq, [x1(t), y1(t), z1(t), u1(t)], [x1(t), y1(t), z1(t), u1(t)]);

sys6 := DiffEquation(diff_eq, [x1(t), y1(t), z1(t)], [x1(t), y1(t), z1(t), u1(t)]);

ResponsePlot(sys6, Step(), parameters = params);

RootLocusPlot(sys6);

 

> sys6 := DiffEquation(diff_eq, [], [x1(t), y1(t), z1(t), u1(t)]);

Error, (in DynamicSystems:-DiffEquation) unrecognized diff-equation type: 9

> sys6 := DiffEquation(diff_eq, [x1(t), y1(t), z1(t), u1(t)], [x1(t), y1(t), z1(t), u1(t)]); sys6 := DiffEquation(diff_eq, [x1(t), y1(t), z1(t)], [x1(t), y1(t), z1(t), u1(t)]);

Error, (in DynamicSystems:-DiffEquation) unrecognized diff-equation type: 9

Error, (in DynamicSystems:-DiffEquation) unrecognized diff-equation type: 9

> ResponsePlot(sys6, Step(), parameters = params); RootLocusPlot(sys6);

Error, invalid input: DynamicSystems:-ResponsePlot expects value for keyword parameter parameters to be of type ({set, list})(name = complexcons), but received params

Error, (in Verify:-CommonExports) system object is not a module

 

Error, (in Statistics:-NonlinearFit) invalid input: no implementation of NonlinearFit matches the arguments in call

after tried many times, got this error

 

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(1)=x11[1],y1(1)=y11[1],z1(1)=z11[1];
sol:=dsolve({a1,b1,c1,ICS}, numeric, method=rkf45, parameters=[k1,k2,k3,k4,k5,k6,k7,k8,k9]);
ans:=proc(p1,p2,p3) sol(parameters=[x1=p1,y1=p2,z1=p3]); end proc:
tim := [seq(n, n=1..27)];
ExperimentalData := <<x11>|<y11>|<z11>>;
FitParams:=Statistics:-NonlinearFit(ans, ExperimentalData,initialvalues=[k1=0,k2=0,k3=0,k4=0,k5=0,k6=0,k7=0,k8=0,k9=0], output=parametervalues);

expect to export a series of graphs, but no diagram,

 

then i debug to export one diagram, it is success, why in this case not export

https://drive.google.com/file/d/0B2D69u2pweEvcDZVZ0tsRTc2dTg/edit?usp=sharing

restart;
with(combinat):
list1 := permute([a, b, a, b, a, b], 3);
list1a := subs(b=1,subs(a=0, list1));
n := 3;
list1a := permute([seq(seq(k,k=0..1),k2=1..n)], n);
list2 := permute([a, b, c, d, e, f, g, h, a, b, c, d, e, f, g, h, a, b, c, d, e, f, g, h], 3);
list3 := subs(h=18,subs(g=17,subs(f=16,subs(e=15,subs(d=14,subs(c=13,subs(b=12,subs(a=11,list2))))))));
list3 := permute([seq(seq(k,k=11..18),k2=1..3)], 3);
Iter:= iterstructs(Permutation([seq(seq(k,k=11..(10+nops(list1a))),k2=1..3)]), size=3):
list3b := [];
while not Iter[finished] do
p:= Iter[nextvalue]();
list3b := [p, op(list3b)];
end do:
list5 := Matrix(nops(list1a)*nops(list3), 1);
count := 1;
for n from 1 to nops(list3) do
temp1 := subs(1=list1a[1],list3[n]);
for k from 11 to nops(list1a)+10 do
temp1 := subs(k=list1a[k-10],temp1);
od;
list5[count] := temp1;
count := count + 1;
od;
Lfh := proc(numoflevel, hx, fx, varx)
if numoflevel = 1 then
hello := 0;
for kk from 1 to nops(var) do
hello := hello + diff(hx[kk], varx[kk])*fx[kk];
od;
return hello;
else
hello := 0;
for kk from 1 to nops(var) do
hello := hello + diff(Lfh(numoflevel-1, hx, fx, varx), varx[kk])*fx[kk];
od;
return hello;
end if;
end proc:
CheckRelativeRankZero := proc(h1, f1, g1,variables1,Count)
IsFinish := 0;
Result := 0;
for ii from 1 to 8 do
if IsFinish = 0 then
Lf2h := Lfh(ii,h1,f1,variables1);
Print(“Lf2h=”);
Print(Lf2h);
Lgf2h := Lfh(1,[seq(Lf2h,n=1..nops(variables1))],g1,variables1);
if Lgf2h = 0 then
print(“Lgf2h = 0”)
print(f1);
print(Lf2h);
print("find at ", ii);
IsFinish := 1;
Result :=Lf2h;
end if;
end if;
od;
return Result;
end proc:
IsZeroMatrix := proc(h1)
Iszero := 1;
for ii from 1 to 3 do
for jj from 1 to 3 do
if h1[ii][jj] <> 0 then
Iszero := 0;
end if
od;
od;
return Iszero;
end proc:
with(combstruct):
list6:= convert(list5, list):
list7 := [];
for ii from 1 to nops(list6) do
if list6[ii] <> 0 then
list7 := [list6[ii], op(list7)];
end if;
od;
with(LinearAlgebra):
with(VectorCalculus):
varlist := [x1, x2, x3];
Iter:= iterstructs(Permutation(list7), size=2):
Count := 1;

with(DEtools):
Iter:= iterstructs(Permutation(list7), size=2):
Count := 1;
list8 := [];
while not Iter[finished] do
p:= Iter[nextvalue]();
I1 := 0;
I2 := 0;
if IsZeroMatrix(p[1]) = 0 and IsZeroMatrix(p[2]) = 0 then
group1 := Matrix(p[1]);
for ii from 1 to 3 do
for jj from 1 to 3 do
if group1[ii][jj] = 1 then
I1 := I1 + varlist[ii]*varlist[jj];
end if;
od;
od;
group2 := Matrix(p[2]);
for ii from 1 to 3 do
for jj from 1 to 3 do
if group2[ii][jj] = 1 then
I2 := I2 + varlist[ii]*varlist[jj];
end if;
od;
od;
f2:=[I1, I2];
g2:=[0,-1,1];
h2:=[x1,0,0];
Lf2h := CheckRelativeRankZero(h2,f2, g2, varlist, Count);
print(“Lf2h=”);
print(Lf2h);
RightSide := MatrixMatrixMultiply(Matrix([[0,diff(I2, varlist[3]),-diff(I2,varlist[2])],[-diff(I2, varlist[3]),0,diff(I2, varlist[1])],[diff(I2, varlist[2]),-diff(I2, varlist[1]),0]]), Matrix([[diff(I1, varlist[1])],[diff(I1, varlist[2])],[diff(I1, varlist[3])]]));
print(“RightSide”);
print(RightSide);
Lf2_h := Lfh(1, Lf2h, f2, varlist);
LgLf_h := Lfh(1,Lfh(1,h2,f2,varlist),g2, varlist);
if LgLf_h = 0 then
u:=0;
else
u := -Lf2_h/LgLf_h;
end if;
newsys := [Diff(x1(t),t) = subs(x3=x3(t),subs(x2=x2(t),subs(x1=x1(t),RightSide[1][1]))) + g[1]*u,
Diff(x2(t),t) = subs(x3=x3(t),subs(x2=x2(t),subs(x1=x1(t),RightSide[2][1]))) + g[2]*u,
Diff(x3(t),t) = subs(x3=x3(t),subs(x2=x2(t),subs(x1=x1(t),RightSide[3][1]))) + g[3]*u];
eval(plotsetup):
`plotsetup/devices`[jpeg]:=[jpeg,`plot.jpg`,[],[],``]:
plotsetup(jpeg, plotoutput=cat(cat(`testhamiplot`, Count),`.jpg`),plotoptions=`height=700,width=800`);
DEplot3d(value(newsys), [x1(t), x2(t), x3(t)], t = 0..1,[[x1(0) = 1, x2(0) = 1, x3(0) = 1]]);

Count := Count +1;
end if;
end do:

First 110 111 112 113 114 115 116 Last Page 112 of 141