dharr

Dr. David Harrington

9102 Reputation

22 Badges

21 years, 229 days
University of Victoria
Professor or university staff
Victoria, British Columbia, Canada

Social Networks and Content at Maplesoft.com

Maple Application Center
I am a retired professor of chemistry at the University of Victoria, BC, Canada. My research areas are electrochemistry and surface science. I have been a user of Maple since about 1990.

MaplePrimes Activity


These are replies submitted by dharr

@c_n_h It seems that what you want should be the default, or at least there could be options to specify these names in the FeedbackConnect command. However it can be done by using the exports of feedback12 as shown below.

(The export names are not as documented; I have submitted an SCR.)

# clean up

restart;

 

# add packages

with(DynamicSystems):

 

with(LinearAlgebra):

 

# set package options

SystemOptions('discretetimevar' = n)

q

 

# get systems

 

A_ss := <<a|b|c|d>,<e|f|g|h>,<i|j|k|l>,<m|n|o|p>>:

B_ss := <<q|r>,<s|t>,<u|v>,<w|x>>:

C_ss := <<1|0|0|0>,<0|1|0|0>,<0|0|1|0>,<0|0|0|1>>:

D_ss := <<0|0>,<0|0>,<0|0>,<0|0>>:

 

sys1 := StateSpace(A_ss,B_ss,C_ss,D_ss,inputvariable=[Q_u(t),u(t)],statevariable=[q_u(t),q_a(t),dq_u(t),dq_a(t)],
outputvariable=[q_u(t),q_a(t),dq_u(t),dq_a(t)],discrete=true,sampletime=T):

sys2 := StateSpace([u(n)=K_virt*q_a(n)+D_virt*(q_a(n)-q_a(n-1))/T,q_a_delayed(n)=q_a(n-1)],
inputvariable=[q_a(n)],outputvariable=[u(n)],statevariable =[q_a_delayed(n)],discrete=true,sampletime=T):

 

feedback12 := FeedbackConnect([sys1, sys2],[[2, 2, 1, -1]])

"module() ... end module"

# overview

PrintSystem(sys1):

PrintSystem(sys2):

PrintSystem(feedback12):

According to the help page ?SystemObject, the exports include inputlist, etc, but actually it is inputvariable etc

exports(feedback12);

 

a, b, c, d, inputcount, outputcount, statecount, sampletime, discrete, systemname, inputvariable, outputvariable, statevariable, parameters, systemtype, ModulePrint, ModuleContextMenu

We want the inputs of the combined system to be labelled the same as the inputs of sys1

feedback12:-inputvariable:=sys1:-inputvariable;

[Q_u(n), u(n)]

And the outputs to be labelled the same as the outputs of sys1

feedback12:-outputvariable:=sys1:-outputvariable;

[q_u(n), q_a(n), dq_u(n), dq_a(n)]

For the state variables, looking at the matrices it looks like the sys1 ones are first, so the following should work

feedback12:-statevariable:=[sys1:-statevariable[],sys2:-statevariable[]];

[q_u(n), q_a(n), dq_u(n), dq_a(n), q_a_delayed(n)]

Check it out

PrintSystem(feedback12);

"[[[`State Space`],[`discrete; sampletime = T`],[`4 output(s); 2 input(s); 5 state(s)`],[inputvariable=[Q_u(n),u(n)]],[outputvariable=[q_u(n),q_a(n),dq_u(n),dq_a(n)]],[statevariable=[q_u(n),q_a(n),dq_u(n),dq_a(n),q_a_delayed(n)]],[a=[[[a,b-(r (K_virt T+D_virt))/T,c,d,(r D_virt)/T],[e,f-(t (K_virt T+D_virt))/T,g,h,(t D_virt)/T],[i,j-(v (K_virt T+D_virt))/T,k,l,(v D_virt)/T],[m,n-(x (K_virt T+D_virt))/T,o,p,(x D_virt)/T],[0,1,0,0,0]]]],[b=[[[q,r],[s,t],[u,v],[w,x],[0,0]]]],[c=[[[1,0,0,0,0],[0,1,0,0,0],[0,0,1,0,0],[0,0,0,1,0]]]],[d=[[[0,0],[0,0],[0,0],[0,0]]]]]"

NULL

Download feedbackconnections.mw

I am not seeing any problem in Windows 11.

For add with a sequence I usually wrap sequences in [] as @nm and @acer have pointed out. But if you want to add a sequence without this, then just use 

`+`(a,b,c);

@vv Exporting foo.mw as foo.tex gives me a .pdf file foo.tex.pdf; similarly exporting as .mpl gives a .pdf file foo.mpl.pdf. (same exporting as .html).
Save as foo.tex gives me a .mw file foo.tex.mw; similarly saving as .mpl gives a .mw file foo.mpl.mw.

In Windows 11, both dialogs are present, but they do not have default options, only *.*.

@salim-barzani I didn't try to follow the logic too closely. You derived eqns but then didn't solve them?

On the very last line of the page (the copyright line) there is an option "consent preferences" you can click.

Yes, that does seem a poor default choice. At least on windows if you enter *.mw as a file name and then hit enter, it will filter to show only the *.mw files.

@janhardo I only plotted 1 pair, but solve said that for any t__1, you find another point at t__1 + Pi, and the curvature is also the same at those, so it is sayng that there are an infinite number of pairs.

@Alfred_F You can use plottools:-getdata to get data from a plot, but for a continuous plot as you have, the data points won't be where you want them. I recommend instead generating the data you want (and then plotting it). I made a matrix, but for nicer output you could look at a DataFrame.

gettingdata.mw

@mmcdara Yes! The number of (unrestricted) partitions for n=10000 is 3.6 x 10^106 or exactly:
36167251325636293988820471890953695495016030339315650422081868605887952568754066420592310556052906916435144

as found from 

P := Iterator:-Partition(10000);
Number(P);

I assume you mean the only condition is that no 1s appear. But then [8] would be OK?

@C_R I find the same behaviour as you for Windows 11, same build number. 

My understanding was that you are taking the small k limit under the condition that k[i]/k[j] is O(1). So I set the O(1) constant to b and then discarded beyond squared terms in k. That logic gives the same result for the exp(A34) you give here. Since we are doing the small k[s] limit, I can't see why the k[s]^2 term on the denominator wouldn't be neglected relative to the constant term, even if I could derive that expression.

There must be more to it than presented here.

@emendes You can get 20 solutions by solve(eqjerkAB) and 18 by SolveTools:-PolynomialSystem(eqjerkAB) - I'm not sure why the numbers of sulotions are different; in my experience the solution sets are usually the same. But Maple chooses the order of variables here. You can choose a variable order by putting the variables in a list. For PolynomialSystems this is an elimination list so that in general the last ones will be given in terms of the earlier ones. So you might get alpha[9,3,0]=alpha[2,3,0] but then not alpha[2,3,0] = alpha[9,3,0]. So are those two different solutions for you?

For a given order, PolynimialSystem should give an exhaustive list. Perhaps solve tried some different orders and found more solutions. If you want any order I suppose you could try giving different orders to PolynomialSystem, but there are a lot of possibilities.

First 20 21 22 23 24 25 26 Last Page 22 of 99