acer

33400 Reputation

29 Badges

20 years, 332 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

You wrote it as "ConxtextMenu" instead of "ContextMenu".

Or are you saying that right-click on output gives you no popup at all?

@waseem 

You should figure out whether your formulas actually represent what you want.

Help1_ac_k.mw

@waseem I don't understand why you are undoing key aspects of my edits. You're latest attachment had more changes than just the introduction of additional terms.

I deliberately made several changes to your earlier worksheet, including:
1) Adjusting the definition of A so that it matched the formula from your earlier post's question about translation from Mathematica. This produces plots with zero imaginary component, suggesting that it's moving towards the right approach. I don't understand why you have reverted this.
2) Removed applications of evalf to Int calls which had extra options (since doing so removes them).
3) Increased Digits to 15.

In the following worksheet purely real results are obtained using either your latest S1 or the adjusted S1 formula to match your earlier post's definition in Mathematica. So I cannot say for sure which one is correct. Both produce purely real results for plotting, but different results. Likely only you can figure out which is correct.

I cannot know whether your formulas for the additional terms in c2 and e2 are correct. You might have made the same kind of "mistake" as earlier, with the grouping of terms in the denominator. Likely only you can figure out what is correct there.

You should think hard and carefully about those formulas. Just because you obtain purely real results from the integrations does not by itself mean that you have the formulas correct.

I have tried to make the inclusion of extra options (for the numeric integration) come immediately before the plotting, so that even if you once again splatter evalf calls in the formula definitions the plots might still compute. But only you can check that your formulas are correct.

It's possible that you could screw up my edits again, despite my latest efforts to guard against that. If you do I won't be looking at it any more.

I ran this in Maple 16, since I won't have access to Maple 13 until later in the say. But I suspect it will produce plots in your Maple 13 (as I tried the same kind of thing yesterday).

note: You legend values don't match the actual values which you're using for gamma2. I'll let you correct that.

restart:

Digits:=15:

d1:=0.2:d2:=0.6:L1:=0.2:L2:=0.2:F:=0.3:Br:=0.3:

Gr:=0.2: Nb:=0.1:Nt:=0.3:B:=1:B1:=0.7:m:=1:k:=0.1:

Ro:=1:R1:=1:q:=1:alpha:=Pi/4:

h:=z->piecewise( z<=d1,    1,

                 z<=d1+L1,   1-(gamma1/(2*Ro))*(1 + cos(2*(Pi/L1)*(z - d1 - L1/2))),

                        z<=B1-L2/2,  1 ,          

                    z<=B1,  1-(gamma2/(2*Ro))*(1 + cos(2*(Pi/L2)*(z - B1))),

                 z<=B1+L2/2,  R1-(gamma2/(2*Ro))*(1 + cos(2*(Pi/L2)*(z - B1))),

                 z<=B,    R1):

#A:=(-m^2/4)-(1/(4*k)):
A:=(-m^2/4)-(1/4*k):

#S1:=(h(z)^2)/(4*A)-ln(A*h(z)^2+1)*(1+h(z)^2)/4*A:
S1:=(h(z)^2)/4*A-ln(A*h(z)^2+1)*(1+h(z)^2)/4*A:

a2:=Int((1/S1),z=0..1):

b2:=Int((sin(alpha)/F),z=0..1):

c2:=(1/S1)*(-h(z)^6/(6912*A)-h(z)^4/(9216*A)+h(z)^2/(4608*A^3)+ln(1+A*h(z)^2)*(h(z)^6/(576*A)+h(z)^4/(512*A^2)-1/(4608*A^4))):

c3:=Int(c2,z=0..1):

c4:=2*Gr*(Nb-Nt)*c3:

e2:=(1/S1)*(-7*h(z)^4/(256*A)-h(z)^2/(128*A^2)+ln(1+A*h(z)^2)*(3*h(z)^4/(128*A)+h(z)^2/(32*A^2)+1/(128*A^3))):

e3:=Int(e2,z=0..1):

e4:=2*(Nt/Nb)*Br*e3:

l1:=-a2:

l2:=-b2-c4+e4:

Dp:=q*l1+l2:

 

igRe:=subsindets(Dp,specfunc(anything,Int),
                         u->Int(Re(op(1,u)),op(2,u),
                                   method=_d01ajc,epsilon=1e-6)):

plot([seq(eval(igRe,gamma2=j),j=[0,0.02,0.06])],gamma1=0.02..0.1,
     adaptive=false,
     legend = [gamma2 = 0.0,gamma2 = 0.02,gamma2 = 0.04],
     linestyle = [solid,dash,dot],
     color = [black,black,black],
     labels=[gamma1,'Re(Dp)'],
     gridlines=false, axes=boxed);

igIm:=subsindets(Dp,specfunc(anything,Int),
                         u->Int(Im(op(1,u)),op(2,u),
                                   method=_d01ajc,epsilon=1e-6)):

plot([seq(eval(igIm,gamma2=j),j=[0,0.02,0.06])],gamma1=0.02..0.1,
     adaptive=false,
     legend = [gamma2 = 0.0,gamma2 = 0.02,gamma2 = 0.04],
     linestyle = [solid,dash,dot],
     color = [black,black,black],
     labels=[gamma1,'Im(Dp)'],
     gridlines=false, axes=boxed);

 

``

Download Help1_acc.mw

