how to integrate functions with conditions using Maxima? - Сообщения
Freezing with "if" is a separate error, I'll add this to the BTS. Thanks for pointing it out.
WroteWroteMaxima breaks whenever I try to integrate a function that is defined using if-else statement, does anyone know a solution for this ?
Use native Smath.
Integrate Discontinuous [min(x)].sm (16 КиБ) скачан 42 раз(а).
Integrate Discontinuous.sm (31 КиБ) скачан 39 раз(а).
no thanks I need double integrals
WroteMaxima breaks whenever I try to integrate a function that is defined using if-else statement, does anyone know a solution for this?
Traditionally, CAS software cannot handle if to derive or integrate.
Maple can integrate functions defined with if, if previously they are converted to piecewise functions, which have a syntax very similar to the cases in SMath.
The most convenient way to integrate piecewise functions in Maxima is by converting the conditionals in your functions to expressions involving sign, abs or unit steps functions, which Maxima can sometimes find an expression with elementary functions.
Wrote
no thanks I need double integrals
Alvaro.
WroteSo I tried maple and symbolic evaluation and now I don't know what to do with this, obviously there are holes in this function when denominators evaluate to zero.
Max (with uppercase) is a function from CustomFunctions, not recognized by Maxima or Maple. Here, max(a, b ) is from Maxima or Maple (native SMath is with only one arg max(A) )
The answer is the same: use sign, abs or unit step with maxima, and piecewise with maple.
Alvaro.
WroteWroteSo I tried maple and symbolic evaluation and now I don't know what to do with this, obviously there are holes in this function when denominators evaluate to zero.
Max (with uppercase) is a function from CustomFunctions, not recognized by Maxima or Maple. Here, max(a, b ) is from Maxima or Maple (native SMath is with only one arg max(A) )
The answer is the same: use sign, abs or unit step with maxima, and piecewise with maple.
Alvaro.
how do I convert a function to piecewise representation?
WroteUse the function If_GT defined above:
but I need a x != 0 condition, I don't think I can stitch together x > N conditions without a boolean OR to represent x != 0 somehow. (or at least I can't think of a way to do so)
WroteWroteUse the function If_GT defined above:
but I need a x != 0 condition, I don't think I can stitch together x > N conditions without a boolean OR to represent x != 0 somehow. (or at least I can't think of a way to do so)
Traditional way in CAS for handle isolate points is using Dirac's Delta "function". But that have some numerical issues, bigger one is that it is not a function but a distribution. Because you can take out a numerable infinity set of points from an integral without change its value, you don't need to exclude cases in the integrand, except for numerical evaluations, and that could be handled in SMath with try function.
So, you can read about Dirac in maple or maxima, and see how to implement an approximation for numerical evaluations looking how to approximate a limit of a succession of functions (that's what a distribution is, and this way is very useful in mathcad 11), or discard some few points or try to symbolic evaluating the integrals with maxima or maple and use try to catch numerical errors.
Alvaro.
Some seems to ignore "with conditions using Maxima".
I understood from mkraska and Razonar this is not possible yet, using Maxima.
And there are some tricks for it to use with other plugins/functions.
Mkraska said he will add this feature to Maxima.
That answers should be enough for this question.
Regards
WroteOriginal post was about using integrate functions with conditions using Maxima.
Some seems to ignore "with conditions using Maxima".
I understood from mkraska and Razonar this is not possible yet, using Maxima.
And there are some tricks for it to use with other plugins/functions.
Mkraska said he will add this feature to Maxima.
That answers should be enough for this question.
Regards
Hi. But actually what I try to show is that it is possible, without plugins and only with simple and short SMath's definitions.
MaximaPiecwiseIntDif.sm (33 КиБ) скачан 40 раз(а).
MaximaPiecwiseIntDif.pdf (192 КиБ) скачан 57 раз(а).
Best regards
Alvaro
WroteHi. But actually what I try to show is that it is possible, without plugins and only with simple and short SMath's definitions.
Best regards
Alvaro
Yeah I got that, which I appreciate it too.
And I have no grievance against your answers too.
Main question is "with conditions using Maxima".
You have answered the question without drifting apart from main issue.
Mkraska even replied conditions are not added to maxima plugin yet.
Your point is "It is not possible with Maxima and you can use these functions".
It is possible with integrated functions as you have shown.
But the some replies are either same with previous ones.
Or not related with the subject. This is what I had tried to complain.
Regards
Wrote
Yeah I got that, which I appreciate it too.
And I have no grievance against your answers too.
Main question is "with conditions using Maxima".
Mkraska even replied conditions are not added to maxima plugin yet.
You have answered the question without drifting apart from main issue.
Your point is "It is not possible with Maxima and you can use these functions".
It is possible with integrated functions as you have shown.
But the some replies are either same with previous ones.
Or not related with the subject. This is what I had tried to complain.
Regards
I completely agree with you. Answers in a forum must be concrete and specific for the forum's health and traceability
Wroteno thanks I need double integrals
Native Smath integrator supports double ... very slow.
Thus, convert/transit for end production.
Give your double integration for inspection.
WroteGive your double integration for inspection.
I don't really understand your way of speaking, but if you mean that you want me to post what exactly I want to integrate then I already posted it. It's Smith shadowing masking function somewhere in there. All I ever wanted is to handle cases where denominator evaluates to zero to prevent undefined results so I used if-else statement, but it ended up not working with Maxima. I gave up using Smath, I'll integrate everything using C++ with Monte-Carlo estimator instead. Much less painful than trying to beat this mess and actually much more flexible which is ridiculous if you ask me. Thank you all for trying to help.
Wrotebut if you mean that you want me to post what exactly I want to integrate then I already posted it. It's Smith shadowing masking function somewhere in there.
Post the double integration again.
Sometimes Forum misses attachment.
If you mean the RHS is the double integration
result of the LHS, then make it productive.
As it looks, it should produce complex RHS.
WroteWrotebut if you mean that you want me to post what exactly I want to integrate then I already posted it. It's Smith shadowing masking function somewhere in there.
Post the double integration again.
Sometimes Forum misses attachment.
If you mean the RHS is the double integration
result of the LHS, then make it productive.
As it looks, it should produce complex RHS.
https://en.smath.com/forum/yaf_postsm71566_how-to-integrate-functions-with-conditions-using-Maxima.aspx#post71566
-
Новые сообщения
-
Нет новых сообщений