Beantwortet
Removing vertical lines in a piecewise function when discontinuty points are not known
Maybe something like this. But the jump height of 0.05 at discontinuities most probably has to be adjusted in other applications...

etwa 3 Jahre vor | 1

| akzeptiert

Beantwortet
Implicit system of ODEs, problem with ode15i
You can explicitly solve for yp - so there is no need to use ode15i. But the Gamma-problem remains. clc; clear all; close all ...

etwa 3 Jahre vor | 0

Beantwortet
Is there a way to take integrals over changing variables? Matlab
As far as I can see from the plots, we get the same results. syms p0 x b zeta real % Calculate lift distribution pz(x) pz = p...

etwa 3 Jahre vor | 0

Beantwortet
Problem using lsqnonlin with a simulink model
Did you study this example: https://de.mathworks.com/help/optim/ug/lsqnonlin-with-a-simulink-model.html ?

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
Solving exact ODE and fplotting a solution curve.
Why do you think sol(1) in your code above gives a trivial solution ? Is y(x) = -exp(x) trivial ? syms y(x) ode = (exp(x + y)...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
how does fmincon interior-point algorithm deals wtih underdetermined system?
All optimization problems are "underdetermined" in the sense of what you wrote above (i.e. less equality constraints than unknow...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
remove negative values from one column and the corresponding data in another coloumn
t = linspace(0,1); x = -1+2*rand(size(t)); idx = x<=0; x(idx) = []; t(idx) = []; size(t) size(x)

etwa 3 Jahre vor | 1

Beantwortet
How can I save one of variable in my function ?
After ode45 has finished, just recalculate NOD1 in the calling program for the time vector t: [t,x]=ode45(@odeHar,tspan,x0); ...

etwa 3 Jahre vor | 2

| akzeptiert

Beantwortet
Definition of the error function in lsqnonlin
Use a function instead of a function handle. p0 = [1 2]; x = 0:1/10000:10 p = lsqnonlin(@(p)fun(p,x), p0); function err = ...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
I don't know how to make a loop to my System ( System of coupled differential equation) with a heaviside step or square wave ?
ico=10; Vapp=0.6; V_T=1; V_m=.05; la=19.83; Ra=297.5; Rb=1457; Rs=8; Cm=1.2e-8; t_K=la/Ra; t_m=Cm*Rb; T = []; X = ...

etwa 3 Jahre vor | 1

| akzeptiert

Beantwortet
one error i can not solve plz solve it.
If you check the sizes of vs.' and 1j*2*pi*f_mod*t size(vs.') size(1j*2*pi*f_mod*t) you will see that multiplication...

etwa 3 Jahre vor | 0

Beantwortet
Solving a complicated system of ODEs
You use dydt(5) and dydt(6) before they have been assigned their values: dydt(1) = -dydt(5) - k.*theta1; dydt(2) = -k....

etwa 3 Jahre vor | 1

Beantwortet
Trying to plot 2 variable 3d graph. The z matrix is filled with NaN values only.
TMR = (f_m*(f_Cd*sqrt(2*(f_dP_factor*p_c)/f_d)))./(o_m*(o_Cd*sqrt(2*(o_dP_factor*p_c)/o_d))); instead of TMR = (f_m*(f_Cd*sqrt...

etwa 3 Jahre vor | 0

Beantwortet
How to find the maximum value of two variables of a function in MATLAB
eta = 0.01:0.01:1; x0 = (1:1:100).'; z = 1e6*log2(1+(10^(30/10)*4*(3e8/(4*pi*1e12))^2*15^(-4)*exp(-0.0016*15))/10^(-90/10))*(-...

etwa 3 Jahre vor | 0

Beantwortet
Updating of boundary condition during bvp4c solution procedure
In bvp4c, your boundary conditions at xl = xstart and xr = xend can take the form fl(xl,psil) = 0 and fr(xr,psir) = 0 where fl a...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
optimproblem does not solve an analytical equation correct
Works for me (see above). Your objective must return the norm of A*x (squared), not A*x.

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
use symsum for equation forming and solving
The equation is linear in k_d. So collect all terms containg k_d on the left hand side, all other terms on the right-hand side...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
Obtain Hessian matrix from a sum of squares expression
Each optimizer expects the unknowns as a vector, not as a 2d-matrix. So choose an arrangement of your unknowns in a vector of s...

etwa 3 Jahre vor | 2

Beantwortet
Error in dfdt (line 3)
The code line in the loop must read za(i) = (z(i+1)-z(i-1))/(2*h) instead of za(i) = (z(i+1)-(i-1))/(2*h) And call the funct...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
how can i write a code to find maximum error in Lagrange polynomial for given functions?
Choose a fine enough grid x on [0,2], evaluate your function(s) f(x) and the Lagrange polynomial(s) L(x) for the grid points and...

etwa 3 Jahre vor | 0

Beantwortet
Can argument validation check if size is at least some value?
b = 1:5; v = size(b,2) >= 4 b = 1:3; v = size(b,2) >= 4

etwa 3 Jahre vor | 0

Beantwortet
Variable output as "1x0 empty double row vector" halfway through the program after previous iterations in the for loop has normal output values for the same variables.
It may happen that no peaks can be found: RC = 1:4; V = 1:4; [Peaks, X_Peak_value] = findpeaks(RC, V)

etwa 3 Jahre vor | 0

Beantwortet
trying to solve two non-linear simultaneous equations but I had an error figuring out my two unknowns (X(1) &x(2)) , can anyone pls help?
Maybe you divide somewhere by x(1) or x(2) in the definition of your function F (which would result in a division-by-zero in the...

etwa 3 Jahre vor | 0

Beantwortet
hello, kindly help, I am getting the following error why?: Error using bvp4c Unable to solve the collocation equations -- a singular Jacobian encountered. Error (line 7)
Your initial guess of [ 0 0] resulted in NaN values for dydt. The code works now, but the results are weird. You should check y...

etwa 3 Jahre vor | 0

Beantwortet
Solving differential equation using ode45
Here is the solution of your problem for reference: x = linspace(0,1,25); t = linspace(0,2.5,25); m = 0; sol = pdepe(m,@heat...

etwa 3 Jahre vor | 1

Beantwortet
How do I solve this non linear equation that requires user defined inputs for each variable and determine the value of K
syms I I0 Ilim C C0 Kinv eqn = I == I0 + (Ilim-I0)/(2*C0)*((C0+C+Kinv)-sqrt((C0+C+Kinv)^2-4*C*C0)); sol = solve(eqn,Kinv); K ...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
Solve function not returning a zero
syms x y a = 3; b = 4; c = 1; d = 2; g = 2.5; eqn = (sqrt((x-a).^2 + (y-b).^2) - sqrt((x-c).^2 + (y-d).^2)).^2 == g.^2; s...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
how to right math functions
us = @(t) 4*(t>=0 & t<5) + 2*(t>=5); t = -10:0.1:10; plot(t,us(t),'r')

etwa 3 Jahre vor | 0

Beantwortet
Solving a system of differential equation using BVP4C but getting error - "The derivative function ODEFUN should return a column vector of length 4."
Replace your function "freq" by function dYdx = freq(x,Y,kGA,EIeff,rhoAom,rhoIom,Fhydro,Mb) Y0 = Y(1); Y1 = Y(2); Y3 = Y(3);...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
SOLVING SYSTEM OF ODEs
Write your three equations in the same independent variable (thus either t or tau). I assume all three equations are written in...

etwa 3 Jahre vor | 0

Mehr laden