Answered
Numerically solving an integral with multiple variables.
f = @(u,x)sqrt(u)./(1+exp(u-x)); F = @(x)integral(@(u)f(u,x),0,Inf,'ArrayValued',true); F([2 4])

8 years ago | 1

Answered
multi degree of freedom system with ode45
[t,z] = ode45(@f,ts,z0);

8 years ago | 0

Answered
I want to solve an equation which is complex in nature as well as complex in structure. I wrote a simple code which is not working. I have no idea how to solve that equation. I am attaching the code that i wrote and equation image
eps1=1.5^2; eps2=-13+0.53*1I; eps3=2.25+0*1I; lambda=0.633e-6; k0=2*pi/lambda; a=1/k0; t=1/k0; p1=@(epse)k0*sqrt(epse-e...

8 years ago | 0

| accepted

Answered
How to solve a system of trigonometric equations?
E1^2 + E2^2 + (E3-l1)^2 - l2^2 - l3^2 = 2*l2*l3*cos(theta3) Can you take it from here ?

8 years ago | 2

| accepted

Answered
Can anyone help me with my ode?
[time,n] = ode15s(@volterra_allelo,[0 20],[1.2658e+04/2; 6.3095e+03/2]);

8 years ago | 0

| accepted

Answered
How to solve a partial derivative equation in MATLAB?
Use "pdepe". Best wishes Torsten.

8 years ago | 0

Answered
2nd order ode using euler method
function main xinit = 0; xfinal = 3; yinit = [1 0]; h = .5; [x,y] = euler_explicit(@dpnon,xinit,yinit,xfinal,h) ...

8 years ago | 2

| accepted

Answered
Solving nonlinear advection diffusion equation with pdepe
function [x,h] = Transient(); %% Initialization theta = 50; % degrees - angle of repose of material n = 8; % r.p.m. - rot...

8 years ago | 0

| accepted

Answered
Newton method to find polinom roots?
p = [ 1 -1 -6 0] x0 = 2; n = length(p); pd = polyder(p) result = []; for i = 1:8 fx = polyval(p,x0); ...

8 years ago | 1

| accepted

Answered
How to find values of variables?
Try X = null(Q.') Best wishes Torsten.

8 years ago | 2

| accepted

Answered
Time derivative of parameters within ODE solvers
function dy = ODE(t,y) dt = 1e-8; fm = myfun(t-dt); f = myfun(t); fp = myfun(t+dt); df = (fp - fm) / (2 * dt); ...

8 years ago | 0

| accepted

Answered
is it possible to change step size of "ode45" ?
The stepsize of ode45 is not constant, but chosen such that the error tolerances you prescribe are met. Thus mean step size can ...

8 years ago | 2

| accepted

Answered
Common error message: "Index exceeds matrix dimensions"
"Market_Price" is a one-dimensional array ; you try to access "Market_Price(t,k)".

8 years ago | 0

| accepted

Answered
Problem while solving the problem ode45
[t,y]=ode45(@(t,y)pair(t,y,a,b,c),tspan,[2 4]); function dy=pair(t,y,a,b,c) dy(1)= -a.*y(1)+b*exp(-t); dy(2)=(-y(1).*y(2).^...

8 years ago | 0

Answered
How to sum and plot a series of functions?
n = 24; k = 1:n; part1 = @(x) sin(k*x) part2 = (2/pi*(1-(-1).^k)./k).'; x = linspace(0,2*pi,100); Snx = arrayfun(@(x)part1(...

8 years ago | 1

| accepted

Answered
How to use linear programming to solve following minimisation problem: min C'x subject to Ax - sum(x)b ≤ 0
The constraints read A'*x <= 0 with elements a'(i,j) = a(i,j) - b(i) Best wishes Torsten.

8 years ago | 2

| accepted

Answered
Index in position 1 exceeds array bounds (must not exceed 5)
In the stated expression, you try to use Q(6,1) which is undefined. (In the top loop, Q(i,1) is only initialized up to Q(5,1)). ...

8 years ago | 0

| accepted

Answered
Finding maximum integer between [100,200] divisible by 21?
n = 200 - mod(200,21)

8 years ago | 0

Answered
Find the minimum of a multivariable anonymous function + error message
v = fminsearch(@(x)y(x(1),x(2)),v0);

8 years ago | 0

Answered
Could someone please help me fix this code?
function main %% preparations a=0; b=10; N=100; % t0, t final, N values h=(b-a)/N; % step si...

8 years ago | 0

| accepted

Answered
help, my ode is not working. First will be my main code. Second will be the function I am calling for.
The last argument (cd) is missing in the call to "dynamiteff" in the line [t1,vel1]=ode45(@(t1,s) dynamiteff(t,s(1),s(2),timeto...

8 years ago | 0

Answered
How to solve system of non linear hyperbolic equations, where the hyperbola orientations may not be parallel with axes.
fun = @(x,y) (sqrt((0-x(1))^2+(9-x(2))^2)-sqrt((0-x(1))^2+(0-x(2))^2)-2.214)^2+(sqrt((12-x(1))^2+(0-x(2))^2)-sqrt((0-x(1))^2+(0-...

8 years ago | 0

Answered
Use previous calculated value in ODE as guess in current timestep
The easiest way is to include the algebraic equation for pressure in the system solved by the ODE integrator. Note that the ODE ...

8 years ago | 0

Answered
Error: Failure in initial user-supplied objective function evaluation. FSOLVE cannot continue.
Print the "res"-vector, and you'll probably find the problem. I guess some elements of the res-vector will be NaN or Inf values....

8 years ago | 0

Answered
Calculating arc length of a curve
Use Pythagoras' theorem: n = numel(x); length = 0.0; for i = 1:n-1 length = length + sqrt( (x(i+1)-x(i))^2 + (y(i+1)-y(i)...

8 years ago | 2

| accepted

Answered
find the maximum value of a function
The maximum value for diff(y,2) is attained in x=b with value -(14/(14*b+30))^2.

8 years ago | 3

Answered
Fit an Ordinary Differential Equation (ODE) using fmincon
function main % ydata from excel filename = 'Messung_1.xlsx'; sheet = 12; Range1 = 'C6:C3790'; Range2 = 'D6:C3790'; t_Kl ...

8 years ago | 0

| accepted

Answered
eigenvalues and eigenvector manual calculation
By solving (A-lambda1*I)*v1 = 0 and (A-lambda2*I)*v2 = 0 You could use v1 = null(A-lambda1*I) and v2 = null(A-lambda2*I) ...

8 years ago | 2

| accepted

Answered
Solving differential equation that includes an (extra) unknown function
Take a look at the example ODE with Time-Dependent Terms under https://de.mathworks.com/help/matlab/ref/ode45.html I will s...

8 years ago | 1

| accepted

Answered
How do I plot a 1-d random walk that generate 1 and -1 with equal probability? I am struggling to plot every individual P that I get against i the number of step.
n = 10; P = zeros(n,1); P(1) = 0; % Starting value for i=2:n % i is the number of steps from 1 to 10 R = rand; if R ...

8 years ago | 1

| accepted

Load more