Réponse apportée
Runge-Kutta 4th Order on a 2nd Order ODE
Comparing with a MATLAB integrator, the results look ok. I don't know how you derived that "the value of k11 shoud be -0.06 bu...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Changing ode solver tolerances on the fly
Is it possible to change (relax) the values of the "Absolute tolerance", Relative Tolerance" on the fly just for the "problem" t...

presque 3 ans il y a | 1

Réponse apportée
Saving of state just before nonconvergence of ode solvers
The stepsize before the solver exists usually becomes small. So if you choose "tspan" in the call to the ode integrator as a 2-e...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
ODE45 not producing outputs test does not finish
Use a stiff integrator, namely ode15s instead of ode45.

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Unrecognized function error in bvp4c (in boundary conditions)
A = 2; B = 1.5; g = load('gr_in.mat'); gr = g.gr; rc = gr(:,2); figure(1) plot(gr(:,2),gr(:,1)) N = 100; r = linspace(rc...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
Write function for complicated recurrence relation.
I modified your formula slightly, and after this modification, it seems to give correct results: N = 14; L = zeros(N); L(1,1:...

presque 3 ans il y a | 0

Réponse apportée
Fit ellipsoid to (x,y,z) data
https://uk.mathworks.com/matlabcentral/answers/2038016-how-to-plot-the-best-fitted-ellipse-or-circle?s_tid=srchtitle https://uk...

presque 3 ans il y a | 2

Réponse apportée
script no longer works after update to 2023b (related to ode45)
Why do you use ode45 for a boundary value problem ? Use bvp4c instead. The below code doesn't give errors or warnings - at leas...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
how to code this type of objective function (optimization)
Use "fminimax" and read the documentation on how to apply the software also for maximizing the minimum instead of minimizing the...

presque 3 ans il y a | 1

Réponse apportée
How to plot the best fitted ellipse or circle?
Compute the center of gravity of the point cloud. Call it (x',y'). Compute the point of your point cloud with the greatest dist...

presque 3 ans il y a | 1

Réponse apportée
Plot Lagrange parabolas for a Simpson's composite rule
clearvars; close all; clc; f =@ (x) 2 + sin((pi/20)*x) + sin((pi/3)*x); x0 = 0;%input("Inferior limit in x to aproximate: ...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
Solving system of ODE and PDE in 1D
Except for DTwDt(1) = 293.0; which must of couse read DTwDt(1) = 0.0; it seems the equations as written are correctly implem...

presque 3 ans il y a | 0

Réponse apportée
Error using sym/subs Inconsistency between sizes of second and third arguments.
You cannot subs a vector of size 1x2 for a vector of size 1x3 (see above).

presque 3 ans il y a | 0

Réponse apportée
Find Coefficients of a 5th order ODE without ode45
syms t x(t) Dx = diff(x,t); D2x = diff(x,t,2); D3x = diff(x,t,3); D4x = diff(x,t,4); D5x = diff(x,t,5); eqn = D5x-5*D3x+4*...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
How to find mean of sin(t)/t with t [0, pi]?
syms x I = vpa(int(sinc(x),x,0,1))

presque 3 ans il y a | 0

Réponse apportée
Error in fzero usage
bs_price = blackScholes(sigma,S,K,r,T,r,q); function resu = blackScholes(sigma,S,K,r,T,q) Do you see the different number of i...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
problem with symbolic factorization with two symbols
Here are the factors: syms s K eqn = s^3 + 10*s^2 + (21+K)*s + 4*K == 0; factors = solve(eqn,s,'MaxDegree',3)

presque 3 ans il y a | 1

Réponse apportée
My while loop only runs once then hits an error
Maybe like this ? % Section 1 clear; clc; n=1; h(n) = 0; v(n) = 0; t(n) = 0; % initial values m = 0.5; % mass of rocke...

presque 3 ans il y a | 0

Réponse apportée
Finding sum of for loop with if else statement
You mean this ? trangeF = 0:0.001:1.6; % Time range xt = zeros(size(trangeF)); for n = -2:2 if n == 0 s0 = 312...

presque 3 ans il y a | 0

Réponse apportée
Solving a system of integro-differential equations
Define dI_n / dt = P1*exp(-lambda_n^2*D_a*t) , I_n(0) = 0 as additional ODEs to be solved. Then I_n = integral_{tau = 0}^{tau...

presque 3 ans il y a | 0

Réponse apportée
"I'm trying to add an 'if' statement to analyze each result, but Matlab is 'ignoring' the condition and not performing the addition."
c is a vector. Do you want d to be rad2deg(theta) + 180 if all elements of the vector c are < 0 ? Then your code is correct. Oth...

presque 3 ans il y a | 0

Réponse apportée
Replace a variable in a fuction handle by a function
Define "modelfun" for "nlinfit" not as a function handle, but as a normal function. Within this function, you can do everything ...

presque 3 ans il y a | 0

Réponse apportée
Using fittype with a symbolic function
The problem was solved by converting the symbolic function "qme" to a numerical function handle by using qme_numeric = matlabFu...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
fmincon: optimize till nonlinear condition is false
Is there an option for fmincon or other optimizers to define this or maybe to ask the optimizer to go on till the nonlinear cond...

presque 3 ans il y a | 1

Réponse apportée
i tried to find k which depends on w , but i cannot preallocate p3,p4.....,please help?
Use A=[e15*exp(k),-e15*exp(-k),(c44*p3(j)+e15)*s3(j)*exp(s3(j)*k),(c44*p4(j)+e15)*s4(j)*exp(s4(j)*k),(c44*p5(j)+e15)*s5(j)*exp...

presque 3 ans il y a | 0

Réponse apportée
Error in bvp4c code
@(r,y)baseBC(ya,yRc,yRp,yRb,P0,We,m,Da,beta,alpha,phi) You don't want to use ya and yb (in your notation: r and y), namely the ...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
How to plot a current based on active voltage?
i = [100,10,100]; t = [0,0.2,0.4,0.6]; R = 8.314; F = 9.648e4; Temp = 80 + 273.15; %Conductivity reference temperature ipp_...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
graphs are not displaying
"initial_state" had to be defined. globals had to be included where the variables were needed. "y" has been removed from the g...

presque 3 ans il y a | 1

Réponse apportée
Differential equation to find activation voltage
Matlab cannot find an analytical expression for u. You have to use a numerical approach. I'm not sure about the term exp(b_an*G...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
How do I need to configure Matlab's solver such that it returns the correct solutions when complex magnitudes are involved?
Better use solve(expression*expression'==1,w) instead of solve(abs(expression)==1,w) From your hand calculation it follows t...

presque 3 ans il y a | 0

| A accepté

Charger plus