Beantwortet
plot() and fplot() give different results for the same function
x = linspace(0, 100, 10000); y = 2*sqrt(1+x)+sin(sqrt(pi)*x).*sin(sqrt(1+x)*pi).*(2*x+1)./sqrt(x) - 2*sqrt(1+x).*cos(sqrt(x)*pi...

mehr als 2 Jahre vor | 0

Beantwortet
Vpasolve can not find a solution that I know it exist
Maybe it must read Eq2 = ((a21*W2)/(c2*(a21+a22))) - x12 == 0; instead of Eq2 = ((a12*W2)/(c2*(a21+a22))) - x12 == 0; ? c...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
How to build a graph of the solution of a second-order differential equation in MATLAB
Since sin(pi) = 0, your differential equation reduces to y'' + y = 0 with general solution a*sin(t) + b*cos(t) Now incorpor...

mehr als 2 Jahre vor | 1

Beantwortet
"Busy" when running this code with ODE45
Use ode15s instead of ode45 - you have a stiff system of differential equations.

mehr als 2 Jahre vor | 0

Beantwortet
How to solve complex equations?
Your equation has only complex solutions. Note that you used sind instead of sin in the function definition. Thus assuming the...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
how to output quantities involving time derivatives in pdepe
You don't have access to the spatial discretization of pdepe, thus no access to the exact time derivatives. But if you choose th...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
lsqcurvefit claiming complex-valued function
Although the fiting function fit_function is the log of a real valued part of the function, why is it considering that the funct...

mehr als 2 Jahre vor | 0

Beantwortet
How to test whether a function has roots within a given range?
F = @(x) sin(x); xmin = 0; xmax = 6*pi; x = linspace(xmin,xmax); Fx = F(x); I = find(diff(sign(Fx))) F(x(I)) F(x(I+1))

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
how to output quantities within pdefun, bcfun, icfun in pdepe
After pdepe has finished, call "heatcyl" at the output times. x = linspace(0,1,25); t = linspace(0,1,25); m = 1; sol = pdepe...

mehr als 2 Jahre vor | 3

| akzeptiert

Beantwortet
user defined function including a for loop taking vector input giving vector output
p = 10; result = myfunc2(p) function [y2]=myfunc2(p) y2 = zeros(1,p); y2(1) = 1; for t=1:p-1 y2(t+1)=y2(t)+t; ...

mehr als 2 Jahre vor | 1

Beantwortet
how to input variable with set of value to the PDE
The x-interval of integration was missing, and your boundary condition at x = xl would not work. Further, I changed the T-vector...

mehr als 2 Jahre vor | 0

Beantwortet
what's the relation between A , B and M,G for this Nonlinear system of equation ?
A^2 + B^2 - 2*A*B*cos(2*Phi) = G^2 + M^2

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
Why Dsolve considers my equations' variables constants!?
syms t x1(t) x2(t) p1(t) p2(t) eq = [diff(x1, t) == x2, diff(x2, t) == - p2 - x2, diff(p1, t) == 0, diff(p2, t) == p2 - p1] ds...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Difference Plot in matlab
You must either interpolate the output values of the first signal to the times of the second signal or the output values of the ...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
I'm suppose to plot the conventional integral , but I'm getting wrong values
syms t x(t) zeta = 0.1; omegan = 3; f1 = 1; f2 = 0; T1 = 7; T2 = 30; T3 = 40; D2x = diff(x,t,2); Dx = diff(x,t); eqn =...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Unable to perform assignment because the left and right sides have a different number of elements.
r0=0.05; k1=0.5; k2=0.5; mu=0.5; rho=0.5; epsilon=0.25; K=1; alpha=0.1; q=0.1; eta=0.05; sigma=5; zeta=0.05; omega0=...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
How do I solve multiple bvps with coupled boundary values?
Use the facility of bvp4c to solve multipoint boundary value problems as in your case: https://uk.mathworks.com/help/matlab/mat...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
Solving a nonlinear system of equations (360 unknowns) with constraints
There are specialized algorithms for network simulation. Just blindly writing down the equations and applying a general-purpose ...

mehr als 2 Jahre vor | 1

Beantwortet
Stacked Cuboid for PDE Domain
Usually in such cases the domain is divided into subcubes that share common faces. E.g. the upper cube could be divided into 9 ...

mehr als 2 Jahre vor | 0

Beantwortet
Solving system of nonlinear equations using Matlab
You equations only have a negative solution for x3 as you can see from the function plot. syms x1 x2 x3 f1 = x1*24.57^2*1.6^2 ...

mehr als 2 Jahre vor | 0

Beantwortet
Index exceeds the number of array elements. Index must not exceed 1.
num_samples = size(ITAE.ans , 1); ITAE_value = ITAE.ans(1, num_samples); num_samples is the number of rows of ITAE.ans, but yo...

mehr als 2 Jahre vor | 0

Beantwortet
I have a set of non-linear equations and I have to find the values of r1, r2 and r3 in terms of q, where q=n. Please tell me how to solve it.
You have four equations in four unknowns. Usually, such a system has a unique solution and there is no way to express one variab...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
What happens when we call a function containing a parfor loop within another parfor loop?
This page has the answer to your question: https://uk.mathworks.com/help/parallel-computing/nested-parfor-loops-and-for-loops.h...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
2D PDEs in Cylindrical Coordinates, odes15s, indices compatibility issue
In the script part: global nr nz dr dz drs dzs r z Dc Dt ca Tk cae Tke h k E R rk0 v rho Cp Tw dH ncall In pde_2: global nr n...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
I have 4 step Adams - Bashforth method code. It works. But the results are bad. And plot function gives an error
% Adams-Bashforth 4-step method ynew = fzero(@(ynew) ynew + (55/24)*y(i) - (59/24)*y(i-1) + ... (37/24)*y...

mehr als 2 Jahre vor | 0

Beantwortet
How do you make an initial guess in bvp4c?
xl = 1e-8; xr = 5; [Sxint, xint]=bvp4c_mathworks_Abrikosov_guess(xl,xr); plot(xint,Sxint(1,:)) hold on M = cell2mat(arrayfu...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
How to code for Relation boundary in pdepe
You didn't supply the parameter values in pdex4bc for mu,l,alpha,sigma,m,be,gamma and n. Further setting pl(3)=ql(3)=0 is not a...

mehr als 2 Jahre vor | 0

Beantwortet
How to solve 'out of memory' problem while solving coupled differential equation ?
ode45 collects too many outputs if it saves the solution for every successful step (as it is done if you set tspan = [0 0.1], e....

mehr als 2 Jahre vor | 1

Beantwortet
Error using "superiorfloat" with ODE23
Replace the line I0 = subs(I0, '3.14', pi) by I0 = double(I0)

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
How to fix the error in pdepe?
I included the commands size(c) size(f) size(s) at the end of your function pdex2pde. You can see that MATLAB doesn't lie:...

mehr als 2 Jahre vor | 0

| akzeptiert

Mehr laden