nonlinear-functions

Plot quadratic regression with equation displayed

 ̄綄美尐妖づ 提交于 2019-12-13 01:45:09
问题 I am trying to create a pdf page conatining 6 plots (3 rows and 2 columns) using a for loop. I am able to create the plots but i cant seem to automate adding a regression line to each plot. I am trying the following code. #Dummy data Data1 <- data.frame(flow = c(8,8.5,6,7.1,9), SP_elev = c(20,11,5,25,50)) Data2 <- data.frame(flow = c(7,7.2,6.5,8.2,8.5), SP_elev = c(13,15,18,25,19)) Data3 <- data.frame(flow = c(2,3,5,7,9), SP_elev = c(20,25,28,30,35)) Data4 <- data.frame(flow = c(1,4,6,8,9),

maxima multiple trigonometric equations

巧了我就是萌 提交于 2019-12-12 04:52:12
问题 I'm trying to solve an equation using maxima 13.04.2 but the answer isn't what I expect. Example: y2=A2*cos(2*pi*f2*t+phase2) we know A2=.4,f2=6.4951,t=1, trying to find **phase2** y2=.4*cos(2*pi*6.4951+phase2) I tried to solve the y2 equation for phase2 in maxima but it got rid of the cos function kill(all); A:A; phase:phase; solve(A*cos(2*pi*f*t+phase)=0,phase); The answer that came back was I thought something like this was suppose to come back y2 = A2×cos(2πf2t + φ2) ⇒ y2/A2 = cos(2πf2t +

python non linear ODE with 2 variables

有些话、适合烂在心里 提交于 2019-12-12 01:26:14
问题 I am trying to solve the Brusselator model, a non-linear ODE, using python. I used to do this with MATLAB but now am building an application with python as a backend. That's why I want to switch ti python. dx/dt = A + (x^2)(y) - Bx - x dy/dt = Bx - (x^2)(y) I have checked stackoverflow and most of examples I found are simple non-linear ODE with a single variable that can be converted into a system of linear equation. [- Sorry for my notation. I don't know how to add latex in stackoverflow]

Eta/Eta-squared routines in R

只谈情不闲聊 提交于 2019-12-11 21:12:23
问题 Apart from graphical estimation of linearity (gaze-at-scatterplot method), which is utilized before applying some technique from GLM family, there are several ways to do this estimation arithmetically (i.e. without graphs). Right now, I'll focus on Fisher's eta-squared - correlation ratio: arithmetically, it's equal to squared Pearson's r (coef. of determination: r 2 ) if relationship between two variables is linear. Hence, you can compare values of eta and r and make an assessment about type

Poincare Section of a system of second order odes

◇◆丶佛笑我妖孽 提交于 2019-12-11 09:26:06
问题 It is the first time I am trying to write a Poincare section code at Python. I borrowed the piece of code from here: https://github.com/williamgilpin/rk4/blob/master/rk4_demo.py and I have tried to run it for my system of second order coupled odes. The problem is that I do not see what I was expecting to. Actually, I need the Poincare section when x=0 and px>0 . I believe that my implementation is not the best out there. I would like to: Improve the way that the initial conditions are chosen.

solving dynamic number of non-linear equations in python

亡梦爱人 提交于 2019-12-11 08:27:21
问题 Fsolve in Scipy seems to be the right candidate for this, I just need help passing equations dynamically. I appreciate any thoughts in advance. By dynamic I mean number of equations differ from one run to another for example one situation i have : alpha*x + (1-alpha)*x*y - y = 0 beta*x + (1- beta)*x*z - z = 0 A*x + B*y + C*z = D and another situation i have: alpha*x + (1-alpha)*x*y - y = 0 beta*x + (1- beta)*x*z - z = 0 gama*x + (1 -gama)*x*w - w =0 A*x + B*y + C*z + D*w = E alpha , beta , A

initial guess using scipy.optimize in python

↘锁芯ラ 提交于 2019-12-11 05:07:39
问题 I have the following problem to code using python : I have 7 parameters: x, y, z, t, HF, M1F, and M2F. The user should input any of these 3 and the program should calculate the rest. The relations that I have are: HF = -xyt M1F = -2xzt + 4yzt - xyt + 4tz^2 M2F = 2yzt - xyt 1 = -2xt + 2yt + 4zt Attempt to solve the problem: I have 7 parameters and the user should input 3 => I will be left with 4 parameters. So it's all about solving a system of 4 nonlinear equations with 4 unknowns . I read

Scipy - Non-linear Equations System with linear constraints (beginner)

别等时光非礼了梦想. 提交于 2019-12-10 12:02:11
问题 I have seen this amazing example. But I need to solve system with boundaries on X and F, for example: f1 = x+y^2 = 0 f2 = e^x+ xy = 0 -5.5< x <0.18 2.1< y < 10.6 # 0.15< f1 <20.5 - not useful for this example # -10.5< f2 < -0.16 - not useful for this example How could I set this boundary constrains to fsolve() of scipy? Or may be there is some other method? Would You give me a Simple code example? 回答1: It depends on the system, but here you can simply check the constraints afterwards. First

Constrained optimization for nonlinear multivariable function in Java

青春壹個敷衍的年華 提交于 2019-12-10 02:45:09
问题 I am looking for an open source implementation of a method doing constrained optimization for nonlinear multivariable function in Java . 回答1: There are several open source java implementations that can do this, such as: OptaPlanner (apache license, 100% java, lots of examples and documentation) jacop choco ... 回答2: IPOPT is the most robust solver I know of. It has a Java interface although I have no idea how good that is, I only use the C++ API. 回答3: I recently ported Michael Powells' COBYLA2

Error in optim: function cannot be evaluated at initial parameters [closed]

跟風遠走 提交于 2019-12-07 04:04:16
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . So I've run into this weird error in R. I have a simple function which returns an error term when comparing real and simulated prices, called