Answered
System of differential equations with constant (as variables) coefficients
Your system of ODEs is too complicated to be solved symbolically. Specify the constants and use a numerical solver (e.g. ODE1...

10 years ago | 0

| accepted

Answered
Set of ODEs with an additional condition
The two differential equations uniquely determine x and y. So you can't expect the algebraic relationship log(x)+exp(x)-2*...

10 years ago | 0

Answered
Trying to fit equation with sqlcurvefit to integral function
1. The limits of integration for MATLAB's "integral" are not allowed to be arrays. 2. cos(x)^n can not be evaluated if cos(x)...

10 years ago | 0

Answered
can anybody tell the matlab code for summation of multiple numbers?
<https://www.mathworks.com/help/matlab/ref/sum.html> Best wishes Torsten.

10 years ago | 0

Answered
Solve simultaneously 2 ODE & one Non linear algebraic equation. And all are dependent to each other. Is it possible to solve them in a single Function file in MATLAB ?
Take a look at the section "Solve Robertson Problem As Semi-Explicit Differential Algebraic Equations (DAEs)" under <https://...

10 years ago | 0

Answered
How to solve this integral with MATLAB?
Use MATLAB's "trapz". Best wishes Torsten.

10 years ago | 0

Answered
Problem using quad2d with vector
There is no other way than to loop over the elements of t and call quad2d for each element separately. MATLAB's "integral" ha...

10 years ago | 0

Answered
4th order ODE with non-standard boundary values
You only impose three boundary conditions for a system of four ODEs. If I'm not mistaken, you should define z as z = y(end...

10 years ago | 0

Answered
SLOW FSOLVE AND FZERO
I don't know whether it's faster, but use "roots" instead of "fsolve" for zeros of polynomials. Best wishes Torsten.

10 years ago | 0

| accepted

Answered
I am trying to write code that will implement the Jacobi method for a 4x4 matrix. My code runs, but gives incorrect values for the solution matrix x_new. I was wondering if I am indexing matrices correctly?
A=[1 2 3 -5; 2 5 4 -1; 1 -1 10 2; 3 -2 5 -3]; b=[-44; 8; 44; -16]; L=[0 0 0 0 ; 2 0 0 0 ; 1 -1 0 0 ; 3 -2 5 0]; U=[0...

10 years ago | 0

Answered
Solution of one variable parametric equation
a=...; c=...; f=@(x)(x-c*tanh(a*x)); sol=fzero(f,1); sol By the way: x=0 is a solution. Best wishes Torst...

10 years ago | 0

| accepted

Answered
Solving a triple integral
Take A out of the integral and use https://de.mathworks.com/help/matlab/ref/integral3.html Best wishes Torsten.

10 years ago | 0

| accepted

Answered
Zufallszahlen mit begrenzter Summe
Maybe John D'Errico's rejection method under https://de.mathworks.com/matlabcentral/answers/295688-generating-random-numbers-...

10 years ago | 0

Answered
How to work with variable size vectors to have an adaptable grid in the axial direction to solve a diferential equations system?
This is a terribly difficult task to program on your own. If adaptive gridding is really thus important for your work, you sh...

10 years ago | 0

Answered
pchip vector in ODE45 equation
FLM_Beta12 = pchip(Data(:,1),x(:,5)); [~,yx] = ode45(@(t,x) Beta(t,x,parameters,FLM_Beta12),tSpan,FT12(1)); function...

10 years ago | 1

| accepted

Answered
Solving Implicit differential differential equations.
Couple fmincon and bvp4c to solve the system max: Uo s.c. dX/dz = (a*((1-X)/(1+X))^2)/Uo da/dz = X/(1+2X)/Uo X(...

10 years ago | 0

Answered
Solving Implicit differential differential equations.
My guess is that an optimum value for Uo does not exist, but that the closer to 0 you choose Uo, the faster X will approach 1. ...

10 years ago | 0

Answered
fmincon is not feasible
Use linprog instead of fmincon. Best wishes Torsten.

10 years ago | 0

| accepted

Answered
Stochastic Differential Equation Simulation Using simByEuler
My guess is that your equations contain terms with like expr^a, log(expr), sqrt(expr) or something similar where expr becomes ne...

10 years ago | 0

Answered
Can someone help me with the matlab numerical code to find the optimum minimum values of the function, f(x) where x(1) and x(2) should not be negative.
Add the constraints x1>=0 x2>=0 and use linprog. Best wishes Torsten.

10 years ago | 0

| accepted

Answered
Polynomial fitting with dependent variables
In this case, your model is of the form Y=c*X1*X2+d*X1+a*X2+b and you have to estimate the coefficients a,b,c and d. ...

10 years ago | 1

| accepted

Answered
Create a vector u of dimension 10 with elements un = 4(−1)n 2n+1 . Compute the sum of all the elements and comment.
n=1:10; u=4*(-1).^n./(2*n+1); Best wishes Torsten.

10 years ago | 0

| accepted

Answered
Do you know how to solve an integral over a loop?
Ur=U.*r; result=trapz(r,Ur); gives you an approximation of integral_{r=0}^{r=51.38} U*r dr. Best wishes Tors...

10 years ago | 0

| accepted

Answered
Global curve fitting for polynomial function
The objective function for your problem is given by f(y0,a1,b1,c1,a2,b2,c2)= sum_{i=1}^{n1}(ydata1_{i}-(y0+a1*xdata1_{i}...

10 years ago | 0

Answered
Taming ODE solver behavior by dummy state variables with self-defined dynamics?
Call the solver several times: First call: tstart=0, tend=1ms Second call: tstart=1ms, tend=500ms Third call: ...

10 years ago | 0

Answered
solving system of fife linear equations
See http://www.ece.northwestern.edu/local-apps/matlabhelp/techdoc/math_anal/mat_li16.html Best wishes Torsten.

10 years ago | 1

| accepted

Answered
fitting with 3 parameters
Take a look at the examples for "lsqcurvefit". Best wishes Torsten.

10 years ago | 0

Answered
How can I solve an equation with variable in integral interval?
You can give an analytical expression for your integral: http://integrals.wolfram.com/index.jsp?expr=1%2Fsqrt%282*Pi%29%2Fs*E...

10 years ago | 1

| accepted

Answered
How can I constrain coefficients in lsqcurvefit such that they sum to 1?
Use "fmincon" instead of "lsqcurvefit". Best wishes Torsten.

10 years ago | 0

Answered
bvp with constant vector in function definition
function main rinter = ...; ninter = ...; c= ...; g = @(ya,yb) [ya(1); yb(1)-c]; solinit=bvpinit(linspace(0,r_m...

10 years ago | 0

| accepted

Load more