equations

Integration of a system of differential equations MATLAB

爱⌒轻易说出口 提交于 2019-12-25 08:57:33
问题 I am a fairly new Matlab user which I had to explore to numerically integrate a system of differential equations. Now I am trying to resolve a simple equation but which gives me a "lambertw" output. (s - 1) * exp(-s) = k Therefore, for a given k, with k < exp(2) I should get approximately two different values of "s". Here is the bit of code I use for this task (using symbolic toolbox): %%Hopf bifurcation calculations syms s solve((s-1) * exp(-s) == k, s) %uhopf = s*k And the output: 1 -

Arithmetical operations on equations symbolicaly in R without yacas

筅森魡賤 提交于 2019-12-24 23:21:25
问题 I have equations defined like f<-"x^2" and g<-"y^2" . I want to obtain equation z like z<-(x^2)*(y^2) . 'Class(f)', 'class(g)' and 'class(z)' values doesn`t matter for me. I tried this: > f<-"x^2" > g<-"y^2" > z<-f*g I got: Error in f * g : non-numeric argument to binary operator<br/> I tried multiplying f<-expression(f) and g<-expression(g) with no result. I tried also: > f<-function(x) x^2 > g<-function(y) y^2 > z<-function(x,y) f*g > z<-parse(text=z) I got: Error in as.character(x) :

How to make expressions in Tkinter Python

人盡茶涼 提交于 2019-12-24 10:56:44
问题 I'm new in python programming and I'm having some issues in developing a specific part of my GUI with Tkinter. What I'm trying to do is, a space where the user could enter (type) his math equation and the software make the calculation with the variables previously calculated. I've found a lot of calculators for Tkinter, but none of then is what I'm looking for. And I don't have much experience with classes definitions. I made this simple layout to explain better what I want to do: import

Solve Systems of Linear Equations in MATLAB

女生的网名这么多〃 提交于 2019-12-20 04:26:06
问题 I have the following Equations T2+T4-3.615*T1=0; T1+10+2*T5-5.752*T2=0; T1+38+2*T5-4*T4=0; 83+T4+T2+10-4*T5=0; i've tried the following to find the values of T1,T2,T4,T5 syms T1 T3 T4 T2 T5 positive T2+T4-3.615*T1=0; T1+10+2*T5-5.752*T2=0; T1+38+2*T5-4*T4=0; 83+T4+T2+10-4*T5=0; sol=solve(T1,T2,T3,T4) but its not working. 回答1: You have 4 equations and 4 unknowns. This is very easily solved in MATLAB using the equation AT = b , where T = A\b. First move all the constant values over to the RHS.

Solve homogenous system Ax = 0 for any m * n matrix A in R (find null space basis for A)

一笑奈何 提交于 2019-12-17 20:32:21
问题 How to solve a homogenous system Ax = 0 , when A is any m * n matrix (not necessarily a square one) in R? # A=[-0.1 0.1]= 1x2 matrix; x=2x1 to be found; 0: 1x1 zero matrix A <- t(matrix(c(-0.1,0.1))) This question seems to be equivalent of finding the kernel (null space) of an Rn -> Rm (can't do superscript; sorry) linear transformation. 回答1: Anyway, the solution for the above specific matrix A will suffice to me. We can eye-spot it, x = (a, a) , where a is an arbitrary value. A classic /

Sample testcase for Interviewstreet: Equations

限于喜欢 提交于 2019-12-13 09:49:01
问题 So there is a website named interviewstreet.com. Here we can find challenging programming problems. Unfortunately you have to be logged in to see the questions. Here's a brief description of the problem I'm attempting to solve: Find the no of positive integral solutions for the equations (1/x) + (1/y) = 1/N! (read 1 by n factorial) Print a single integer which is the no of positive integral solutions modulo 1000007. For example, when N=3 , (x,y) can be: (7,42) , (9,18) , (8,24) , (12,12) ,

Double Summation in Python

爱⌒轻易说出口 提交于 2019-12-12 11:07:46
问题 I am trying to write a code to conduct a double summation (see pic) in which; M is the subjects, N is the Trials, Yijt is the measured wave form data (3d array) so far I have; Given Y is the data arranged as Y[subjects, trials, time] # ranges: I = len(Y) J = len(Y[0]) Y_i_vals = 0 for i in range(M): for j in range(N): Y_i_vals = Y_i_vals +Y[i][j] Yt = (1.0/(M*N)) * Y_i_vals this doesnt seem the most effective way to do this, nor am i certain it is giving the correct result. 回答1: If you're

What's an easy way of doing powers in PHP?

孤者浪人 提交于 2019-12-11 21:12:05
问题 I'm trying to make to make a script to help me with my maths example equation: y=(4*(x*2)^(2x+4))+4*x^2 For this to work, I just need it to understand that only (x*2) needs to be put to the power of (2x+4) , and then to sub that back into the original equation, which of course you can just eval() an answer. I want to calculate the values of y, when I know an x value. This WOULD be relatively easy if it weren't for powers. I just can't get my head round how to do them. I know you can use pow()

Solving two algebraic equations in java

风格不统一 提交于 2019-12-11 19:17:46
问题 I have two equations that need to be evaluated in java y=(x+1)*2-3 y=5 These equations are dynamic in nature y= x*8x6-5*5 y= 3 y is known in these equations, I need to determine the value of x What is the best and easy way to write a program in java? 回答1: It seems that there are a couple of ways to go about this. My first thought (as always is overly complex and most likely not worth doing except for fun), is to use a create a grammar to parse out the order of operations, things that can

How to interpolate a vector and work with variables (ode45)?

时间秒杀一切 提交于 2019-12-11 16:19:32
问题 I'm working with an ODE model the one I have to put a vector in a variable and then solve it, but I have some parameters which depends on some of the equations of the model, like auxiliar functions/equations but I get this error: Error using Hovorka2004_Prueba>fun Too many output arguments. Error in odearguments (line 88) f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0. Error in ode45 (line 114) [neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ... Error in