Bvp4c 2nd order equation with 2nd and 3rd order boundary conditions
Since you can only impose two boundary conditions for a second-order equation, take the first and the third. They should already...

7 dagen ago | 0

| accepted

Solve non linear m equations in n unknows with m,n
k = lsqnonlin(F,k0)

7 dagen ago | 0

| accepted

How can ı solve this difference equation ?
um2 = 0; um1 = 0; u0 = 1.5820; u1 = -0.5820; u2 = 0; xm2 = 0; xm1 = 0; x0 = 1.3679*xm1 - 0.3679*xm2 + 0.3679*um1 + 0.2642...

8 dagen ago | 0

| accepted

Variable not saving as a double
You mean t = 0:1:100; x = 0.5*exp(2*sin(t))./(10.5*exp(2*sin(t))); plot(t,x) (which is equal to 0.5/10.5=0.04761... because ...

10 dagen ago | 0

| accepted

Constraints on Parameter Estimation

10 dagen ago | 0

| accepted

problem in creating function file using ode45
Be careful with the order of the solution vector Y. It is (y, Dy, x, Dx). You have to supply the vector of initial values "ic" i...

10 dagen ago | 0

| accepted

How do I plot two different functions on the same plot?
Use hold on plot(...) % plot first graph plot(...) % plot second graph hold off

11 dagen ago | 0

| accepted

solving series of algebric linear equations using for loop
N = 4; xleft = 1.0; xright = 3.0; x = linspace(xleft,xright,N+1); h = (xright-xleft)/N; A = zeros(N+1); b = zeros(N+1,1); ...

11 dagen ago | 0

Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.
You don't define Kb as a global variable in the part of your code where you set it as Kb = physconst('boltzmann'); % 1.38*10^(-...

11 dagen ago | 0

Projectile Motion when y0 does not equal 0
Solve y(t) = 0 for t and you'll find tf, the time when the projectile hits the ground.

11 dagen ago | 1

Matrix "index in position 1 exceeds array bounds (must not exceed 1)"
i=1; X1(i)=0; X2(i)=0; X3(i)=0; error_X1(i)=9999; error_X2(i)=9999; error_X3(i)=9999; instead of i=1; X1=0; X2=0; X3=...

11 dagen ago | 0

invalid expression error.
B = 0.02; a = 0.1; f = 0.53; phi = 3*pi/4; t = -5:0.05:10; x = B^a*exp (-a*t) .*sin(... 2*pi*f*t+phi); xu = x...

11 dagen ago | 1

| accepted

samsonwork() function sol=samsonwork global Br Sc delta P K R n epsilon %x=linspace(-1,1,11); r=0:0.01:3; Br=1;Sc=0.4;n=3;d...

11 dagen ago | 1

| accepted

fmincon: proble defining the function
f = @definefunction; instead of f=definefunction(x); And you cannot use random inputs on each call - thus comp1 = double(ra...

12 dagen ago | 0

| accepted

Finding linear combination of two vectors such as every element is positive
n = 5; v1 = -10 + rand(1,n)*20 v2 = -20 + rand(1,n)*40 % If there is a solution x for which A*x > zeros(size(A,1),1), then th...

12 dagen ago | 1

User defined function within ode45
Symbolic functions like the one you get if you use the "piecewise" command are not allowed with ODE45. Either define the right-...

12 dagen ago | 0

How can I do a Monte Carlo simulation for 1000 runs on this operation?
Maybe you mean: % A = T(:,1); %Column vector A = [71.213; 74.499; 79.175; 54.163; 83.008; 52.615]; B = length(A); %size of c...

12 dagen ago | 0

| accepted

Can someone help me to correct the code ​​for this problem using ode45 solver?
This is a boundary value problem, not an initial value problem since conditions on f and theta are given on both ends of the int...

12 dagen ago | 1

Three equations need three unknowns, not only one. clc; close all; clear; a1=20; b1=20; k1=sqrt((a1+10)^2+b1^2)-sqrt((a1-...

13 dagen ago | 0

Numerical integration of a nested integral; limits of inner integral depend on the outer integration variable
I'm not sure your integral exists ... Bessel_integrand = @(x) x .* besselj(0,x); Integrand_B = @(a) integral(Bessel_integrand,...

13 dagen ago | 0

Error in plotting a function, left and right side with diferent dimensions
Most probably, vet_servido(j) = - (1/2) * log(1- x_exp(j)); instead of vet_servido(j) = - (1/2) * log(1- x_exp);

14 dagen ago | 0

| accepted

Left division with partially known coefficient
It's a nonlinear fitting problem - backslash doesn't suffice here. I set p = 1/(d*K) . If you like, you can retransform the res...

14 dagen ago | 0

| accepted

Why do I get "Array indices must be positive integers or logical values"?
Ta = 504; y = 1.4; Ra = 1716; M = .1:.1:5; for i = 1:numel(M) u(i) = M(i)*sqrt(y*Ra*Ta); end plot(M,u) or simply Ta...

15 dagen ago | 0

numerical integration theorem of residues
You can define the function to be integrated in a function - you don't need to use handles. In this function, you can perform a...

15 dagen ago | 0

| accepted

Integral of matrix determinant
f=@(x)det([1,x;0,2]); integral(f,0,1,'ArrayValued',true)

15 dagen ago | 0

| accepted

custom logarithmic fit with three coefficients
It doesn't make sense to use three fitting parameters for the function type you supply. a + b*log(c*x) = a + b*log(c) + b*log(x...

15 dagen ago | 0

| accepted

lsqcurvefit for multiple variables optimization
We need your "YL_function" to see what's happening. I wonder whether your transformation is correct. I would have thought y_r...

15 dagen ago | 0

| accepted

Absurd result using 'integral2' with non-"centered" functions
It's not possible for integral2 to capture the small peak around 50 to return 1 as result. Use result = mvncdf([-Inf -Inf],[In...

15 dagen ago | 1

| accepted

fminsearch output size bigger than the variables to optimize?
[10000 1000 0.2] instead of [10000 1000 0,2] as the vector of initial conditions. MATLAB is not Excel.

16 dagen ago | 0

| accepted