## plotting – Yet another slow plot involving numerical integration

Well, after reading a lot about how plotting expressions involving `NIntegrate` can take a lot of time, and how to overcome this issue with `DSolve`, I still have problems when plotting this function:

``````myfunction(delta_) =
5*(2 + 3*NIntegrate((E^(-(1/2) (-((3 Sqrt(5/2) delta)/(-1 + delta)) +
t)^2) (1 +
E^(-((3 Sqrt(10) delta t)/(-1 + delta)))) GammaRegularized(
9/2, 0, (0.222222 (4.74342 + (-1. + 1. delta) t)^2)/(-1. +
delta)^2))/Sqrt(2 (Pi)), {t,
0, (3*Sqrt(10))/(2*(1 - delta))}, AccuracyGoal -> Infinity,
Method -> {"LocalAdaptive", "SymbolicProcessing" -> 0},
MaxRecursion -> 100) -
3*NIntegrate((E^(-(1/2) (-((3 Sqrt(5/2) delta)/(-1 + delta)) +
t)^2) (1 +
E^(-((3 Sqrt(10) delta t)/(-1 + delta)))) GammaRegularized(
9/2, 0, 1/18 ((3 Sqrt(5/2))/(-1 + delta) + t)^2))/
Sqrt(2 (Pi)),
{t, 0, (3*Sqrt(10))/(2*(1 - delta))},
AccuracyGoal -> Infinity,
Method -> {"LocalAdaptive", "SymbolicProcessing" -> 0},
MaxRecursion -> 100))

Plot(myfunction(delta), {delta, 0, 1})
``````

It won’t finish after serval minutes.

I used `AccuracyGoal -> Infinity` and so because, when calculating and plotting the result of the integration separately, I get better results.

So, is there any way to speed up this plot (and the calculation itself, as a matter of fact)? What am I missing?

Posted on

## numerical integration – How can I isolate a specific variable to one side in an equation?

Firstly, I will integrate the equation using Simpson’s 3/8 Rule since it is quite long to do analytically. All the variables
(x, y, r, n, ps, k) are unknowns. I want to make r as the subject.
I tried exploring Collect(UMCAP,r) however it does not collect r but just giving the same answer. Is there any way how to ask Wolfram Alpha to “Collect r” (not solve) equation. I just want it to collect r for simplicity because after that I need to integrate the variable r and substitute into other equation. Thank you.

UMCAP=the long expressions

Here is the example:

``````Collect (ps^n (-(1/(24 ps))
n (-k + r) y (((-k^2 + x (x + y/ps))/k)^(-1 +
n) + ((-r^2 + x (x + y/ps))/r)^(-1 + n) +
3 ((-(k + 1/9 (-k + r))^2 + x (x + y/ps))/(
k + 1/9 (-k + r)))^(-1 + n) +
3 ((-(k + 2/9 (-k + r))^2 + x (x + y/ps))/(
k + 2/9 (-k + r)))^(-1 + n) +
2 ((-(k + 1/3 (-k + r))^2 + x (x + y/ps))/(
k + 1/3 (-k + r)))^(-1 + n) +
3 ((-(k + 4/9 (-k + r))^2 + x (x + y/ps))/(
k + 4/9 (-k + r)))^(-1 + n) +
3 ((-(k + 5/9 (-k + r))^2 + x (x + y/ps))/(
k + 5/9 (-k + r)))^(-1 + n) +
2 ((-(k + 2/3 (-k + r))^2 + x (x + y/ps))/(
k + 2/3 (-k + r)))^(-1 + n) +
3 ((-(k + 7/9 (-k + r))^2 + x (x + y/ps))/(
k + 7/9 (-k + r)))^(-1 + n) +
3 ((-(k + 8/9 (-k + r))^2 + x (x + y/ps))/(
k + 8/9 (-k + r)))^(-1 + n)) +
1/24 (-k + r) (((-k^2 + x (x + y/ps))/k)^
n + ((-r^2 + x (x + y/ps))/r)^n +
3 ((-(k + 1/9 (-k + r))^2 + x (x + y/ps))/(k + 1/9 (-k + r)))^
n + 3 ((-(k + 2/9 (-k + r))^2 + x (x + y/ps))/(
k + 2/9 (-k + r)))^n +
2 ((-(k + 1/3 (-k + r))^2 + x (x + y/ps))/(k + 1/3 (-k + r)))^n
+ 3 ((-(k + 4/9 (-k + r))^2 + x (x + y/ps))/(k + 4/9 (-k + r)))^
n + 3 ((-(k + 5/9 (-k + r))^2 + x (x + y/ps))/(
k + 5/9 (-k + r)))^n +
2 ((-(k + 2/3 (-k + r))^2 + x (x + y/ps))/(k + 2/3 (-k + r)))^
n + 3 ((-(k + 7/9 (-k + r))^2 + x (x + y/ps))/(
k + 7/9 (-k + r)))^n +
3 ((-(k + 8/9 (-k + r))^2 + x (x + y/ps))/(k + 8/9 (-k + r)))^
n)),r)
``````

