Answered
Numerical differential equation solver for initial conditions not at y0
The solution seems to be very sensitive to the initial condition. syms Uf(t) delta y d = 0.2000; k_Karman = 0.4; sol_Um = 3....

4 years ago | 0

| accepted

Answered
error using inlineval, error unexpected MATLAB expression
syms x f = log(3*x+1) g = diff(f,x)

4 years ago | 1

Answered
Why this code doesn't work?
ti=0.0; tf=15.0; ui=30.0; m=2585; g=10; W=m*g; Theta=0.0; Fx=-2000; f=0.03; rho=1.225; Cd=0.2; A=2.9; uw=0.0; tol=1.0E-4; tra...

4 years ago | 1

| accepted

Answered
Triple integers (cylindrical method)
lower_z = @(r,theta) 0.5*r.^2.*sin(theta).*cos(theta); upper_z = @(r,theta) r.*sqrt(cos(theta).^2+2*sin(theta).^2); fun = @(r,...

4 years ago | 1

| accepted

Answered
Errors with fmincon in Matlab script
[x,fval] = fmincon(@(x)system2(x(1),x(2)),[2;3.5],[],[],[],[],[1;2],[3;5]) instead of [x,fval] = fmincon(system2,[2;3.5],[],[]...

4 years ago | 1

| accepted

Answered
implementation of the bisection method
%fixed inputs c=25.8972; b=0.0320; a=0.7535; R=0.0821; Vc=0.1951; % Generate 30 artificial (Pstar,T) pairs to test Pstar_...

4 years ago | 2

| accepted

Answered
diffuclt to write the su of a number
s0 = 0.5; s = 0; for i=1:1000 s=s+s0; end disp('the sum is: '),s disp('compare with:'),1000*s0

4 years ago | 1

Answered
Array indices must be positive integers or logical values.
f is interpreted here as an array, and arrays can only be indexed with positive integers or logical values. So f(-6) is forbidd...

4 years ago | 0

| accepted

Answered
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
The usual way to define a function is function [output1,output2,...] = name_of_the_function(input1,iput2,...) Your line of...

4 years ago | 0

Answered
Divided difference in Newton's form error
Whatever your code is supposed to do, add a sixth element to the vector "a" in function "dd": a = [-5, 2, -4, 8, 3, 6]; instea...

4 years ago | 0

Answered
sorting vector by value and position
A = [109 97 116 108 97 98]; [~,p] = sort(A,'ascend'); r = 1:length(A); r(p) = r

4 years ago | 1

| accepted

Answered
Optimoptions - Invalid solver specified error
You wrote 'StepToleance' instead of 'StepTolerance' ...

4 years ago | 0

Answered
Find x and y cordinates and t for z=0
xvel=20; yvel=20; zvel=40; g=-9.80665; t = [0:0.1:10]; xacc = 0; yacc = 0; zacc = g; sx = xvel*t + (0.5 * xacc*t.^2); s...

4 years ago | 0

Answered
Error using plot Vectors must be the same length.
Replace mf = [mf1 mf2 mf3]; by mf = [mf1; mf2; mf3];

4 years ago | 0

Answered
Calculate the next 2 numbers in the sequence
u_(n+2) = 4*u_(n+1) + 2*u_n If you insert n = 0, you get u_2 = 4*u_1 + 2*u_0 So what is u_2 given that u_0 = 3 and u_1 = 2 ? ...

4 years ago | 0

| accepted

Answered
Trying to find the Euclidean distance of 2 vectors with different sizes
T =[5.1000 3.5000 6.4000 3.2000 5.4000 3.4000 5.7000 2.8000 5.7000 4.4000 5.6...

4 years ago | 0

Answered
Function for ODE45 requires all coefficients be written in it
tspan = linspace(0,35,35000); f0 = [1; 1; 1; 1; 1; 1; 1; 1]; a = 2; g_p = 3; g_s = 105; g_a = 0; g = 1; k = 250; P = 0; O_z = ...

4 years ago | 1

Answered
Making a horizontal region between two functions
f = @(x) x.^3; g = @(x) x.^(1/3); a = 0; b = 1; hold on fplot(f,[a,b]) n = 20; for i = 1:n+1 start = [g((i-1)/n*b),1];...

4 years ago | 0

Answered
Set initial condition to time different to 0
This is a boundary value problem, not an initial value problem. Thus you should use bvp4c instead of ode45.

4 years ago | 0

Answered
Finding the minimizer using fminunc.
fv = @(x) x(1)^2 + x(1)*x(2) + (3/2)*x(2)^2 - 2*log(x(1)) - log(x(2)); [minimizer,minimum_value] = fminunc(fv,[1; 1])

4 years ago | 0

| accepted

Answered
Testing if Data is close to the Exponential Distribution
How can I take this data and see if it is exponentially distributed? There is no way to do so. Also, how can I find how far t...

4 years ago | 1

| accepted

Answered
Nonlinear equations with two variables and a changing parameter
%The below is a system of nonlinear equations with two variables x, t, and %a changing parameter V. 0<x<0.2, t is around 6.3e6,...

4 years ago | 0

| accepted

Answered
Solving a system of equations using the solve function in a for loop?
Remove all the (t) in the symbolic variables, so use syms q TPCM Toil_PCM_to_EG instead of syms q(t) TPCM(t) Toil_PCM_to_EG(...

4 years ago | 1

Answered
How to fit parameters of an ode by using ode45 and fmincon
Check your differential equations. As you can see, the derivatives for the given constellation (parameters and initial condition...

4 years ago | 1

| accepted

Answered
Solve Command giving wrong numbers for certain values, but gives perfect answers for the rest?
As you can see, there are two solutions for angle_3 and angle_4. Seems you took the wrong one for 290-330 degrees. syms angle_2...

4 years ago | 0

Answered
3 state space model time discretization
x_dot = A*x + [B,C]*[u;v] So define A_ss = A, B_ss = [B,C]

4 years ago | 0

Answered
Steady-state solution for system of parabolic PDEs?
Since this gives a system of second-order ODEs in general, the usual code to try would be "bvp4c".

4 years ago | 0

| accepted

Answered
Fitting curve of curve with parametric representation to measured data
opt = fmincon(@(S)Fehlerberechnung_Kreisevolvente(S(1),S(2),S(3),S(4)), [2,0,0,0]) instead of opt = fmincon(@(S)Fehlerberechnu...

4 years ago | 0

| accepted

Answered
When coding of function that shows error in yellow underline.
If f is a function handle, this line of your code doesn't make sense: if fc > f Only the result of function handles applie...

4 years ago | 0

Load more