tomleslie

13876 Reputation

20 Badges

15 years, 181 days

MaplePrimes Activity


These are replies submitted by tomleslie

is defined as an input to the system in the command

DiffEquation([ode1a, ode2a, ode3a], inputvariable = [y1(t)], outputvariable = [y2(t), y3(t)]);

In other words you need to define y1(t) as an explicit function - ie the stimulus for your dynamic system - and then that begs the question - what is 'in_t,', defined as a Sine() function. It is not a 'system input', and makes no sense in the command

sol := Simulate(sys, [in_t]);

You need

with(DynamicSystems);

at the top of this worksheet.

Then you have to specify odeparm1 - which looks as if it is some kind of listlist structure.

for you to supply the ODE (called 'eq') so that I can play around with this problem. Witout 'eq' it is difficult to determine whether or not specified 'events' even exist - so the problem changes. So(!) much easier if we can actually run your code for diagnostic purposes - and this means you have to supply 'eq'

You state

for the prettyprint option, you say this is just a limitation of using maple in matlab and can not be cured right?

The correct way to look at this is that you are using the Matlab GUI. The Matlab GUI has (AFAIK) no way of produning decently typeset mathematical output. This is not a limitation of Maple. It is a limitation of the Matlab GUI - and if you wnat to drive Maple from the Matlab GUI, then you will have to accept the limitations of the Matlab GUI. Many years ago, the Maylab symbolic toolbox was Maple-based. Whether this included 'enhancements' to the Matlab GUI, I habe no idea.

