dharr

Dr. David Harrington

8155 Reputation

22 Badges

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

@salim-barzani OK, I think you now have acceptable answers.

@janhardo I'm not sure what the problem is; it seems to work as well with f and g?

Using op(0,F) to find the function name seems not to make much sense for arbitrary expressions, but perhaps you only want to use it for functions. I think you should use declare rather than alias if you are using PDEtools. I'm not following what you actually are doing, but maybe this version works as expected?

Download ND.mw

@salim-barzani Isn't putting F1 into H to find u supposed to give a solution to the pde (or perhaps to the linear part?). If so you should check that before moving on to the a[i] part of the problem.

@salim-barzani I haven't been following the bilinear/Hirota part of the argument, so I can't help with that.

You didn't say which version you have. In Maple 2025 it works with the default settings. (The plot command is in the document but doesn't show in Mapleprimes.)

restart

x := -0.2550000000e-2+0.5000000000e-4*sqrt(2601.+(2.000000000*10^6)*C__i)

-0.2550000000e-2+0.5000000000e-4*(2601.+2000000.000*C__i)^(1/2)

plot(-log[10](0.1e-3+x))

NULL


Download plotatzero.mw

@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 *.*.

5 6 7 8 9 10 11 Last Page 7 of 85