Beantwortet
Solve ODE without initial condition
Your ODE is nonlinear. The symbolic toolbox is not able to find an analytical solution for it. You will only be able to solve it...

mehr als 2 Jahre vor | 0

Beantwortet
this is my sample code and i have to plot 8 by 8 matrix in my actual code, the code itself is correct but it is taking forever,any other way to plot this please help
w=1:3; c44 = 44; n = numel(w); y = zeros(n,1); y1 = zeros(n,1); y2 = zeros(n,1); y3 = zeros(n,1); for j = 1:numel(w) y...

mehr als 2 Jahre vor | 0

Beantwortet
ODE45 solving 3 equations and comparing to RK-4
%% RK4 methods %% Description % RK4 methods are used to solve coupled first-order ODEs clear close all clc %% Input vari...

mehr als 2 Jahre vor | 0

Beantwortet
How to check the convergence and accuracy of the Problem using BVP4c
Inf = 3 seems to be sufficient: global alpha beta Pr Nb Nt %eq1 alpha=1.2; beta=0.3; %eq2 Pr=1.7; Nb=0.1; Nt=0.1; hold o...

mehr als 2 Jahre vor | 0

Beantwortet
How can I plot?
syms b omega r t theta T delta b = 0.1; omega = 2*pi/5; r = b*(1+omega*t); theta = omega*t; C = [r*cos(theta); r*sin(theta)];...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
why isn't my newton rhapson method giving me a quadratic conversion rate?
If b=log(d/dI)/(2*kw); instead of b=log(d/dI)/2*kw; as was first written in your previous code, then B must also be B=(log(...

mehr als 2 Jahre vor | 0

Beantwortet
I am getting this error "Index exceeds the number of array elements. Index must not exceed 1."
You define ICs = 43.4; Therefore, ode15s expects that you want to solve one differential equation. Consequently, "var" in th...

mehr als 2 Jahre vor | 0

Beantwortet
While loop shows the result of the previous run
% Check if there's any change in the matrix positions previous_matrix = matrix; % Store the previous matrix ...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Run pdepe solver in adjacent domains: introduce flux BC at the interface
If you make r = R_T a point of the r-vector, the finite element solver pdepe will automatically respect continuity of c and dc/d...

mehr als 2 Jahre vor | 0

Beantwortet
Derivative not working plot
clear; clc; close all; % Curve Fit x = [6500 6350 6000 5400 5200 4500]; y = [0 0.25 0.5 0.75 0.875 1.0]; theFit=fit(x'...

mehr als 2 Jahre vor | 0

Beantwortet
while loop running forever during attempt at Newton Rhapson method
Your function doesn't seem to have a zero. d=0.007; dI=1.219; Rfi=1.76*(10^(-4)); Rf0=Rfi; hs=356; ht=hs; kw=60; dTm=29....

mehr als 2 Jahre vor | 0

Beantwortet
For loop doesn't work well.
Somewhere in the line P(i) = P(i-1) - dPD_tot(i); the "dx" must come into play because you usually compute the pressure gradie...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
I have a problem with the convergence of fsolve ?
You could try solution = [10,10,1.2]; % Initial guess for R1, R2, Omega % Solve the equations for eachU value for i = 1:lengt...

mehr als 2 Jahre vor | 1

Beantwortet
How manage for loop to calculate distances?
I should have a new "all_distances" variable with 5 values of distance, but it is only showing the error: Why 5 ? You should ha...

mehr als 2 Jahre vor | 0

Beantwortet
runge kutta algae flower
Don't you have to call rk4 twice for stepsize h/2 to compare the results ? And shouldn't the Runge-Kutta step be pout = xk + (...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Find all possible combinations of numbers with a specific array length
M = categorical(["A","B","C","D"]); combinations(M,M,M,M,M,M,M,M,M,M,M,M)

mehr als 2 Jahre vor | 1

Beantwortet
Finite method for a heat generating furnace
You use "j" twice as loop index in a nested loop. This will give problems. for j=1:Ny for i=1:Nx if i==Nx...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Not enough input arguments. Error in mypde_model>bcfun (line 53) ptop =utop - interp1(time, mydata(:,5), t,'spline'); Error in mypde_model (line 17) sol = pdepe(m, @pdefun,
Use sol = pdepe(m, @pdefun, @(z)icfun(z,u_ini1,u_ini2, Z),@(ztop, utop, zbot, ubot,t) bcfun(ztop, utop, zbot, ubot,t,time, myda...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Unable to find explicit solution.
You must use "dsolve", not "solve": syms t x(t) K eqn = diff(x,t) == (1-x/K)*x; dsolve(eqn)

mehr als 2 Jahre vor | 1

Beantwortet
Doubt in Coupled Ode
Your code is correct, but it seems there is a singularity near 0.32.... syms t x(t) y(t) a1 b1 a2 b2 Constant eqn1 = diff(x,t,...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Solving a complex system of differential equations
%q(1) = X, q(2) = Y, q(3) = Xdot, q(4) = Ydot M = [1,0.8;0.8,7]; K = [5,0;0,10]; D = [0.15,0;0,0.35]; F = @(t)[5*exp(i*5*t);...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Piecewise function graph help
L=200; d=10; s=30; r1_max=22.36; r2_max=120.4; r=0:200; for i=1:length(r) if r(i) < d F(i)=0; elseif (r(i) >=d)...

mehr als 2 Jahre vor | 0

Beantwortet
Why are complex values obtained for the below function (x) in the if condition?
Maybe you mean clc close all clear all a = 280; b = 580; c = 0.35; d =1.71E5; e = 7; f = 1+(3.5*(a/b)); g = d/(1+(0.00...

mehr als 2 Jahre vor | 1

Beantwortet
me sale un error en la linea 67: " M(i,j)=buenos(val,3);" y el mensaje es: "Index in position 1 exceeds array bounds (must not exceed 120)"
Add the commands Ni*Nj size(buenos,1) after this line: %% Create output variable buenos = reshape([raw{:}],size(raw)); If ...

mehr als 2 Jahre vor | 0

Beantwortet
Solving PDE and ODE coupled system with varying boundary conditions?
If you want to change a boundary condition, use a second function "fun" and call ode15s with the solution obtained so far and th...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
2 second order differential equations with boundary conditions using bvp4c
Almost the same code as in the preceeding problem: % Parameters alpha = 0.001; gamma = 100; epsilon = 1; delta_v = 0.1; a=...

mehr als 2 Jahre vor | 1

Beantwortet
Fitting two curves with shared parameters to two datasets
clc close all clear all set(0,'defaulttextinterpreter','latex') set(0,'defaultAxesTickLabelInterpreter','latex'); set(0,'de...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
ODE15s Unable to meet integration tolerances without reducing the step size below the smallest value allowed
If you store P for 1:Nx and m for Nx+1:2*Nx, you should also return dPdt for 1:Nx and dmdt for Nx+1:2*Nx. But you return dPdt fo...

mehr als 2 Jahre vor | 1

Beantwortet
Why is my multi-objective optimization with gamultobj (NSGA-II) not working?
Extract your optimization parameters at the time when the integrator returns NaN values. Are they reasonable ? If you think they...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Interior-point and sequential quadratic programming give me the same answer. Is there an error with my code?
I just saw in your code that you don't pass the options structure to fmincon. Thus in both calls, the same solver is used. Use ...

mehr als 2 Jahre vor | 0

| akzeptiert

Mehr laden