acer

32647 Reputation

29 Badges

20 years, 57 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

What can you tell us about the variables?

Are any purely real? Are any positive? Are any less than -1? etc.

@imparter You'd need to ensure that the file location is writable for you.

I just gave the filename "imparter.xls", so that would end up in whatever folder is the current working directory -- see the output from the Maple command currentdir.

I cannot tell whether the (default) location happens to be writable by you.

You haven't indicated your operating system, or where you want the file to be created. It could be,
   "C::/Users/imparter/foobar/imparter.xls"      MS-Windows
or,
    "/home/imparter/foobar/imparter.xls"            Linux
or something else that you choose.

You could set currentdir(...), and then pass just a plain file name to the Export command. Or you could pass a fully qualified name, eg. "C::/blah/blech/etc.xls" or whatever is appropriate for your OS.

@C_R My motivation in asking is that it is not clear that you even have to use subsop. I can think of three scenarios in which one might think it is necessary even though it is not.

But since you have declined to provide a representative example of your current process I shall walk away.

ps. Before you posted this Question I had obtained a speed-up in that earlier Question thread, using evalhf (avoiding a few pitfalls; eg. like dharr I had concluded that reducing the total number of exp calls might be crucial).

But I am still hunting for still more overwhelmingly large gains in that example, on top of the items to which I alluded in that earlier Question thread including: expression "simplification", procedure optimization (codegen), hardware float evaluation, and parallelism.

pps. Additionally, option hfloat is not always as fast as evalhf (though sometimes it is).

You could show here a (small, manageable) example-to-reproduce of your procedure construction.

An interesting followup might be a query something like:

  For t=0..10 what is the smallest Ua value such that T(t)<398.15 ?

FindingExtractingvaluesdsolvewithspecificconditions_acc.mw

For fun, I'll add that you might also be able to use the D form as intermediary. Eg,

ee := diff(diff(w[2](x[1],t),t$2),x[1]);

diff(diff(diff(w[2](x[1], t), t), t), x[1])


I'll do split both steps below into two lines (each), just to illustrate
what's going one.

You might manipulate/work with this form until ready.

convert(ee,D);

temp2 := eval(%,x[1]=L[b1]);

(D[1, 2, 2](w[2]))(x[1], t)

(D[1, 2, 2](w[2]))(L[b1], t)

When ready...

eval(temp2,L[b1]=5);

convert(%,diff);

(D[1, 2, 2](w[2]))(5, t)

eval(diff(diff(diff(w[2](t1, t), t), t), t1), {t1 = 5})


note: name t1 serves the same purposes as does dummy x[1].

Download Eval_eval_D.mw

This way can also be done by extracting the D[1,2,2](w[2]) on it's own. You can then apply that to whatever two arguments you wish; in some cases you could get by above without the evals.

@Gabriel Barcellos With those few additional details it seems as if one place to start is in the speed of evaluation of the equations themselves.

You write that the equations are "really big". But that is not enough information to know whether their evaluation is memory bound (inadequate RAM leading to the OS needing to swap out active memory, etc). The equations could fit in memory and still be very time-consuming to evaluate at numeric values of the unknowns. As yet, we readers cannot know.

You might focus on the performance of a single of those fsolve calls, and then later try to parallelize mutiple such fsolve calls.

Perhaps the equations can be simplified or reduced in size. Perhaps all or parts of them can be evaluated under evalhf or Compiler:-Compile'd. Perhaps they have common subexpressions. And so on.

It's not easy to be more specific without actually seeing the full code to reproduce. Is there a reason why you cannot upload and attach it here (green up-arrow in Mapleprimes editor)?

@Andiguys You can add sliders for other parameters, after removing them from your DATA list.

It turns out that you can get an explicit formula for that A12=1 intercept. (But even if not easily found explicitly, you could construct a simple proc that fsolve'd for it...) You can even add it to the plot.

question_plot_slider_acc.mw

@lemelinm Yes, or put it in,

   "C:\Users\userid\maple.ini"

if you want it to work for you in other versions. Naturally, edit the "userid" appropriately.

@lemelinm You have mistakenly tried to put the commands into the GUI's stored preferences file.

Instead, put the Maple commands into an user initialization file at one of these locations (for MS-Windows, choice 3)  is common).

The mistake is quite understandable and common, since the two kinds of file unfortunately can have the same filename on MS-Windows.

The Help page for initialization files is pretty clear. It has sections explaining the choices, for each of MS-Windows, Linux, and OSX (Mac). Many people are able to figure it out by merely reading this page, ie. without a video.

@salim-barzani You can enter the mu__3 and mu__4 directly into your expressions, in 2D Input mode.

You don't have to assign to mu[3] and mu[4] at all. In fact continuing to do so doesn't seem to have much point, except that it's confusing you.

Why do you claim that the LaTeX is not OK?

restart

U1 := lambda*(1+sqrt(-lambda)*(cosh(xi*sqrt(-lambda))*B[2]+sinh(xi*sqrt(-lambda))*B[1])*`&+-`(sqrt(lambda/(lambda^2*B[1]^2-lambda^2*B[2]^2-mu^2))))*beta[0]*exp(I*(d*x+e*y+f*t^beta/beta))/(B[1]*cosh(xi*sqrt(-lambda))*lambda+B[2]*sinh(xi*sqrt(-lambda))*lambda+mu)

