dharr

Dr. David Harrington

8205 Reputation

22 Badges

20 years, 338 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

I looked through and didn't kind anything that would do that. Implementing that in code for all cases would be a nontrivial coding task.

@c_n_h I agree with your conclusions. For the last, I would say that having found how the ordering works, it did seem to be logical and it probably always going to be that way. I guess with two feedback loops there might be some weird reversal, so I'd check that the first time you use that feature. I'm just cautious about use of undocumented features.

@salim-barzani As @mmcdara points out, it depends on what systems you want to work with. For numerical work, my microfliudics collaborators always used COMSOL Multiphysics (laminar flow only, of course). Maple's numerical PDE solvers are very basic and not suited to this type of work.

@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?

First 6 7 8 9 10 11 12 Last Page 8 of 85