Answered
I need help with fourier matrix index integral, I can't find how to write it in matlab
n = 50; T=20*10^-3; t=0:T/1000:T; w=2*pi*1/T; f=@(t)0+100.*(t>1*T/12).*(t<5*T/12)-100.*(t>7*T/12).*(t<11*T/12); a0 = 2/T*in...

4 years ago | 1

| accepted

Answered
How to solve this differential equation inside derivation are there
Execute this code separately and copy the expressions obtained for az1 and bz1 into your code from above. If you want more vari...

4 years ago | 0

Answered
how to plot solution of ODE eqution with out using fplot ?
Vsol = matlabFunction(VSol); t = 0:0.001:5; plot(t,Vsol(t))

4 years ago | 0

Answered
Volume Monte Carlo Method
I'm surprised that the sphere is characterized as sphere = @(X) heaviside(ones(size(X,1),1) - X(:,1).*X(:,2).*X(:,3)); For me ...

4 years ago | 0

Answered
How i can solve limit this ODE question .
I think you mean lim (t->oo) P(t) instead of lim (x->oo) P(t) don't you ? Seems the limit is not 0, but 1e6: https://www....

4 years ago | 0

Answered
three curve at different x values
plot(x(x<=41.1),blue_curve(x<=41.1))

4 years ago | 0

| accepted

Answered
Plotting the transient temperature profile of a 2D grid using finite-difference solver
Order the temperatures in the grid points (e.g. T11, T12,T13,...,T1_nx,T21,T22,...,T2_nx,...,T_ny,1,T_ny,2,...T_ny,nx). Write...

4 years ago | 0

Answered
Probability distribution (between zero and 1)
Figure 2 with the ksdensity command is exactly what you need. The y-axis never represents probability in the plot of probabilit...

4 years ago | 0

Answered
How to use for loop to iterate over the elements of the initial matrix and keep just the ones in the diagonal.
D =[R(1,1);R(2,2);R(3,3)] or D = zeros(3,1); for i=1:3 D(i) = R(i,i); end What's the problem ?

4 years ago | 1

| accepted

Answered
Fourier coefficients of a function
syms x omega n f = 0.5*(sin(x)+abs(sin(x))); F(omega) = int(f*exp(1i*omega*x),x,-pi,pi) n = 10; g = real(F(0))/(2*pi) + sum(...

4 years ago | 0

Answered
Implementation of 2D advection equation with second order upwind scheme?
Formally, your implementation is correct as it is (I did not check the one-sided difference formulae in detail). The problems I...

4 years ago | 0

| accepted

Answered
Help solving differential equations
syms k0 k1 A0 A(t) B(t) E(t) eqns = [diff(A,t)==-k0*A,diff(B,t)==k0*A-k1*B,diff(E,t)==k1*B]; conds = [A(0)==A0,B(0)==0,E(0)==0...

4 years ago | 0

Answered
solve a symbolic system of simultaneous matrix equations
P=[0,1,0;1/3,1/3,1/3;0,1,0]; A=sym('A', [3 3]); B=sym('B', [3 3]); C=sym('C', [3 3]); I=eye(3); eqns = [I==...

4 years ago | 1

Answered
Stuck at Gauss-Newton Method code
Change j(i,2)=a0*a1*exp(-a1.*x(i)); to j(i,2)=a0*x(i)*exp(-a1.*x(i)); and xx=linspace(x1,x2,100); yy=(a0*xx).*(1-exp(-a1*x...

4 years ago | 0

Answered
Polar Surface Numerical Integration
If your matrix for the surface values is S = s_ij with s_ij = s(r(i),theta(j)) you can get the volume under the surface as V = ...

4 years ago | 1

Answered
How to define event function in ode45 solver as the slop of variable achieve certain value?
Maybe someone could answer if he/she knew what z is in your code. Is it y(1), y(2) or y(3) ? Anyhow: The slopes of your variabl...

4 years ago | 1

| accepted

Answered
Variable f coeffficient depends on x for linprog
According to that some of x variables should be less than zero and some of them should be greter than zero. So, I think I need ...

4 years ago | 0

Answered
Interpolation from a table by using two variables
X = 0:3000:6000; Y = 0:0.1:2; Z = [0 0 0 0.4340 0.45120 0.47110 0.39540 0.40990 0.42670 0.37520 0.38850 0.4036...

4 years ago | 1

Answered
Numerical integration and Laplace inverse of complex symbolic expression
You can't use "vpaintegral" because your function "cdffun" depends not only on x and y, but also on r. Thus a numerical approx...

4 years ago | 0

Answered
I want to solve a set of double pendulum odes
And you are really optimistic that such a complicated system of differential equations could have an analytical solution ? It's...

4 years ago | 0

Answered
find the s1 and s2
A = eye(m) + D; minValue = min(A(:)); % Find all (row, column) pairs where A = the min value. [rows, columns] = find(A == min...

4 years ago | 0

| accepted

Answered
I am tasked to solve the equation in the figure for T(x) and then plot the temperature distribution through the sppon.
The underlying differential equation is lambda*V*d^2T/dx^2 = alpha*A*(T-T_inf) with boundary conditions T(0) = Tb, dT/dx(L) =...

4 years ago | 0

Answered
How to stop data being overwritten in for loop?
In the outer loop, by initializing all vectors to 0, you overwrite all the settings done in the inner loop. Furthermore, I gues...

4 years ago | 1

Answered
Optimisation using intlinprog for a portfolio
[x1,fval1,exitflag1,output1] = intlinprog(-f,intcon,A,b,[],[],lb,ub)

4 years ago | 0

| accepted

Answered
Save Variable from ODE45
Try this: figNum = 1; %% System Parameters % Aircraft M = 5e4; % mass [kg] J = 1.25e4; % moment of inertia [kg.m^2] g ...

4 years ago | 0

Answered
How to randomly select coordinates from given set of data?
A = [1 2; 3 4; 5 6; 7 8; 9 0]; imat = randi(size(A,1)); selected_row = A(imat,:)

4 years ago | 0

Answered
Need help with ODE parameter estimation
I have data that shows the infected cases reported every day over a series of days. This will not be enough to separate the dif...

4 years ago | 0

Answered
Save Variable from ODE45
can anyone see what I am missing? You do not pass "options" to ode45.

4 years ago | 0

Answered
Reaction continues even after the concentration is below zero in Simbiology
If the reaction rate of A is proportional to A (as it should be), you usually don't get problems with negative concentrations.

4 years ago | 0

Answered
For Loop through Matrix
rho=2300; %density [kg/m^3] k=1.4; %Thermal conductivity [W/mK] c=880; %thermal coeff [J/kgK] xstart = 0.0; xend = 1.0; n...

4 years ago | 1

| accepted

Load more