after I used Simplify, it become like this not that long comparing with the previous:

``````Collect (1/24 ps^(-1 +
n) (k - r) (n y (2 (-((2 k)/3) - r/3 + (3 x (ps x + y))/(
ps (2 k + r)))^(-1 + n) +
3 (-((8 k)/9) - r/9 + (9 x (ps x + y))/(ps (8 k + r)))^(-1 +
n) + 2 (-(k/3) - (2 r)/3 + (3 x (ps x + y))/(
ps (k + 2 r)))^(-1 + n) +
3 (-((7 k)/9) - (2 r)/9 + (9 x (ps x + y))/(
ps (7 k + 2 r)))^(-1 + n) +
3 (-((5 k)/9) - (4 r)/9 + (9 x (ps x + y))/(
ps (5 k + 4 r)))^(-1 + n) +
3 (-((4 k)/9) - (5 r)/9 + (9 x (ps x + y))/(
ps (4 k + 5 r)))^(-1 + n) +
3 (-((2 k)/9) - (7 r)/9 + (9 x (ps x + y))/(
ps (2 k + 7 r)))^(-1 + n) +
3 (-(k/9) - (8 r)/9 + (9 x (ps x + y))/(ps (k + 8 r)))^(-1 +
n) + (-k + (x (x + y/ps))/k)^(-1 +
n) + (-r + (x (x + y/ps))/r)^(-1 + n)) -
ps (2 (-((2 k)/3) - r/3 + (3 x (ps x + y))/(ps (2 k + r)))^n +
3 (-((8 k)/9) - r/9 + (9 x (ps x + y))/(ps (8 k + r)))^n +
2 (-(k/3) - (2 r)/3 + (3 x (ps x + y))/(ps (k + 2 r)))^n +
3 (-((7 k)/9) - (2 r)/9 + (9 x (ps x + y))/(ps (7 k + 2 r)))^
n + 3 (-((5 k)/9) - (4 r)/9 + (9 x (ps x + y))/(
ps (5 k + 4 r)))^n +
3 (-((4 k)/9) - (5 r)/9 + (9 x (ps x + y))/(ps (4 k + 5 r)))^
n + 3 (-((2 k)/9) - (7 r)/9 + (9 x (ps x + y))/(
ps (2 k + 7 r)))^n +
3 (-(k/9) - (8 r)/9 + (9 x (ps x + y))/(ps (k + 8 r)))^
n + (-k + (x (x + y/ps))/k)^n + (-r + (x (x + y/ps))/r)^n)),r)
``````

Posted on

## How to start the integration between the eCommerce app and Shopify?

I need to develop the integration between my app and Shopify platform. Maybe you know how to start it and what are the specifics of Shopify API.

Posted on

## integration – Does the integral \$int_0^1 x^a ln(1+x) , mathrm{d}x\$

I came across the integral $$int_0^1 x^a ln(1+x) , mathrm{d}x$$ recently and was wondering if it admits a closed form. Note that here $$a$$ is a non-negative integer. I can’t seem to think of a way of simplifying it. I’d very much appreciate some clarity on whether this integral can indeed by simplified.

Posted on

## numerical integration – NIntegrate with variable in it

I would like to `NIntegrate` with a variable in the function. Later I will be series expanding it. Can it be done in Matehematica? I am getting errors for a sample integration as,

`NIntegrate[Series[Cosh[x]*Exp[-z*Cosh[x]], {z, 0, 2}], {x, 0, [Infinity]}]`

The error is,

