Answered
Why isn't fsolve working for my set of nonlinear equations?
Xlin =[ 0.0242 0.0118 0.0058 0.0029 0.0015 0.0008 0.0007 0.0005 0.0004 0.0002]; n=...

3 years ago | 0

Answered
How to do normal distribution for same data?
%Import front sonar for 30cm: sonar_F_030 = readtable("https://de.mathworks.com/matlabcentral/answers/uploaded_files/1195733/so...

3 years ago | 0

Answered
What does ~ signify in: function [x, f, g] = defineSystem(~, params)
It signifies that the function "defineSystem" is usually called with two inputs, but that the first input can be ignored in the ...

3 years ago | 0

| accepted

Answered
Error using piecewise function
"piecewise" works on symbolic arguments. Define t = linspace(-5,5,1001); x1 = (1-abs(t)).*(abs(t)<=1); plot(t,x1) instead....

3 years ago | 0

| accepted

Answered
How can I do a Method which returns a Rotation Matrix?
syms theta phi M = [cos(theta) -sin(theta) 0;sin(theta) cos(theta) 0;0 0 1]*[1 0 0;0 cos(phi) -sin(phi);0 sin(phi) cos(phi)]*[c...

3 years ago | 0

Answered
How do i plot a derivative versus time
[T,Y] = ode45(@reduced,tspan,y0) for i = 1:numel(T) dy(i,:) = reduced(T(i),Y(i,:)); end plot(T,dy(:,2))

3 years ago | 0

Answered
Why " The boundary condition function BCFUN should return a column vector of length 5" error message is came?
Choose a grid 0=t0 < t1 < ... < tn = tf With each grid point, associate a value ui of your control function u (the ui are your...

3 years ago | 1

Answered
Linear line that passes through the origin as a tangent to Quadratic line
The tangent to your quadratic through a point (x0,a*x0^2+b*x0+c) is given by y(x) = (2*a*x0+b) * x + ((a*x0^2+b*x0+c) - (2*...

3 years ago | 0

Answered
Implement for loop in ode45 solver
parameter.mumax = 0.42; %1/h parameter.Km = 0.25; %g/l parameter.Sin = 60; %g/l parameter.Yxs = 0.25; %g/g D = 0.1:0.1:0.5; ...

3 years ago | 0

| accepted

Answered
Failure of initial objective function
Then set some outputs in the function "Posterior" to see where the NaN operation occurs.

3 years ago | 1

Answered
how to find all possible stationary points of a system of nonlinear equations
Your equation could become stationary if 2*x + y = pi/2 or pi + pi/2 or 2*pi+pi/2 or ... or 6*pi+pi/2 3*x + 2*y = pi/3 or pi+p...

3 years ago | 1

Answered
Solving the system of ODEs
Note that you divide by 0 since B1 = 0 at your initial point. tspan = [0 1]; nach = [0.375, 0, 0, 0].'; [t, syst] = ode45(@...

3 years ago | 0

| accepted

Answered
I want to solve this equation for Xp while I know all others parameters.
%Defining variable syms Xp % outlet conc. Xo = 0.10; % inlet conc K = 5.83e-2; % numerical constant P = 3; % pure component...

3 years ago | 0

| accepted

Answered
3D Plot to SURF
Given arrays x,y and z where the x,y values are not on a regular grid, you might want to try ScatteredInterpolant first https:/...

3 years ago | 0

Answered
How to receive the inverse of the diff(x) array calculation ?
x = [4 6 9 13]; s1 = -diff(x) s2 = [x(1)-x(2),x(2)-x(3),x(3)-x(4)]

3 years ago | 0

| accepted

Answered
How to write a code for an equation in such a way that it add previous results repetitively?
xi = 5.55e5; X = ...; Y = ...; x = [xi,sqrt((X(2:end)-X(1:end-1)).^2 + (Y(2:end)-Y(1:end-1)).^2)]; % assumes X and Y are ro...

3 years ago | 0

| accepted

Answered
Input function must return 'double' or 'single' values. Found 'sym'.
rho_w_ad and t_w_ad are functions of t. So you will have to define f4 = @(t,x,s) (1./(t-s.^4)).*(rho_w_ad(t)+t_w_ad(t).*((x./(t...

3 years ago | 1

| accepted

Answered
Using trapz for integrating with nonuniform spacing
You mustn't use "dtime" in the call to "trapz", but the actual time vector t for which the simulation gave you the corresponding...

3 years ago | 0

Answered
Gather auxiliary output from bvp4c
You mean sol = bvp4c(odefun,bcfun,solinit,options); C1 = sol.y(1,:); C2 = sol.y(3,:); RO2 = nu1/D*C1./(K1+C1); RNO3 = IC1./...

3 years ago | 0

| accepted

Answered
Solving system of 3 implicit equations
Rewriting equation (3) gives d1 = x1 * exp(beta*(1-x1)^2) * CMC1/CMCm This is almost equation (1). If I assume that you made...

3 years ago | 0

Answered
Log zu Basis 2 symbolisch rechnen
syms n z positive eq = n*log2(n) - z == 0 sol = solve(eq,n) W_0 ist die LambertW Funktion: https://de.mathworks.com/help/sym...

3 years ago | 0

Answered
How i can find ( ZT,N1,N2) N1,N2>=0
It's difficult to grasp all the necessary information: N1,N2 >=0 from the title, N1,N2 integer from your tags. f = [130 100]; ...

3 years ago | 0

Answered
Solving coupled differential equation using method of lines – no difference in axial direction?
for i=2:n DuDx(i) = (u(i)-u(i-1))/(x(i)-x(i-1)); ... instead of for i=2:n-1 DuDx(i) = (u(i)-u(i-1))/(x(i)-x(i-1)); ...

3 years ago | 0

| accepted

Answered
Minimizing a objective function, which includes an integral with argument 'x' and some unknown variables.
R0 = [1 5]; R = fminsearch(@fun,R0) function y = fun(R) R1 = R(1); R2 = R(2); % Declare parameters ... f1 = @...

3 years ago | 0

| accepted

Answered
Trying to calculate a function with several integrals
You won't get an analytic expression for the density of the convolution of the normal distribution and the Weilbull distribution...

3 years ago | 0

| accepted

Answered
how can I find the surface area and the volume through this code?
v =[2;0;1;9;0;1;3;0;1]; m = max(v); n = mean(v); f = @(x)(3+sin(m*x)+cos(n*x)); x = -2*pi:0.01:2*pi; plot(x,f(x)) df = @...

3 years ago | 0

Answered
ODE45 Iterations details
Display time and sol values either in a function "OutputFcn" or - quick and dirty - directly in "fun" during the solution proces...

3 years ago | 0

Answered
How to use CVX in matlab code?
Use intlinprog. No need to linearize anything - your equations are linear in the unknowns.

3 years ago | 1

Answered
How to solve this symbolic nonlinear equation
It seems no zero exists: syms X Z A X=2-sqrt(4-2*A); Z=2/A-sqrt(4-2*A)/A; H1 = [0 -1 -1; 1 A 0 ; Z 0 X-4]; [V1,D1] = eig(H1...

3 years ago | 0

Answered
Shooting method ode45 Fzero
Your code tries to determine dT/dt at t=0 such that the solution of the equation d^2T/dt^2 = ((280*exp(-((t-L/2)^2))+(dT/dt)/3)...

3 years ago | 1

| accepted

Load more