sand15

1007 Reputation

15 Badges

10 years, 305 days

MaplePrimes Activity


These are replies submitted by sand15

@Andiguys 

Point 1 "I am simultaneously solving three equations with three variables"
There is no reason to do this unless you want to make more complicated the job of Maple.
You already solved K2 versus w: why don't you plug this solution into the system {K3, K4} and solve a sysem of two equations in two unknowns?

Point 2 "This process is giving me three different solution sets"
No, in fact you have 4 solutions and not 3: one of them contains RootOfs which, after having applied allvalues, provides 2 equations.
So you have 4 solutions in total.

Point 3 "I am unsure which one is correct or should be considered"
Who do you think could be sure of the correct solution to consider if you are not capable to be yourself?

Point 4 "All parameters are positive and greater than zero. All decision variable Pn, Pr and w should be positive equal to or greater than zero"
Consider the extremely simple case of the solution of K2 wrt w. It writes

w = (Pr+i2-tau-Crm ) / 2

Assuming Pr > 0, i2 > 0, tau > 0, Crm > 0 does not imply that w >= 0.
So your positivity constraints on "All the parameters" 
is completely useless for choosing the "correct" (as you say) solution.
More of this you implicitely assume there is only one "correct" solution Pn >= 0, Pr >= 0, w >= 0, but the attached file proves you can get 0, 1, 2 "correct" solutions and maybe even 3 or 4.

new_Q_solve_sand15.mw

@salim-barzani 

Read again the file I sent you in this COMMENT

If it is not clear enough use this one Line-1-Done_sand15.mw : this is exactly the same file but the corrections are highlighted this way: 𝛌, r  instead of  𝛌1, 𝛌2, r1 i!!!

@salim-barzani 

Login:
I used to use my personnal account (mmcdara) when I was home and my professional one (sand15) at the office.
But since the major Mapleprimes outage this summer  mmcdara is no longer accessible and I fell back on sand15 only.

Error
The function U is not correctly defined, see the simple preliminary example and the ensuing correct definition of U in this worksheet: Line-1-Done_sand15.mw

Some equations contain things like (D[1](f))(x, y, 0, t) because you never told Maple what f(x, y, z, t) was. So it cannot evalluate this D term which annoys you.

You should avoid writting things like 

eqf := f(x, y, z, t) = theta1*theta2+Bij(1, 2):

eq17 := u(x, y, z, t) = 2*(diff(f(x, y, z, t), x))/f(x, y, z, t):

z := 0:
ans := solve({diff(rhs(equ), x), diff(rhs(equ), y)}, {x, y}, explicit)

and replace them by 

f := unapply(theta1*theta2+Bij(1, 2), (x, y, z, t)):             

u := unapply(2*(diff(f(x, y, z, t), x))/f(x, y, z, t), (x, y, z, t)): 

du := diff~(u(x, y, 0, t), [x, y]):   # which simply compute derivatives at z=0 (z remains z)
ans := solve(du, [x, y], explicit)

While doing this you truly define functions f and u and so things like  (D[1](f))(x, y, 0, t) are automatically evaluated and bever appear.

Here is the beginning of what I would do (just the beginning because at some point I no longer understand what you want to achieve)

eval_sand15.mw

By the way, you might be relieved to know that the Error, (in plots:-display) expecting plot structure but received: contour2 doesn't exist with maple 2015: eval_Maple_2015.mw

@DEE_Engineering 

I'm glad I could be of help to you.

Here is the quite general procedure FitRationalFraction which fits any rational fraction P(x)/Q(x) where P(x) and Q(x) are dense polynomial functions with respective degrees p and q.
This "has-to-be-dense" limitation comes from the choice of defining this rational fraction in a very concise way (indeed the list [p, q] is passed to FitRationalFraction) and could be easily removed.

Four examples are provided, the last one uses your data whose result is



FitRationalFraction.mw

@Preben Alsholm 

Should this be considered as an example of code regression or do you consider it's a marginal drawback of recent versions?

 

sol := dsolve(simplify(ode, trig)):

But doing this returns two solutions (additionally of lengthy expressions)...

ode.mw

@Preben Alsholm 

I thought to make a reply to @alice abut was unable to reproduce the issue with Maple 2015:

restart
kernelopts(version);
           Maple 2015.2, APPLE UNIVERSAL OSX, Dec 20 2015, Build ID 1097895
Digits;
                               10

int(1e6*exp(-1e6*t), t=0..infinity);
                               1.

And for even larger lambda values

int(1e60*exp(-1e60*t), t=0..infinity);
                               1.

@AHSAN 

Actually, I am not getting the cell option. ?????



Seriously, is this really that complex?

@AHSAN 

Concerning your file Bar_view_help_sand15(bis)_New.mw:
I see you removed the Layout construction based on DocumenTools package and prefered using a simple display instead.That is a wrong idea because it cannot enable managing correctly the position of the "seaudo-legend" in 3D plots.
So I fill not try to fix the problems you have with this code.

Concerning the file Bar_view_help_sand15(bis).mw:
There are absolutly no problem.
Just do what I did you to do and you get this No-problem.mw

