Answered
Solution of Differential Equation with only variables.
Sure. syms V(t) b c sol = dsolve(diff(V,t)==b-c*V^2)

4 years ago | 0

| accepted

Answered
Multispecies Diffusion - Fick's 2nd Law (PDEs)
Check the consistency of the length and time units for your constants L, t, D and C0. L = 15; x = linspace(0,L,3000); %t = l...

4 years ago | 1

| accepted

Answered
ODE 45 Extra parameter
I think there is quite a noticable difference between the solution curves. %Q1 tspan = [0 15]; a = 1000 + 1000*2; r = 0.25; ...

4 years ago | 0

| accepted

Answered
curve fit gaussian CDF
ydata = [ 0.0010 0 0.0020 0.0060 0.0210 0.0400 0.0840 0.1890 0.2790 0.4500 0.6180 0.755...

4 years ago | 1

Answered
how to fit the data properly to custom eqaution?
If you want your model curve start at (0,1), delete the constant term k3/3500*3502. Your experimental curve looks more like an ...

4 years ago | 0

| accepted

Answered
I want to do stop condition which demand dx=0 in coupled differential equations
alpha=0.5; beta=0.5; r1=2; r2=3; s1=1; s2=1; t0 = 0; tfinal = 10; y0 = [1; 1]; AnonFun = @(t,y)diag([2+0.5*y(2)-1*y(...

4 years ago | 0

| accepted

Answered
Find Which rows/items have a positive correlation with another item
format long A = [1 2 0 4;0 2 3 4;0 1 2 3;1 3 4 2;0 0.5 1 1.5].'; R = corrcoef(A)

4 years ago | 0

Answered
Numerical integration with two parameters
You should check whether the integral exists when y = x^2/4. In this case, the denominator of fun is 0, and I think you'll have ...

4 years ago | 0

Answered
Second order diffrential equation solve using ode 45
Set x(1) = y and x(2) = dy/dt. Then you get a system of differential equations dx(1)/dt = x(2) dx(2)/dt = -x(2) + sin(100*t) ...

4 years ago | 1

Answered
Energy balance of stirred tank
syms rho cp V u A Tw T0 T(t) Tw(t) eqn = rho*cp*V*diff(T,t) == u*A*(Tw-T); cond = T(0)==T0; T = dsolve(eqn,cond)

4 years ago | 0

| accepted

Answered
Fitting differential equations using function file, error message "too many input arguments"
Runtime is too long, but seems to work in R2022 a. t = [0,0.5,1,2]; Gut = [1;2;3;4]; %No data inputted, doesnt matter Intesti...

4 years ago | 0

| accepted

Answered
fmincon computes always zero as a result
Yes, obviously J is minimized for u = 0 and arbitrary data.err vector. Do you expect something different ?

4 years ago | 0

Answered
How to calculate distance in the given question?
Use "pdist": https://de.mathworks.com/help/stats/pdist.html

4 years ago | 0

Answered
What dose this mean?
The easiest way to see what you are asking is to use the polar representation of a complex number. If z = r*exp(i*phi), then r ...

4 years ago | 0

| accepted

Answered
fminunc Converging at a strange point
xm = linspace(0,4*pi,10).'; ym = sin(xm); % initial parameter guess p0 = rand(1,8); % define objective function (scaled sum ...

4 years ago | 0

Answered
Calculate Negative loglikelihood of custom probability distribution
% Generate random numbers from chi distribution with k = 6 k = 6; y = rand(150,1); x = gammaincinv(y,k/2); x = sqrt(2*x); %...

4 years ago | 0

| accepted

Answered
Calculate Negative loglikelihood of custom probability distribution
Why don't you deduce the equation you have to solve for k by hand ? The paragraph Continuous distribution, continuous paramete...

4 years ago | 0

Answered
Make lsqcurvefit go through a defined point?
fun = @(out)((xdata(:,2).*(out(1)./(1+(xdata(:,1)./out(2))))) + (xdata(:,2).*(xdata(:,5)./(1+(xdata(:,1)./xdata(:,6))))) - (xdat...

4 years ago | 0

Answered
How to perform repmat function to repeat rows of a matrix
B = repelem(A,2,1)

4 years ago | 1

Answered
Solve ode in different interval
0.4*x*(1-x/k) instead of 0.4*x(1-x/k) and the variable k has to be set. st = 10; n = 20; c = 0.1; x0 = 0.5; p = [0.4, 1]...

4 years ago | 0

| accepted

Answered
Solve with several vectors
syms int_v_d_sym int_i_d_sym i_d_sym i_d1_sym int_omega_i_q_sym int_v_q_sym int_i_q_sym i_q_sym i_q1_sym int_omega_i_d_sym theta...

4 years ago | 0

| accepted

Answered
MATLAB Newton Raphson Method with a vector function
You have 7 equations for 4 unknowns. This won't give an exact solution, but only a solution in the least-squares sense. K=2.*ra...

4 years ago | 0

| accepted

Answered
Numerically solve equations with variables inside numerical integration
x = fsolve(@(y)tobesolve(y(1),y(2),y(3)),[0,0,0]) instead of x = fsolve(@tobesolve,[0,0,0]) And the function names must be in...

4 years ago | 1

| accepted

Answered
Index exceeds number of array elements
Insert class(fline) size(fline) after for i=1:nVal [fline,count] = fscanf (fid,'%f %f %f %f %f',5); and see what type...

4 years ago | 0

| accepted

Answered
How to use log scale with fimplicit
x = 0:0.1:1000; fun = @(x,y) cosh((log(2)*(x-1))./((x+1).*y)) - (1/2)*exp(log(2)./y); options = optimset('Display','none'); t...

4 years ago | 0

| accepted

Answered
ODE Event Function not Properly Configured
Always work with function handles instead of strings: options1 = odeset('RelTol', 1e-8, 'AbsTol', 1e-8, 'Events', @reaching_L...

4 years ago | 1

| accepted

Answered
Different outputs of ode solvers inside for loop
This code gives reproducible results; I don't know exactly why your code didn't work. matrix=zeros(90,2); %Model Trace; t...

4 years ago | 0

Answered
Iterative code sequence error
f1 = 1; f2 = 1; f3 = 1; n = 10; f = sequence(n,f1,f2,f3) function f = sequence(n,f1,f2,f3) if n < 4 disp('Choose b...

4 years ago | 1

| accepted

Answered
May I know the default tolerance of the ode45?
odeset

4 years ago | 0

Answered
How to get the discriminant for symbolic quadractice equation?
I guess you mean d = b^2-4*a*c if the polynomial is given by p(x)=a*x^2+b*x+c. So the a and b in the discriminant have nothing t...

4 years ago | 0

Load more