`NIntegrate::inumr: The integrand Cosh[x]-Cosh[x]^2 z+1/2 Cosh[x]^3 z^2+O[z]^3 has evaluated to non-numerical values for all sampling points in the region with boundaries {{[Infinity],0.}}.`

Is there a way out? I know that, analytically, I can obtain expressions in terms of modified Bessel functions of second kind. But Mathematica does not pick that up.

Posted on

## magento2.4.1 – amazon sales channel integration in magento 2.4.x for amazon.in

I have read about the amazon channel for API selling in Magento 2.4.x
ubuntu 20.4
but it seems to me that it is not enabled for Indian market. do we have any idea to develop it for indian market (amazon.in) ? Or what we need to tweak to make it work for indian market?

https://devdocs.magento.com/extensions/amazon-sales/?itm_source=devdocs&itm_medium=quick_search&itm_campaign=federated_search&itm_term=amazo
i have read about earlier post but they don’t have specific solution for indian marketplace eg. flikpkart, etc.

but what should I suppose to do?
thx
sayantan

Posted on

## integration – Create a Shopify web site using Shopify API + Connect it to Amazon

I got a requirement from our customer to achieve the below:-

• Build asp.net core web application >> where users from our web application >> specify their domain name >> logo >> theme >> Amazon username/password >> click on “Create Shopify” >> then the system will integrate with Shopify through the API to create the Shopify site based on the specified domain, log and theme.

• After that the System will automatically integrate Shopify with the Amazon account. so users can sell their products from Shopify and send them to amazon for delivery…

In other words the user register through our website >> then our web site will create the Shopify website and link it to the Amazon account… to allow B2B integration between Amazon & Shopify…

So are the above general requirements achievable through Shopify & Amazon API ? Thanks in advance for any help.

Posted on

## integration – Integrating a periodic absolute value function with exponential

I’ve been trying to answer this question and provide a closed form analytical solution.

The equation
$$f(t) = e{^{sigma t}}cos(omega t)$$

$$F(t)= int_{0}^{t} |f(tau)|dtau$$

find F(t) any value of t given that
$$sigma <0 , omega>0$$

I’ve been trying a few ways to solve this, firstly by plotting the graph, which should look something similar to this.
enter image description here

Based on this I broke down the integral into interval where
$$|f(tau)|$$
is positive and negative
$$int_{0}^{pi/2} e{^{sigma t}}cos(omega t) – int_{pi/2}^{3pi/2} e{^{sigma t}}cos(omega t) + int_{3pi/2}^{5pi/2} e{^{sigma t}}cos(omega t) + int_{5pi/2}^{7pi/2} e{^{sigma t}}cos(omega t)…$$

$$int e{^{sigma t}}cos(omega t) dt =$$
$$e{^{sigma t}}(sigma cos(omega t) +omega sin(omega t)/ (sigma ^2 + omega ^2)$$

I’m really lost I think my approach makes sense, but I don’t know how to generalize for all values of t

Any help would be greatly appreciated.

Posted on

## numerical integration – Function Not Integrating

So, this one is a doozy but if anyone can help that would be greatly appreciated.
I’m working on this condensed matter problem over a 3D Brillouin Zone (In this case the BZ is a truncated octohedron, which I’m expressing as a polyhedra called Trunkocto). My code takes the combonation of nearest neighbor and next nearest neighbor vectors and produces a function to integrate over the BZ. But certain vector combos just won’t work! Here’s an exsample of one of the functions I haven’t gotten to work;

``````bop = E^(-(1/2) I (qx - qy))/(13. + 8 Cos(qy/2) Cos(qz/2) + 8 Cos(qx/2) (Cos(qy/2) + Cos(qz/2)) + 4 (Cos(qx) + Cos(qy) + Cos(qz)))
``````

I know, it’s gross.

When I try the regular `Integrate(bop, {qx,qy,qz}εTrunkocto)` function it just returns the equation with the little integral symbol in front.
When I try `NIntegrate(bop, {qx,qy,qz}εTrunkocto)` I get the following error;

`NIntegrate::errprec: Catastrophic loss of precision in the global error estimate due to insufficient WorkingPrecision or divergent integral.`

The whole code ends up spitting out an 18×18 matrix, and I’m running into this issue with about 1/5 of the entries. Anybody have any idea what’s going on here or any tips to help me figure this out?

Posted on