lambda*(1+(-lambda)^(1/2)*(cosh(xi*(-lambda)^(1/2))*B[2]+sinh(xi*(-lambda)^(1/2))*B[1])*`&+-`((lambda/(lambda^2*B[1]^2-lambda^2*B[2]^2-mu^2))^(1/2)))*beta[0]*exp(I*(d*x+e*y+f*t^beta/beta))/(B[1]*cosh(xi*(-lambda)^(1/2))*lambda+B[2]*sinh(xi*(-lambda)^(1/2))*lambda+mu)

V1 := -`&mu;__4`*b*lambda^2*(1+sqrt(-lambda)*(cosh(xi*sqrt(-lambda))*B[2]+sinh(xi*sqrt(-lambda))*B[1])*`&+-`(sqrt(lambda/(lambda^2*B[1]^2-lambda^2*B[2]^2-mu^2))))^2*beta[0]^2/((B[1]*cosh(xi*sqrt(-lambda))*lambda+B[2]*sinh(xi*sqrt(-lambda))*lambda+mu)^2*a*`&mu;__3`)

-mu__4*b*lambda^2*(1+(-lambda)^(1/2)*(cosh(xi*(-lambda)^(1/2))*B[2]+sinh(xi*(-lambda)^(1/2))*B[1])*`&+-`((lambda/(lambda^2*B[1]^2-lambda^2*B[2]^2-mu^2))^(1/2)))^2*beta[0]^2/((B[1]*cosh(xi*(-lambda)^(1/2))*lambda+B[2]*sinh(xi*(-lambda)^(1/2))*lambda+mu)^2*a*mu__3)

mu := 0

0

U1

lambda*(1+(-lambda)^(1/2)*(cosh(xi*(-lambda)^(1/2))*B[2]+sinh(xi*(-lambda)^(1/2))*B[1])*`&+-`((lambda/(lambda^2*B[1]^2-lambda^2*B[2]^2))^(1/2)))*beta[0]*exp(I*(d*x+e*y+f*t^beta/beta))/(B[1]*cosh(xi*(-lambda)^(1/2))*lambda+B[2]*sinh(xi*(-lambda)^(1/2))*lambda)

V1

-mu__4*b*lambda^2*(1+(-lambda)^(1/2)*(cosh(xi*(-lambda)^(1/2))*B[2]+sinh(xi*(-lambda)^(1/2))*B[1])*`&+-`((lambda/(lambda^2*B[1]^2-lambda^2*B[2]^2))^(1/2)))^2*beta[0]^2/((B[1]*cosh(xi*(-lambda)^(1/2))*lambda+B[2]*sinh(xi*(-lambda)^(1/2))*lambda)^2*a*mu__3)

latex(V1)

-\frac{\mu_{4} b \,\lambda^{2} {\left(1+\sqrt{-\lambda}\, \left(\cosh \! \left(\xi  \sqrt{-\lambda}\right) B_{2}+\sinh \! \left(\xi  \sqrt{-\lambda}\right) B_{1}\right) \left(\pm \sqrt{\frac{\lambda}{\lambda^{2} B_{1}^{2}-\lambda^{2} B_{2}^{2}}}\right)\right)}^{2} \beta_{0}^{2}}{\left(B_{1} \cosh \! \left(\xi  \sqrt{-\lambda}\right) \lambda +B_{2} \sinh \! \left(\xi  \sqrt{-\lambda}\right) \lambda \right)^{2} a \mu_{3}}

 

Download tester_ac.mw

@fnavarro Suppose that the nm is the string denoting the filename.

Suppose that the text file already exists.

Then, in any subsequent Maple session you can do the following, to add additional content to the end of the file, ie. to append to it:

  FileTools:-Text:-Open(fn,':-append'):
  FileTools:-Text:-WriteLine(fn, "%a\n",  some_new_thing ):

See the Open command's Help page, which documents choices of mode in which to open the file.

@sidyly1211 What do the three colored sections of your 2D plot represent?

Your worksheet has three functions, LE,ME,NE. How do they relate to the three areas in your attached image?

For example, does that 2D image represent something like which of the three is greatest (or least). Or...?

Please don't spawn wholly separate new Question threads for this same system (esp. just trying to use the same code in an Answer here).

Duplicate Question threads get flagged as such, and may be deleted.

You could add a close followup query here.

Or (if it's really a significantly different variant) you can use the Branch button at the bottom of this Question's body and so spawn a new Question that automatically has cross-reference links. Otherwise it's not helpful for readers to not have the full context, when reading either.

The NAG and CUBA sources are compiled from C source to shared objects. For each there is also a C bridging function.

The bridging functions are accessed from Maple via its external-calling mechanism.

The integrands are turned into Maple procs, which are passed out to the bridging functions and there set up as C functions (which can do call-back into Maple) which are passed as handles to the NAG/CUBA function.

There are two flavors of call-back, evalhf mode (tried first) and evalf mode (fallback).

First 26 27 28 29 30 31 32 Last Page 28 of 597