Answered
the code print -inf in TT matrix. Please anyone helps
Your value of 1 for delta_t violates the CFL condition for stability of the explicit Euler scheme. Choose a value that satisfie...

3 years ago | 0

Answered
how to derivate an equation of x and y without taking any variable constant?
You mean assuming y = y(x) ? syms y(x) f = y-x*y-sin(y) == 0; df = diff(f,x)

3 years ago | 1

Answered
How to solve for gamma
format long dbs=5.3e-10; das=1.01e-9; cb=4e3; ca=1e3; x0 =0; options = optimset('TolX',1e-14,'TolFun',1e-14); x = fsolve(...

3 years ago | 0

| accepted

Answered
Help solving system of triq equations
%Input Linkage lengths d=11.875; a=2.5; b=11.875; c=3.75; r5=5; r6=6; r7=7; r8=8; L1Theta = zeros(30,4); L1Theta(:,2) ...

3 years ago | 0

| accepted

Answered
i need to find the displacement for the given values
syms p E = 3*10^4; v = 0.29; a = 39; b = 2*a; d = 1; A = pi/4; I = (pi/64)*d^2; G = E/(2*(1+v)); m =...

3 years ago | 0

Answered
How to initialize number of iteration?
A_100_iteration = cell(51,1); Result_100_iteration = cell(51,1); for ib = 1:51 B(1) = (ib-1)*20; for n = 1:100 ...

3 years ago | 0

| accepted

Answered
I'm trying to write a matlab function to solve RK4 and store it in my computer to be called when needed.
If you call RK4 correctly, it will work. syms y(x) dy_dx(x) dy_dx(x) = x + y(x); x_1 = 0; y_1 = 1; x_end = 1; h_step = 0.0...

3 years ago | 0

Answered
error: Index in position 2 exceeds array bounds (must not exceed 31).
Note that I had to make changes to the boundary values and your loop ! Compare with your old code to see the errors you made. c...

3 years ago | 0

Answered
function handle as array
M = rand(4,4); P_initial = rand(4,1); P = @(t) mtimes(expm(t.*M),P_initial); P(0) g = @(a,x)a(x); g(P(0),1)

3 years ago | 0

| accepted

Answered
What does norm function indicate ?
From the MATLAB documentation: n = norm(X) returns the 2-norm or maximum singular value of matrix X, which is approximately max...

3 years ago | 0

| accepted

Answered
My code is giving me a straight line for values of N other than 5
I'm quite sure that the 0.5 has to be taken out of the symsum: syms k N integer syms t y = 0.5 + symsum((cos(k*pi)-1)*(2/((k*...

3 years ago | 0

Answered
Numerically integrate a time dependent differential equation
bP = 1; Te = 1; K = 1; t0 = 1; ti = 24; CDF = @(x)integral(@(t) 1/t0*exp(-bP./(Te^4+K*(307.59-190.96*(log(t/24)).^0.24)).^0...

3 years ago | 0

Answered
Cant take the derivative of this plot...
m = 1; b = 2; k = 10; tnum = linspace(0,7,175); xlabel('0'); syms s F=1/(m*s^3+b*s^2+k*s); f=ilaplace(F); df=diff(f); v...

3 years ago | 0

Answered
Could you please provide script to perform process described below. Many thanks in advance
A = rand(7) A = A(:,4) writematrix(A, 'A.txt')

3 years ago | 0

Answered
Error message when trying to plot
T = K ./ sqrt(2*pi*w); instead of T=(K/(sqrt(2*pi*w)));

3 years ago | 0

Answered
Multiple boundary conditions with two separate intervals
To use bvp4c, the two intervals have to be connected. Thus in your case, it's not applicable (or only with big effort). syms y1...

3 years ago | 0

Answered
how to plot a periodic function?
a = 3.2; t1 = 5; t2 = 7; t3 = 12; t4 = 17; fun = @(x) a*(x>=0 & x<=t1) + (-a/(t2-t1)*(x-t2)).*(x>t1 & x<=t2) + (-a/(t3-t2)*...

3 years ago | 0

Answered
How can I solve coupled nonlinear hyperbolic equations?
CLAWPACK available under https://www.clawpack.org/ is an excellent solver for hyperbolic systems of differential equations. A...

3 years ago | 0

Answered
How to add integral in a integral function
format long integral(@(x)sin(integral(@(a)sin(a),0,x)),0,1,'ArrayValued',true) integral(@(x)sin(1-cos(x)),0,1)

3 years ago | 0

| accepted

Answered
why while loop repeats so long?
If you output "count" for the numerical solution, it's about 14000. Now if you measure the time for one symbolic iteration in ...

3 years ago | 0

| accepted

Answered
vector and for-loop issues in ode solver
%Parameters input.n=10; % # in r input.Ea=63000; % [J/mol] input.R=8.314; % [J/mol/K] input...

3 years ago | 0

| accepted

Answered
Basis function regression for 3 parameters
Put the equations y(x1(i),x2(j),x3(k)) = a_0*f_0(x1(i), x2(j), x3(k)) + a_1*f_1(x1(i), x2(j), x3(k)) + a_2*f_2(x1(i), x2(j), x3...

3 years ago | 0

Answered
Eigenvalues in symbolic matrix
Replace %% 2.stability analysis J=jacobian([gp(1)*vp(1)./(kp(1)+N0)*N*P1 - mp(1)*P1^2==0, ... gp(2)*vp(2)./(kp(2)...

3 years ago | 0

| accepted

Answered
sum of Bessel function
m = 0:250; x = linspace(-5*pi,5*pi,1000).'; A = 2./((2*m+1)*pi).*besselj(0,pi/2*m).*sin(1000*(2*m+1).*x-(2*m+1)*pi/2); f = su...

3 years ago | 0

Answered
Finite difference temperature distribution with TDMA
You solve the system iteratively. But you were told to solve it with the Thomas-Algorithm. So apply this algorithm to the matrix...

3 years ago | 0

| accepted

Answered
How to solve a system of 8 equations having integrals!
d0 = ones(1,8); d = fsolve(@fun,d0) norm(fun(d)) function res = fun(D) d=1.18; E=27000000; L=121.53; I=(pi*d^4)...

3 years ago | 1

| accepted

Answered
In fmincon I set the linear constraint x1+x2+x3=12, but the sum of decision variables in the iteration result does not meet the condition
Tighten your ConstraintTolerance, and you'll see that fmincon converges to an infeasible point for n=12 and n=13. 1st: (main.m)...

3 years ago | 2

| accepted

Answered
unable to plot RungeKutta trajectory graph, potentially initial conditions?
Your code produces NaN values for z(1,:) and z(3,:), most probably caused by thetad and thetav. alpha = pi/4; tend = 2; v0 = ...

3 years ago | 0

Answered
bvp4c/bvp5c error
Did you create a function with name "eps" ? Then you should rename it because "eps" is an internal MATLAB function.

3 years ago | 0

| accepted

Answered
How to solve f'(x)=0?
You want to find x symbolically or numerically ? Numerically use "fzero". Symbolically use "solve".

3 years ago | 0

Load more