Beantwortet
Summing scattered data over a 2D grid
format long % Generate random coordinates and concentrations n = 100000; x = -0.5+rand(n,1); y = -0.5+rand(n,1); conc = 10*...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
I need the maximum power to be -0.05 but my output is -3709.4691. Does anyone have any tips?
% Given values Voc = 0.5; % V T = 297; % K q = 1.6022e-19; % C kB = 1.3806e-23; % J/K a=q/(kB*T); % Define the function f...

mehr als 3 Jahre vor | 0

Beantwortet
solve the mass spring system where the mass matrix depends explicitly on time
Setting y1' = y3 and y2' = y4, you arrive at the following code: M = @(t) [t 0; 0 t]; K = [2 1;5 8]; MM = @(t)[eye(2),zeros(2...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Write a matlab function for approximating the value of pi (certain equation)
You sum twice. And (2*n-1)^2*(2*n+1)^2 = (4*n^2-1)^2 Either use n = 20; p = 0; for k = 1:n p = p + 1/(4*k^2-1)^2; e...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
How to calculate and plot ndefinite triple integral?
s = 0.1; a = 0:5:360; a = a*pi/180; fun = @(x,y,z,p) x.*z./(x.^2+y.^2+z.^2).*exp(-0.5*(x.^2+y.^2+z.^2)).*exp(1i*x*(s*sin(p)/s...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to solve the system of inequalities with MATLAB
syms kv real s=solve( (9000000000*kv^3)/3222118333 + (750000*kv)/2181529<0,kv,'ReturnConditions',true)

mehr als 3 Jahre vor | 0

Beantwortet
Trapezoidal quadrature weights from nodes
Both quadrature weights are 0.5, aren't they ? 1/(x1-x0) * integral_{x=x0}^{x=x1} f(x) dx ~ 0.5*f(x0) + 0.5*f(x1)

mehr als 3 Jahre vor | 0

Beantwortet
How to solve systems of ode in matlab?
Your code should somehow look like this. Fill in the details. nx = 11; ny = 11; Lx = 0.1; Ly = 0.1; dx = Lx/(nx-1); dy = L...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
I need to get the hysteresis loop from the memristor and cantilever equations and I have the following code.
As you can see from your code, variable "amp2" is undefined.

mehr als 3 Jahre vor | 0

Beantwortet
Insufficient number of outputs from right hand side of equal sign to satisfy assignment. Error in test14>@(x)[g1(x);g2(x);g3(x)] (line 49) nonlcon = @(x) [g1(x); g2(x); g3(x)
nonlcon has two output arguments, not only one as set in your code: nonlcon = @(x) [g1(x); g2(x); g3(x)]; It will be easiest t...

mehr als 3 Jahre vor | 0

Beantwortet
How can I solve the following PDE?
MATLAB allows you to integrate backwards in time simply by defininig tspan starting with T and ending with 0. And why do you sa...

mehr als 3 Jahre vor | 0

Beantwortet
Attempting to solve 2 unknown functions using matrix method
Now you have to solve a linear system A*T = B. If k becomes temperature-dependent, your matrix A becomes dependent on T and you...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
I'm trying to compare a cell array to a single vector.
DestinationData = {'ATL','DAL','FFT','JBU','SWA';... 'EWR','UAL','FFT','JBU','NKS';... 'PHL','AAL','FFT','JBU','SWA';....

mehr als 3 Jahre vor | 0

Beantwortet
1D Finite volume scheme for river flow
Take a look at https://www.clawpack.org/gallery/pyclaw/gallery/sill.html https://www.clawpack.org/riemann/Shallow_water_Rieman...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Function behaves unexpectedly on array inputs. To improve performance, properly vectorize your function to return an output with the same size and shape as the input arguments
f4 = @(x,y) (x.^2-1).^2+(y.^2)-(3*y)+1; instead of f4 = @(x,y) (x.^2-1)^2+(y.^2)-(3*y)+1;

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Integration using BVP4C
close all clc p=1; P1=2; P2=2; b1=0.00021; b2=0.000058; S1=0.005; S2=580000; G1=2; m2=20; R1=997.1; R2=3; C1=1; R3...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Obtained true when false
In the output, the number is rounded to 1.00000... . But this does not mean that the original number cannot be < 1.

mehr als 3 Jahre vor | 1

Beantwortet
I want to solve a optimization problem [minimization of 2- Norm ], constrains are continuous and binary variables which are linear form. which optimizer solver i need to use?
Since k is a scalar, use prob.Objective =k; instead of prob.Objective =sqrt(sum(k.^2)); This will result in "intlinprog" ins...

mehr als 3 Jahre vor | 1

Beantwortet
Unable to perform assignment because the left and right sides have a different number of elements.
Execute the code after changing for k = 1:2 h(k+1) = -r(1:k)'*inv(toeplitz(R(1:k))); % Levinson-Durbin recursion end to ...

mehr als 3 Jahre vor | 0

Beantwortet
summation of matrix function
s = m(1,1)+m(2,2)+m(3,3)+m(4,4)

mehr als 3 Jahre vor | 0

Beantwortet
How to solve system of ODE's with Boundary Conditions using BVP4C? (I would be very helpful for you)
M = [0 0.5 1 1.5 2]; for i = 1:numel(M) bvpfcn = @(x,y)[y(2);y(3);-y(1)*y(3)+y(2)^2+M(i)*y(2);2*y(3)+2*y(1)*y(2)]; bc...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
How to plot duffing equation?( Frequency amplitude)
Give values to the parameters of the equation, rewrite the equation as a system of two first-order equations and use ode45 to so...

mehr als 3 Jahre vor | 0

Beantwortet
Complex equation in MATLAB (control engineering)
Seems there are several solutions. Use [w_D T_t] = vpasolve(eqns,[w T],[1 1]) instead of [w_D T_t] = vpasolve(eqns,[w T]) ...

mehr als 3 Jahre vor | 1

Beantwortet
Iterations until condition is met
ER = 50; gamma = 1.4; M = 1:0.00001:10; expr = (1./M) .* ((2/(gamma+1))*(1+((gamma-1)/2)*(M.^2))).^((gamma+1)./(2*gamma-2)) -...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
how can I solve the problem Bellow with a three coupled PDEs , knowing that thoses equations represent the energy heat balance of a thermal energy storage system?
Choose a grid in x and r direction. Replace the spatial derivatives by finite difference approximations in the grid points. Inco...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
optimization problem with interdependent variables
Use "fmincon". The primary optimization variable is k. Specify the lower bound for k to be 0 in the variable "lb". The object...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Detecting an error in Muller method.
The argument of the root in the calculation of x2 must become negative. Or simply start with complex values for x1,x2 and/or x...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Stability analysis of a non-linear ODE system
You won't succeed in this generality. To determine the eigenvalues, MATLAB had to solve for the roots of a polynomial of degree ...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
error when trying to run fit function
Seems you gave your script the name "mpower.m". This conflicts with the built-in MATLAB function with the same name. Rename ...

mehr als 3 Jahre vor | 0

Beantwortet
How to repeat a vector over and over?
a = rand(1,1023); a = repmat(a,1,ceil(50000/1023)); a = a(1:50000)

mehr als 3 Jahre vor | 1

Mehr laden