You seem really stubborn (look this help page  help(DocumentTools:-Layout:-Cell) to uderstand what e Cell and to understand what I wrote in Bar_view_help_sand15.mw before invoking bars fir the first time) and I dare say that, as things stand, you are genuinely making me waste my time.

@AHSAN 

When I incorporate your suggestions regarding display, the main graph disappers and only enlarge legends appear on my side.
Can you upload the worksheet, I don't understand what you are saying. 

@AHSAN 

"Sir, I tried many times to download your file, but I couldn’t because of an error"
When I simply click on file 
 video_2.pdf the video automatically launches.
I don't know why it doesn't work with you,maybe because I realized this video on my Mac using Quick Media Player (mov file) and the Mac OS uses this latter by default when I click on the link.
Probably some video converter exists to enable watching it on Windows or Linux but I really don't have time, nor the computer, to fix this issue.

So I can't help you on this point.

"I tried something in which the legends are now appearing above the graph axes, but I am trying to shift them to the bottom so they don’t mix with the axes, but I am not able to do it"
If you use the DocumentTools, DocumentTools:-Layout packages, like in my procedure, to place legends below the graph I can tell you three things:

  1. The result will not be that good that iit is (for me) with right legends.
  2. If the legend does not appear correctly on the right, putting them below likely won't change anything.
  3. Last by not least: be extremely carreful using these two packages for they really don't support syntax errors or wrong Layout constructions (at least with my 2015 version, but these issues may have been fixed on more recent versions): locking of the worksheet forcing to quit Maple and unreaparable corruption of the file.

So, here again, I can't help you.

By the way, I asked you in this COMMENT to do a little modification in my code and post the plot which contains the legends: I'm still waiting...

"In addition, is it possible to automatically add the numeric values on top of each bar so that the correct values appear above every bar?"
If you plot groups of bars with respect to Br and We, each of these groups contain 4 bars.
In order to give a visual impression of groups, the bars within each group are organized in some way. Writting on top of them the value of Nu_cube(Br, M, We) is of course possible but will result in an image extremely confused, whatever the rotation you do.

So I really think this would be a very bad idea to do that.

Some reflections...
Your last question raises a main point: Do you really know what bar-graphs (bar charts) are used for?
Bar Chart  are mainly used to quickly understand visually how a quantity (Nu in your case) depends on several categorical data (Br, M, We). Categorical means these data have a finite number of values (they could be "red", "green" and "blue" or 1, 2, 3 after coding)..
So, using bar-graphs to represent the variation of a quantity which continuously depends on some others is already a debatable choice.

When i say  to quickly understand visually this also mean that the detailed dependcies of, in your case Nu wrt Br, M, We, is of no matter: what you (should) want is to get a rough idea of what happens or of the underlying phenomena at play. So the values of Nu in themselves are of no importance: only their relative variations should matter when you decide using bar-graphs or alike.

Asking for the values of Nu for each bar suggests at the contrary that those same values matter for you.
If it so, a bar-graph might not be the best representation to use (observe that it is already quite delicate to understand what the dependencies of Nu to Br, M, We are by looking to the "3D clustered bar-charts" I construct.

So I advice you to think twice to the informations you really want to display and to the reasons you think these "3D clustered bar-charts" are the best representation for them.
Here are 3 links you could get some idea from:  R(1)R(2), (3).

"The internationally recognized symbol % (per cent) may be used with the SI.

When it is used, a space separates the number and the symbol %. The symbol % should be used rather than the name “per cent”. In written text, however, the symbol % generally takes the meaning of “parts per hundred”. Phrases such as “percentage by mass”, “percentage by volume”, or “percentage by amount of substance” shall not be used; the extra information on the quantity should instead be conveyed in the description and symbol for the quantity."

BIPM The International System of Units, 9th edition 2019 p 151.

So "per cent", is not a unit 1, and % has never been its symbol, it is just an "internationally adopted writting convention" (so there is noreason to introduce something like pu).

You write "It would be nice if Maple Flow could recognize units that are numerically 1".
I don't use Maple Flow but I guess it can handle angles and solid angles, which are the only two quantities
 with unit 1: the radian (rad) and the steradian (sr), ibid. § 2.3.3, p 137.
If it is so, Maple Flow  "recognize units that are numerically 1".

@AHSAN 

Because Mapleprimes doesn't accept the uploading of mov files I changed the extension to pdf.
Simply click on the link below to watch the video, or download the file, change pdf to mov and open it with your prefered video player.
 video_2.pdf

@AHSAN 

Click on EACH CELL (one contains the plot, the other the legend).

Besides, the legends do not seem to be aligned vertically:  add the red line at this position in procedure bars and post me new plot you get

  print(display(Legends));

  C1 := Cell( InlinePlot(All), columnspan=7 ):
  C2 := Cell( InlinePlot(Legends) ):
  TC := Table(seq(Column(), k=1..8), widthmode=percentage, width=60, interior=none,
          Row(C1, C2)
        ):
1 2 3 4 5 6 7 Last Page 1 of 31