@fatemeh1090 Does this work better in your LaTeX environment?

Naturally, you may wish to break the line (using \\ in the LaTex, or pasting it in by parts, or however you utilize $, $$ \begin{} or what have you).

end_ac2.mw

printf(StringTools:-SubstituteAll(
         StringTools:-SubstituteAll(latex(eval(new,1),output=string),
                     "\\mbox ",""),"\\tt ",""));

\sum _{m=1}^{M} \left( \sum _{k=1}^{N}C_{{{1}}_{{{i,m}}}}\,C_{{{1}}_{{{j,k}}}}\,v_{{{0}}_{{{k,m}}}} \right) -A_{0}\,H_{1}\,\sum _{m=1}^{M} \left( \sum _{k=1}^{N}C_{{{1}}_{{{i,m}}}}\,C_{{{1}}_{{{j,k}}}}\,v_{{{0}}_{{{k,m}}}} \right) -A_{1}\,F\sum _{k=1}^{N}C_{{{2}}_{{{i,k}}}}\,\psi_{\theta_{{{k,j}}}}+{\frac {A_{1}\,K_{4}\,\sum _{k=1}^{N}C_{{{1}}_{{{j,k}}}}\,\psi_{\theta_{{{k,i}}}}}{r_{i}}}+1/2\,{\frac {A_{0}\,K_{4}\,\sum _{k=1}^{N}C_{{{1}}_{{{j,k}}}}\,v_{{{0}}_{{{k,i}}}}}{r_{i}}}

There is no attachment.

@BjaMaple This produces names which prettyprint with subscripts as 2D Output in the GUI.

seq(cat('x__', i), i=1..4);

The code I gave earlier to use x[i] will also prettyprint with subscripts. But the generated indexed names are distinct from those using obtained using the double underscore.

There is also a minor visual distinction: the indexed names display with the subscripts in upright Roman numerals, while the double-underscore form displays with the subscripts in italic just like the base portion of the name. If you really want upright Roman for both, or upright Roman for the subscripts but don't want indexed names like x[1],..,x[4] then let me know. It may be overkill for your needs.

@Carl Love That did not work in my Maple 2018.2 (and the OP has tagged his Question as Maple 2018), unless I increased Digits to 12 or higher. And then it worked without specificying the negative domain.

In my Maple 2019.0 it worked simply with fsolve(eval(p, params), E__fv)  and even at default Digits=10.

@digerdiga And how does that substantiate the notion (your words), "Maple2019 advertised for a big overhaul of simplifications like this"?

@digerdiga I see mention in the What's New for Maple 2019 of "several improvements" for simplify, with some specific areas mentioned including piecewise, radicals, GAMMA, and arctan. I don't see any specific mention of dilog or polylog.

On what are you basing your claim?

@digerdiga What, you mean all bugs and weaknesses? Why do you say that?

@mehdi jafari As always, provide a worksheet or complete code that reproduces the issue.

Upload and attach your worksheet. (Why type all that here, and not attach it?!)

It looks as if it's not finding Student:-Precalculus:-Distance when forming Matrix R. But only if we can see your worksheet can we know for sure.

@mmcdara One possible problem with using subs as you have done is that it replaces all stand-alone instances of L with beta/m.

And sometimes may not be what's wanted. In the following example it may be that standalone L is preferred over beta*m.

expr := 3*L*r/(m*l*s) + L/m + L;

3*L*r/(m*l*s)+L/m+L

expand(algsubs(L/m=beta, expr));

L+3*beta*r/(l*s)+beta

MyRule := beta=L/m:
R := solve(MyRule, {L}):
subs(R, expr);

3*beta*r/(l*s)+beta+beta*m

 

Download algsubs_subs.mw

Of course, no size fits all.

@love-algebra This works for your given (short, toy) example. If it doesn't work for your longer examples then, well, that's what happens when you don't supply them to us up front.

expr := 3*L*r/(m*l*s) + L/m;

3*L*r/(m*l*s)+L/m

algsubs(L/m=beta, expr);

beta*(l*s+3*r)/(l*s)

frontend(expand, [%]);

3*r*beta/(l*s)+beta

map[2](algsubs, L/m=beta, expr);

3*r*beta/(l*s)+beta

 

Download algsubs.mw

It would be easier to demonstrate if you attached your original data. If you use the ExportMatrix command then you can attach it as an (exported) text file. (You could zip it before attaching it. Use the Green up-arrow in the Mapleprimes editor to attach it to a Comment.

If your original data has structure (and I suspect it may) then you can use ArrayInterpolation. But the inputs to that command would not be as you have them. Rather, M1 and M2 would be the two 300-element Vectors of the "common" independent values, and M3 would be the 300x300 Matrix of dependent values.

If it the data is not structured then you could use the Interpolation package to create something from which to attain the interpolated values (utilizing your M4 and M5).

But, again, it's easier to get it right for you the first time if your upload the data. Or you could upload a worksheet that generated the original data, so we could reproduce it via computation.

Have you looked at the examples on the Help page with topic,
   examples/Interpolation_and_Smoothing
That has examples involving interpolation of the kind of structured (regularly spaced in both independent dimensions) data that a plot3d(...,x=a..b,y=c..d) call might generate. It also has examples for irregular independent data.

First 231 232 233 234 235 236 237 Last Page 233 of 612