dharr

Dr. David Harrington

7720 Reputation

22 Badges

20 years, 236 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_R @acer Yes, I noticed a significant slowing in the startup phase on Windows 11 64 bit, which I just attributed to loading the new ribbon interface. Like many other software packages, adding new things slows things down, but then you buy a faster computer and don't notice...

Anyway the startup times in my maple.ini are 7860 ms for 2024 and 21631 ms for 2025. (I didn't try to load a standard file in both cases.) 
Next time I ran 2025 it was 6161 ms, and I manually timed it as about 13 s.

This case is too complicated for solve. I think you will have to put in numerical values of your parameters (which you were going to do anyway for your plot) before solving.

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

1 2 3 4 5 6 7 Last Page 1 of 78