Carl Love

Carl Love

28035 Reputation

25 Badges

12 years, 321 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@Rohith  The issue that you present is not really about denominators; rather, it's about nested expressions. Since you had indets[flat] rather than indets in your Question, I used flat in my Answer, which avoids nested expressions; I assumed that that's what you wanted. The expression that you're trying to extract in this case, a*cos(psi)*sin(a)^2, is a `*` inside a `+` inside a `*` (because division is `*` also) inside a `+`. Regular indets will find it no matter how deeply it's nested, but indets[flat](..., `*`) will ignore it.

So, try this

getFuncCoeff:= proc(e)
local 
   One,
   Funcs:= [select(
      x-> membertype({function, function^anything}, {op(x)}),
      indets(subsindets(e, function, f-> One*f), `*`)
   )[]],
   Coeffs:= subsindets(Funcs, {function, identical(One)}, 1)
;
   eval(Funcs, One= 1), Coeffs
end proc;

 

@666 basha What is the formula for heat transfer in terms of the parameters of this BVP system? Is it the Nusselt number? Do you want higher heat transfer values at the red end of the spectrum or the violet end?

@666 basha I said to replace mul with (`*`@op), but you've replaced it with `*`@op. The parentheses matter.

@666 basha So, you want the coloring that's used for the 3D surface to be used for the 2D contour plot? And do you want that shown in 2D or 3D? And what coloring do you want, the X*Y that you show? What's the relevance of that?

@666 basha 

I said to replace mul with (`*`@op), but you have just replaced it with op. Just using op will remove all the cross-product terms from the model.

"Model is not of full rank" generally means that the data has insufficient variation in at least one of the input parameters. The input parameters in this case are  [S, Ha, Rd, Ec, Nt, Nb]. The data is collected over the course of running the worksheet. Each plot varies at most 2 parameters. If you run all the plots in the worksheet as I presented it, there will be about 15,000 data points with sufficient variation for Fit to not give the warning. If you continue to have this problem, let me know.

 

@666 basha The one-argument forms of mul and add were added after Maple 18. To retrofit, replace mul with (`*`@op).

@666 basha The plot that you show is generated by procedure ParamPlot3d. Inside that procedure, a 2D version of the contour plot is created and assigned to local C. So, you just need to make the first line of the body of the procedure (i.e., after the local declarations) 

return C;

Why is there no Spam button on this? And there is no Delete option on the More pull-down.

I don't think that this is ever supposed to happen: I get different results from using `assuming` in infix operator form:

int(GAMMA(a,s)*exp(-b*x), s= 0..infinity) assuming b > 0, a > 0

This gives me the simple result that you were expecting. However, the functional form,

`assuming`([int(GAMMA(a, s)*exp(-b*s), s = 0 .. infinity)], [b > 0, a > 0])

returns unevaluated. I believe that assuming commands entered in 2D Input are always converted to the functional form before execution. Note that `assuming` is a Maple-language procedure on which you can run showstat, trace, etc. I've done that, but I can't figure out what's going on.

 

@tomleslie wrote:

  • What you have is a simple substitutional code which converts a supplied integer to a text message. Pretty sure this has nothing to do with any RSA cryptosystem.

The steps for encrypting via RSA (and other cryptosystems based on modular arithmetic) are

  1. Break the plaintext up into string chunks of a length such that when they're converted to numbers, the modular arithmetic will be injective (i.e., one-to-one).
  2. Convert each chunk into an integer. Simply converting the bit pattern into a binary integer is sufficient.
  3. Apply the mathematical part of the algorithm to those integers.
  4. Output the new integers in a suitable format (possibly encoding as characters).

To decrypt, those steps are simply done in reverse (of course with some variation of the mathematical part). The OP's procedure is the second-to-last of those steps.

@dharr I'm saying that the same mechanism does work in a Code Edit Region.

@dharr Thanks, that's helpful. In a Code Edit Region, if you hover over the wavy line, a tooltip appears in a few seconds to say what the error is. But I almost always know what the problem is anyway.

@vv Yes, agreed, there's not much point in doing this for end-use in1D Input. But it's useful to program it in 1D for a 2D end user.

An unevaluated return allows a bit more finesse:

`⨂`:= (A,B)-> 
   `if`([A,B]::[rtable$2], LinearAlgebra:-KroneckerProduct(A,B), 'procname'(A,B))
:

 

@vv Since the symbol in question in ASCII is `⨂`, you might as well just do

`⨂`:= LinearAlgebra:-KroneckerProduct;

In other words, the OP's desired symbol is already a neutral operator.

@acer Thank you, that's useful information. I recall the Question and Answer to which you referred. I wouldn't have intentionally put a blank line at the top, nor was I aware of one being there unintentionally, but I understand how my typing and mousing could lead to a stray one getting there. Also, I didn't intentionally collapse the Region, but I can also see that accidentally happening. From my POV, I was working elsewhere in the worksheet, far enough down that the Region (which was fully expanded) was off-screen. When I scrolled back up, it was gone.

First 293 294 295 296 297 298 299 Last Page 295 of 708