integration

What would be the computationally faster way to implement this 2D numerical integration?

白昼怎懂夜的黑 提交于 2020-05-29 08:37:50
问题 I am interested in doing a 2D numerical integration. Right now I am using the scipy.integrate.dblquad but it is very slow. Please see the code below. My need is to evaluate this integral 100s of times with completely different parameters. Hence I want to make the processing as fast and efficient as possible. The code is: import numpy as np from scipy import integrate from scipy.special import erf from scipy.special import j0 import time q = np.linspace(0.03, 1.0, 1000) start = time.time() def

What would be the computationally faster way to implement this 2D numerical integration?

房东的猫 提交于 2020-05-29 08:36:20
问题 I am interested in doing a 2D numerical integration. Right now I am using the scipy.integrate.dblquad but it is very slow. Please see the code below. My need is to evaluate this integral 100s of times with completely different parameters. Hence I want to make the processing as fast and efficient as possible. The code is: import numpy as np from scipy import integrate from scipy.special import erf from scipy.special import j0 import time q = np.linspace(0.03, 1.0, 1000) start = time.time() def

Google Home - Is reporting state mandatory?

天涯浪子 提交于 2020-05-16 20:16:15
问题 I'm trying to validate our integration with Google Home, and as it turns out, the smart home test suite expects reporting state to be implemented. AFAIK, this is not necessary, but evidently, at least for this test suit, it is. I'm always reporting "willReportState" as false, which should be fine, and the test suite skips most devices because of this, but for some reason, it still expects thermostats to report state. Does this mean that the only way to get our integration approved and listed

Google Home - Is reporting state mandatory?

别等时光非礼了梦想. 提交于 2020-05-16 20:11:32
问题 I'm trying to validate our integration with Google Home, and as it turns out, the smart home test suite expects reporting state to be implemented. AFAIK, this is not necessary, but evidently, at least for this test suit, it is. I'm always reporting "willReportState" as false, which should be fine, and the test suite skips most devices because of this, but for some reason, it still expects thermostats to report state. Does this mean that the only way to get our integration approved and listed

Apache Camel: What is difference between Message Translator and Content Enricher with Example?

南楼画角 提交于 2020-04-18 12:35:16
问题 I hit database get 10 employees; on base of each employee i hit another database and fetch some information and concatenate the same. As per my understanding, It can be done either in .process() or in .enrich() (using aggregator) .to("jdbc:masterdata?outputClass=com.diavry.integrator.Employee") .to("log:?level=INFO&showBody=true") .process(e -> { List<Employee> eiEmployees = (List<Employee>) e.getIn().getBody(List.class); for (Employee employee : eiEmployees) { PreparedStatement statement =

Apache Camel: What is difference between Message Translator and Content Enricher with Example?

北慕城南 提交于 2020-04-18 12:33:51
问题 I hit database get 10 employees; on base of each employee i hit another database and fetch some information and concatenate the same. As per my understanding, It can be done either in .process() or in .enrich() (using aggregator) .to("jdbc:masterdata?outputClass=com.diavry.integrator.Employee") .to("log:?level=INFO&showBody=true") .process(e -> { List<Employee> eiEmployees = (List<Employee>) e.getIn().getBody(List.class); for (Employee employee : eiEmployees) { PreparedStatement statement =

sagepay form integration - error 3045

梦想的初衷 提交于 2020-02-21 05:54:28
问题 I'm setting up a simple PHP form to send transactions to sagepay using form integration, the cryptkey is setup as follows: $PAYMENT_CRYPT = "VendorTxCode=website &Amount=$total &Currency=GBP &Description=Ticket &SuccessURL=EDITED-OUT/registered-thanks &FailureURL=EDITED-OUT/registered-fail &BillingSurname=$surname &BillingFirstnames=$firstname &BillingAddress1=$address1 &BillingCity=$city &BillingPostCode=$postcode &BillingCountry=UK &DeliverySurname=$surname &DeliveryFirstnames=$firstname

sagepay form integration - error 3045

空扰寡人 提交于 2020-02-21 05:54:11
问题 I'm setting up a simple PHP form to send transactions to sagepay using form integration, the cryptkey is setup as follows: $PAYMENT_CRYPT = "VendorTxCode=website &Amount=$total &Currency=GBP &Description=Ticket &SuccessURL=EDITED-OUT/registered-thanks &FailureURL=EDITED-OUT/registered-fail &BillingSurname=$surname &BillingFirstnames=$firstname &BillingAddress1=$address1 &BillingCity=$city &BillingPostCode=$postcode &BillingCountry=UK &DeliverySurname=$surname &DeliveryFirstnames=$firstname

Evolving functions in python

时光毁灭记忆、已成空白 提交于 2020-02-08 11:00:46
问题 Updated Question Following from my original post, with the use of @Attack68 's code, I have created a program that successfully evolved the function with a choice of multiplicative functions based on a random variable. However, now I am receiving an error saying the list indices must be integers (even though I'm fairly sure they are), I'm not sure what has happened, The code is as follows: import numpy as np import scipy.integrate as integrate x=np.linspace(0.0,1.0,100) n=10 #iterations d=700

Integration via trapezoidal sums in MATLAB

浪尽此生 提交于 2020-02-05 08:23:49
问题 I need help finding an integral of a function using trapezoidal sums. The program should take successive trapezoidal sums with n = 1, 2, 3, ... subintervals until there are two neighouring values of n that differ by less than a given tolerance. I want at least one FOR loop within a WHILE loop and I don't want to use the trapz function. The program takes four inputs: f : A function handle for a function of x . a : A real number. b : A real number larger than a . tolerance : A real number that