Currently, the 'default' Matlab symbolic toolbox is based on something called MuPad - a piece of software which I know nothing about. Whether symbolics using MuPad results in prettty, typeset, mathematical, output in Matlab - I have no idea (and I can't test), but I doubt it

Your next problem about unavailability of 'help' for the Maple toolbox for Matlab is more interesting. This could depend on many issues - such as your OS, the order of installation of Matlab and Maple - whatever. So i'll go through these in some kind of sensible order

  1. I am running 64-bit WIn7 Home Pro - so for any other OS, I don't feel qualified to comment.
  2. Within this OS I am running Maple 2017.2 and Matlab R2017a. Now there might be an 'order-of-indtallation' issue here, because Maple will only (automatically) install the 'Maple-for-Matlab' toolbox if a version of Matlab exists on the same machine. It is possible to do a  post-install - where Maple got installed and Matlab was instaled later. See the help at ?Maple Toolbox Installation, for how to do thid post-install
  3. If you get it right, then firing up Matlab, and accessing the Matlab help should show an opening window something like the following

Note the entry under Supplemental Software. Anything other than the above MAtlab help window, suggest either an incorrect installation  (or you are running a different OS eg MacOS or Linux where I won't b able to help very much)

We've all been there - and anyone who claims they haven't - is a liar!

with o:=1,

eval(ygraph1, tt=-0.1);
eval(ygraph1, tt=0);
eval(ygraph1, tt=0.1);

returns 3.903800987*10^(-599), -1.000135798, -1.016271361*10^9821, respectively. Tricky to plot!

On the other hand

o:=1;
plot(ygraph1, tt=-1*10^(-4)..0);
plot(ygraph2, tt=-1*10^(-4)..0);
plot(ygraph3, tt=-1*10^(-4)..0);


at least produces some worthwhil curves

 

 

which part of

y1(tt) = 0, y2(tt) = 0, y3(tt) = 0

is difficult to understand? You could try it numerically, as in

restart;
ode1a := diff(y1(tt), tt) = 1.342398800*10^5*y1(tt)+89591.20000*y2(tt)+44647.44000*y3(tt);
ode2a := diff(y2(tt), tt) = 89591.20000*y1(tt)+89803.24000*y2(tt)+44901.60000*y3(tt);
ode3a := diff(y3(tt), tt) = 44647.44000*y1(tt)+44901.60000*y2(tt)+44859.24000*y3(tt);
sol:=dsolve([ode1a, ode2a, ode3a,y1(0) = 0, y2(0) = 0, y3(0) = 0], numeric);
plots:-odeplot(sol, [tt, y1(tt)], tt=0..1, axes=boxed);
plots:-odeplot(sol, [tt, y2(tt)], tt=0..1, axes=boxed);
plots:-odeplot(sol, [tt, y3(tt)], tt=0..1, axes=boxed);

which will just confirm the analytic answer, ir y1(tt) = 0, y2(tt) = 0, y3(tt) = 0

does label the axes

and puts 'values' where tickmarks would occur - but if you actually wnat the tickmarks themselves?? I suppose you could define a "very short" line (using the plottools:-line() command) at the appropriate point - but this is just satring to get a bit silly. The phrase "putting lipstick on a pig" springs to mind - but that probably only makes sense if you are UK/US

I might be prepared to do this on a one-off plot that I really (really!) needed for some important presentation. But as a general rule - this would be a like a major rewrite on Maples plotting interface - and I'm not going there

If yu want "positive" axes only, then change the last command in the above to

plots:-display( [l1,l3,l5, t1, t2, t3, p1], axes=none);

I'm glad that fixed it because I only keep the last four major releases of Maple active on my machine - and this doesn't go anywhere close to Maple 12 (more like Maple 18!). So I wouln't have been much help

Debugging really old Maple versions can be tricky for anyone on this site. Can only suggest that you update if at all possible

I suggested that commands such as fsolve() and DirectSearch:-SolveEquations() would have more chance if you could restrict the range  of variables. However your chosen form, eg

-4<=(4 `Q__1`)/(Pi `D__1`^(2))<=4,

does not restrict the range of either Q__1 or D__1 individually which is what is required. For example the above could be satisfied by D__1=infinity, and Q__1= nay number whihc isn't infinte. Now do you think that this is a meaningful restriction.

The only thing I can sensibly do with these restrictions is add them to the list of expressions for which a soltuuin is required. So the above I translate to two inequalities -4<=(4 `Q__1`)/(Pi `D__1`^(2)), (4 `Q__1`)/(Pi `D__1`^(2))<=4, which are then added to the list of expressions for whihc a solution is required. This doesn't help!!!

I note that Gillee has made a suggestion - however this involvesl setting 10 of yor variables to some arbitrary values and solving for the rest. With DirectSearch:-SolveEquations(), this can be made to work. I guess you just have to decide

  1. which 10 variables you want to fix
  2. which values you want these arbitrary group of variables set to
  3. whether you actually think such a process is meaningful

 

For this new system, DirectSearch:-SolveEquations() is still returning its 'best solution found' with very high residual values. In fact no better than your first equation system. In fact it found the "same" solution as it did on yur first system! This makes some kind of sense because in this 'solution all the Q__i are positive - so adding the abs() functions shouldn't make much difference (and doesn't)

So since netiher fsolve() nor DirectSearch:-SolveEquations() is getting anywhere close, I'm still tempted to say that no solution exists :-(

Both fsolve() and SearchEquations()  are more likely to be successful if ranges can be specified for the unknowns. So do you have any idea what sort of values you are expecting for any/all of the unknowns?

Assuming it exists in Maple12, the ExportMatrix() command will allow you to generate a variety of file types, including csv, and native Matlab (amonst others)

Earliest version I have installed is Maple18. and both commands are "more-or-less" instant

restart;
CodeTools:-Usage(int(3628800 / (y * (1 / 2 + y)^11) - 3628800 / (y * (39 / 2 + y)^11), y = 39 / 2..infinity)):
memory used=30.59MiB, alloc change=66.00MiB, cpu time=358.00ms, real time=352.00ms, gc time=15.60ms
CodeTools:-Usage(3628800 * int(1 / (y * (1 / 2 + y)^11) - 1 / (y * (39 / 2 + y)^11), y = 39 / 2..infinity)):
memory used=7.18MiB, alloc change=4.00MiB, cpu time=62.00ms, real time=65.00ms, gc time=0ns

and doesn't change significantly in the most recent Maple 2017

 

 

 

You are correct - I read the OP's constraints as two entirely separate conditions, ie beta>0, and delta<1. If I adjust the constraint equations on the worksheet I posted to 0<beta<1, 0<delta<1, as in

 sol3:= CodeTools:-Usage
             ( DirectSearch:-SolveEquations
                ( [ focbetapioptS2Tbeta_eg=0,
                    focdeltapioptS2Tbeta_eg=0
                  ],
                  [ beta > 0,
                    beta < 1,
                    delta > 0,
                    delta < 1
                 ],
                AllSolutions=true
             )
          );

Then DirectSearch() returns only the same two roots which you have obtained - this first two on the original DirectSearch list.

To be fair to DirectSearch(),

  1. I'm pretty sure that the third and fourth roots which are returned with more "relaxed" constraints, are OK.  fsolve() will find these, given appropriate range restrictions
  2. I did warn about roots five and six in my original post, based solely on the size of the residuals returned:
First 113 114 115 116 117 118 119 Last Page 115 of 207