Carl Love

Carl Love

28070 Reputation

25 Badges

13 years, 36 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@taro No! You've been led astray by the concept of single-level evaluation. It has nothing to do with the situation in your original Question, and, as I said, it's NOT what Preben was trying to explain. The only reason that I gave examples of it is that you asked about it in your followup. In the situation of your original Question and in each of Preben's examples, there are only two types of evaluation occurring: full evaluation or no evaluation at all. And in all those cases, there are no local variables.

@Markiyan Hirnyk It isn't reasonable to expect someone to figure this out from the help pages. Indeed, the help page that you cite is largely irrelevant because the OP isn't confused about what unapply does; they're confused about what -> does.

I find all of your "Have you read" Replies patronizing. MaplePrimes isn't meant to be a last resort to which one turns after having exhausted all other sources of help.

The internal details of the procedure should make no difference as long as it provides real-number output when given real-number input. The number of inputs to the procedure should be the number of independent variables plus the number of model parameters.

Please post a worksheet showing the procedure, the call to NonLinearFit, and the error message.

What do you mean by iota? Do you mean sqrt(-1), which is what I usually means in Maple? The expression is already as simplified as it can get. Do you mean that you want to expand it into sin and cos terms? Then do evalc(f) assuming s::complex;

You'll need to provide *a lot* more detail than that before your problem will make sense to us.

@Markiyan Hirnyk Where do you see age 4 mentioned? The header of the linked page says "For honors math students entering grades 6, 7, or 8."

Maple syntax allows the expression seq(F, n= 0..n) (where F is an expression depending on n); however, I think that most serious Maple coders would find it abominable to use the index in the bounds.

Your code is equivalent to the following, which I find much easier to read/understand:

restart:
(a,b,c):= (1,2,3):
(-1)^a*b!*(a+c)!*add(binomial(c,n)*(ln(2)+add((-1)^(a+k)/(a+k), k= 0..n)), n= 0..c);
tot:= evalf(%);

I don't really understand your Question, but the above simplified code may provide you with some insight into your problem. If not, try to rephrase the Question. (Note that I'm not claiming that my code above solves your problem. As far as I can tell, my code produces exactly the same final results as your code. It's just that it's easier to understand.)

 

@Preben Alsholm Clearly I was wrong about the limitation to first order in time. Now I wish that I could remember the actual limitation that I discovered.

@Kitonum Thanks. It's now corrected.

@Preben Alsholm I believe (not sure) that pdsolve(..., numeric) will fail on any attempt to fake an elliptic PDE into something time based and that it'll fail on any PDE that isn't first-order in time.

@JacquesC Indeed, your Reply above just triggered an email notification to me because I must've participated in this thread, but my post isn't now shown below!

@dharr Actually, the extra digits are not needed to perform the arithmetic. The real reason that high Digits works around the problem is that it forces the use of software floats. If we use software floats and keep Digits low, the arithmetic still works, as in

Digits:= 10:
eval(
     .1126460951*t-0.7049523744e-1-1.090463096*10^1390*exp(-1.597924898*t),
     t= 2000.5
);
      168.9538494

@fzfbrd Your worksheet contains the line

CrssOfVds:= VDS-> ArrayInterpolation(Vds, Crss, V);

This line is erroneous because VDS doesn't occur on the right-hand side of the arrow. (The line is not a syntax error because one is allowed to define a constant function, i.e., a function that doesn't depend on its parameter(s).) This line should be

CrssOfVds:= VDS-> ArrayInterpolation(Vds, Crss, VDS);

as it was in your Reply to my Answer below. If you claim that having it that way causes the subsequent evalf(Int(...)) to throw the error

invalid input: evalf expects its 2nd argument, n, to be of type posint, but received numeric,

then please post an executed worksheet showing that error.

@shoeless You wrote:

While the int() command gives me an (expanded) symbolic solution, the same command placed into a function definition will not :/ Seemed odd, e.g. HIG:=T->int(); Any idea why?

Do you mean Why doesn't the command HIG:= T-> int(cos(T), T) return HIG:= T-> sin(T)? The command is a function (more properly called a procedure) definition, not a procedure invocation. No expression in the procedure's body or header is evaluated until the procedure is invoked (*footnote), i.e., a value is supplied for T. In the case of this procedure, that value may simply be the global name 'T'. But this isn't the usual case. For example, it may be required that T be a number rather than a name. But, of course, a name is required to form the abstraction of a procedure parameter.

If you want an expression to be first evaluated (simplified, expanded, etc.) and then turned into a procedure, then use unapply:

HIG:= unapply(int(cos(T), T), T);

 

(*footnote) There is a minor exception: Trivial arithmetic and some very trivial algebra will be done via a process referred to in the Maple documentation as automatic simplification. An example is that A^0 will be replaced by 1.

@fzfbrd I don't understand why you're getting that error message. It seems to think that you are giving the command

evalf(Int(CrssOfVds, Vdson..Charge_Vds), numeric)

which would be erroneous.

Try using restart, and change ArrayInterpolation to CurveFitting:-ArrayInterpolation.

First 465 466 467 468 469 470 471 Last Page 467 of 709