Answered
How can i write a function that calculates the sum of the series of x^t for t=0 to T?
Geometric series. Sum is (x^(T+1)-1)/(x-1), if x<> 1 and finite T T+1 , if x=1 and finite T 1/(1-x) ...

10 years ago | 0

Answered
How can I solve this PDE equation? By applying the pde toolbox?
The PDE Toolbox is not suited to solve your system of 1st-order hyperbolic PDEs. You will have to discretize d(Q*C_i)/dx in e...

10 years ago | 0

Answered
calculate x value from normal distribution
You mean x = norminv([0.015 0.985],a,b) ? Or simply x = norminv(0.97,a,b) ? Best wishes Torsten.

10 years ago | 0

| accepted

Answered
How do I find the solution of an equation using newton-raphson method?
If you multiply your equation with x^2, you get a polynomial equation in x of degree 3 which can be solved using MATLAB's "roots...

10 years ago | 0

Answered
Matlab create finite difference matrix for Backward Euler Method
You will have to introduce two ghost points: x_(-1) = -deltax and x_(N+1) = L + deltax The equations for these points rea...

10 years ago | 0

Answered
How to analytically solve a set of ordinary differential equations of first order
help dsolve https://de.mathworks.com/help/symbolic/dsolve.html Best wishes Torsten.

10 years ago | 0

Answered
Soving integral in MATLAB!!
exp(-x/(a-bx)) for a=0.95 and b=0.05 does not converge to 0 as x -> Inf, but to exp(20). Thus the integral from 0 to Inf cannot ...

10 years ago | 0

| accepted

Answered
ode15s differential-algebraic problem
Sorry, the code was wrong. Use function out = convezione(t,y) out = [y(2) 1/y(1)*(-1.5*y(2)^2 + y(2)/y(3) + sin...

10 years ago | 0

Answered
ode15s differential-algebraic problem
Try function out = convezione(t,y) out = [y(2) 1/y(1)*(-1.5*y(2)^2 + y(2)/y(3) + sin(t)) 1/y(1)*((y(2)/y(3))...

10 years ago | 1

| accepted

Answered
How to solve the differential equation y(a-y)dy = udx/k?
By integrating both sides of the equation: integral_{y=y0}^{y=y}y*(a-y) dy = (a*y^2/2 - y^3/3) - (a*y0^2/2 - y0^3/3) int...

10 years ago | 0

| accepted

Answered
Nonlinear system using newton
You'll get all solutions if you insert y from the second equation in the first equation and use MATLAB's "roots" command to dete...

10 years ago | 1

Answered
Problem with ODE45
Change the following lines: [t,y,te,ye,ie] = ode45(@(t,y)expl(t,y,Mdash,Qdash,Pdash,hdash,s0dash),[0 30],w_init,opts); ...

10 years ago | 0

| accepted

Answered
ode45 solver loop
ODE15S can solve differential-algebraic problems. So just use it to solve the two differential equations for R and the algebrai...

10 years ago | 1

Answered
How to solve linear programming problem?
By defining y((i-1)*n+j)=x(i,j), you get an (n^2x1) vector to be solved for. Best wishes Torsten.

10 years ago | 0

Answered
Finite difference method problem with solving an equation
-(k(x_(i+1/2))*y_(i+1)-(k(x_(i+1/2))+k(x_(i-1/2)))*y_(i)+k(x_(i-1/2))*y_(i-1))/h^2 = Q(x_(i)) with x_(i+1/2)=(x_(i)+x...

10 years ago | 1

Answered
Evaluate gradient for nth variables
syms x y f=x^2-3*x*y+4*y^2+x-y; grad_f=jacobian(f,[x y]); gf=@(xx,yy) subs(grad_f,[x,y],[xx,yy]); gf(2,2) Bes...

10 years ago | 0

| accepted

Answered
Finite difference method problem with solving an equation
[d/dx(k*dT/dx)](x) ~ (k(x+h/2)*(dT/dx)(x+h/2) - k(x-h/2)*(dT/dx)(x-h/2))/h Approximations for (dT/dx)(x+h/2) and dT/dx(x-h/...

10 years ago | 2

Answered
Finite difference method problem with solving an equation
(k(x_(i+1/2))*(T(x_(i+1))-T(x_(i)))/(x_(i+1)-x_(i))-k(x_(i-1/2))*(T(x_(i))-T(x_(i-1)))/(x_(i)-x_(i-1)))/(x_(i+1/2)-x_(i-1/2)) ...

10 years ago | 1

| accepted

Answered
how can I write a function file using FOR loop to find the sum: A + A^2 + A^3 +···+ A^n when A is a square matrix?
Use Horner's method: s=zeros(n); Id=eye(n); for i=1:n s=A*(Id+s); end Best wishes Torsten.

10 years ago | 2

Answered
Please help with the code for Gauss Seidel Method
L = [5 0 0; -3 9 0 ; 2 -1 -7]; U = [0 -2 3; 0 0 1 ; 0 0 0]; b = [-1 2 3]; epsilon = 1; xold = [0 0 0]; while ep...

10 years ago | 0

Answered
Different input per time step ODE45
function main p = [25;25;25]; %(constant) depth of soil layers [cm] % If time is not imported tim...

10 years ago | 1

| accepted

Answered
How to set this iterative multiplication of a matrix with a column vector?
r_old = [1/3; 1/3; 1/3]; M = [1/2 1/2 0; 1/2 0 1; 0 1/2 0]; epsilon = 1; while epsilon > 1e-5 r_new = M*r_o...

10 years ago | 1

| accepted

Answered
Matlab create finite difference matrix for Backward Euler Method
n = 98; full(gallery('tridiag',n,-s,1+2*s,-s)) Best wishes Torsten.

10 years ago | 1

| accepted

Answered
I i have find out a value of unknown variable in equation using solve function, now how can i put that value in a matrix to get new matrix?
M=@(a)[1-a 0 2; 0 4-a 2; 2 2 5-a]; A=M(7); Best wishes Torsten.

10 years ago | 0

| accepted

Answered
mixed boundary condition of 2D heat conduction
Use the PDE toolbox. Best wishes Torsten.

10 years ago | 0

Answered
Creating a function?
h=0 when t=0 ; your function does not have other zeros. Best wishes Torsten.

10 years ago | 0

| accepted

Answered
How to store results in fsolve?
omega=0.3; epsilon=0.316; sigma=2; kappa=1; yitN = [1.784 1.982]; yiSTARtN = [5.970 5.870]; ni = [0.644 0.65...

10 years ago | 0

Answered
Syntax for solving linear equations
x=(b>0); y=(c>0); Best wishes Torsten.

10 years ago | 2

Answered
Second order differential equation, I get a wrong result and i don't understand what I did wrong...
If you prescribe y(0)=y'(0)=0 as initial conditions, the solution y(t)=0 for all t is correct :-) Best wishes Torsten.

10 years ago | 0

| accepted

Answered
Inner Angle of an Triangle
tan(ang/2) = (B/2) / H thus B = 2 * H * tan(ang/2) Does that help ? Best wishes Torsten.

10 years ago | 0

Load more