Answered
Solving a non linear ODE with unknown parameter
%time points ts=[1 2 3 4 5 6 7 8]; DP=[1000 700.32 580.42 408.20 317.38 281.18 198.15 100.12]; p0 = 1e1; p = fminunc(@(p)fun...

4 years ago | 1

| accepted

Answered
I am trying to solve a coupled set of ODE's different ways. (1) using ode45 which I have been able to do (2) solve them using Euler's method and (3) Heun's method
global k1 k2 k3 V0 v0 CA0 k1 = 0.5; k2 = 0.06; k3 = 0.04; V0 = 50; v0 = 1.5; CA0 = 0.8; % ode45 soltion method tspan = [...

4 years ago | 0

Answered
Jump in a graph
x1 = 1:0.1:108; y1 = nthroot(x1,3)*8.56; x2 = 108; y2 = 44.57; plot([x1,x2],[y1,y2])

4 years ago | 0

| accepted

Answered
curve fitting tool custom equation
Don't use the data for t > 6.3 in the fitting process.

4 years ago | 1

Answered
Undefined variable in function
fun = @(x) integral(@(omega)cos(omega*x).*sin(omega)./omega,1e-10,8,'ArrayValued',true); x = -2:0.01:2; plot(x,fun(x))

4 years ago | 0

| accepted

Answered
Having trouble trying to integrate.
fx = @(x) x.*103./200.*sin(x); q= integral(fx,0,2.794)

4 years ago | 0

Answered
An error occurred:LSQNONLIN requires the following inputs to be of data type double: 'LB'. How to solve it?
[nrtl2,fval,exitflag,output]=lsqnonlin(@(p)NRTL2(p,T,P,x1,x2,y1,y2,P1S,P2S,P3S),deltag0,[],[],options); instead of [nrtl2,fval...

4 years ago | 1

| accepted

Answered
How to find unknown parameters in a nonlinear least squares function?
A = [cos(3*t).^2,ones(numel(t),1),]; B = t.^0.8./f; X = A\B; %or X = inv(A'*A)*A'*B; c1 = X(1); c2 = 1/X(2); instead of A...

4 years ago | 1

| accepted

Answered
my error tolerance should be less than 1E-3 but ı have no idea how to integrate this factor into my code
format long f = @(x) 2^(x^2) *3^x - 7^(1/2); a = 0; b = 2; eps = 1e-5; errorF = 1.0; errorX = 1.0; while errorF > eps && ...

4 years ago | 0

Answered
Trying to get a table output when inputs are arrays for norminv function
Maybe you want something like this: for i=1:numel(mu) x(:,i) = norminv(p,mu(i),sigma(i)); end

4 years ago | 0

| accepted

Answered
Index exceeds number of array elements
Maybe it's interesting to compare with the analytical solution: T(r ) = a/r + b where a = 121/(1/0.176 - 1/0.236) b = 40 - a...

4 years ago | 0

Answered
Plotting a function containing a single integral with two variables
Use the integral expression obtained here https://www.wolframalpha.com/input?i=Exp%5B-a*x%2Bb*Sqrt%5Bc-x%5D%5D for the x-integ...

4 years ago | 0

Answered
Error in estimating Nakagami parameters using maximum likelihood estimate function: Error using prob.NakagamiDistribution>nakafit (line 271) The data in X must be positive
I don't know if this makes sense with respect to what you are trying to do, but MATLAB expects your data to fit a Nakagami distr...

4 years ago | 0

Answered
I got the error: Subscript indices must either be real positive integers or logicals. Could I have your help please?
You initialized "element_node" as a matrix of zeros. That's why you try to access node_xy(1,0),node_xy(2,0) in the area calculat...

4 years ago | 0

Answered
Why do I get "Array indices must be positive integers or logical values." error?
syms x y z f=2*x+y+2*z^2-5; g=y^3+4*z-4; h=x*y+z-exp(z); fdx = diff(f,x); %derivative of f wrt x fdy = diff(f,y); %derivati...

4 years ago | 1

| accepted

Answered
uniformly distributed random vectors
N=1000; A=rand(2,N); x=A(1,:); y=A(2,:); x = x-mean(x); y = y-mean(y); idx = x.^2+y.^2<=0.25; x=x(idx); y=y(idx); p...

4 years ago | 0

| accepted

Answered
How to use ksdensity to find the probability density of the original data when only the original data is known
Did you try to make a histogram first ? h = histogram(x,'Normalization','probability') where x is your data vector.

4 years ago | 0

Answered
Getting single answer for function with an array
D=(0.5*d*V.^2*S*Cd+K*W^2)./(0.5*d*V.^2*S) instead of D=((0.5)*d*(V.^2)*S*Cd+(K*W^2))/((0.5*d*(V.^2)*S))

4 years ago | 1

Answered
Given a list of numbers, how do you take specific numbers at time?
https://de.mathworks.com/help/map/ref/combntns.html https://de.mathworks.com/help/matlab/ref/nchoosek.html

4 years ago | 0

| accepted

Answered
Fixed Bed Adsorption Model
Cfeed = 0.0224; % Inlet concentration tf = 3000; % End time nz = 400; % Number of gateways np = nz + 1; % N...

4 years ago | 1

Answered
How to find steady state solution of recatti equation
If it's a Riccati equation, use "icare" or "idare".

4 years ago | 0

| accepted

Answered
Solving a Nonlinear Equation using Newton-Raphson Method
x=[0;0]; for i=1:3 [J,f]=jfreact(x); x=x-J\f end function [J,f]=jfreact(x) del = 0.000001; df1dx1 = (u(x(1)+del...

4 years ago | 0

| accepted

Answered
MIL PROBLEM WITH A VECTOR DATA - HOW TO FIND AN UNIQUE SOLUTION AND NOT ONE FOR EACH DATA?
Solutions to MILP problems are for a specific set of numerical input data (in your case wind data). Usually, there are no symb...

4 years ago | 0

Answered
problem regarding plotting cuvres
Insead of using plot(x,y) try [sorted_x,I] = sort(x); sorted_y = y(I); plot(sorted_x,sorted_y) for the green and blue cur...

4 years ago | 0

| accepted

Answered
I am trying to solve a coupled set of ODE's different ways. (1) using ode45 which I have been able to do (2) solve them using Euler's method while calling the same function.
for i=1:n-1 q(i,:) = proj2ode45(t_E(i),N_E(i,:)); Na(i+1)=Na(i)+h*q(i,1); Nb(i+1)=Nb(i)+h*q(i,2); Nc(i+1)=Nc...

4 years ago | 1

| accepted

Answered
Solving Differential Equations Symbolically and Numerically
Did you read the part "Solve Differential Equations with conditions" under https://de.mathworks.com/help/symbolic/dsolve.html...

4 years ago | 0

| accepted

Answered
PDE model not producing desired results
You need to impose a boundary condition for y at z=0. Since the equations are hyperbolic in nature, central differencing is str...

4 years ago | 1

| accepted

Answered
How to get the sum of the rows of a matrix?
Multiply the matrix with ones(3,1)

4 years ago | 0

Answered
Answers of equation are mismatch
Ix = ((w.^2+4*w*81+81^2)./(36*(w+81))).*h.^3; instead of Ix = ((w.^2+4*w*81+81.^2)/(36*(w+81)))*h.^3;

4 years ago | 1

Answered
The last line is wrong. The system reminds that "Input function must return 'double' or 'single' values. Found 'sym'." How can I obtain the constant matrix K after integral ?
So many problems. Had to restructure the code completely. value = zeros(3,3); for i=1:3 for j=1:3 value(i,j) = inte...

4 years ago | 1

| accepted

Load more