Respondida
Ode45 calling a matrix and an array in a function
Your arguments to q_dot are inverted: Use function q_dot = q_dotf(ts,q) instead of function q_dot = q_dotf(q,ts) And note t...

más de 3 años hace | 0

| aceptada

Respondida
Stability analysis of a non-linear ODE system
syms Sci C Sr Sh R Cf Cp Ce E HR H Sp P k1 k2 k3 k4 k5 k6 k7 k8 k9 k10 k11 k12 k13 k14 k15 k16 p1 p2 p3 mu eta alpha theta CL F...

más de 3 años hace | 1

Respondida
How to solve the parameters of a diffusion model?
Make a code to determine the roots of your second equation. Make a code that evaluates the infinite sum to determine q_t from y...

más de 3 años hace | 0

| aceptada

Respondida
The error is " Unrecognized function or variable 'Vmp' " on line 21, but i need to find the root of Vmp(which is -0.05). Can anyone help me with this??
A fixed point iteration for your function does not converge. Didn't you see this in your former question ? And if it worked, g ...

más de 3 años hace | 0

Respondida
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*...

más de 3 años hace | 1

| aceptada

Respondida
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...

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 0

| aceptada

Respondida
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...

más de 3 años hace | 1

| aceptada

Respondida
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...

más de 3 años hace | 0

| aceptada

Respondida
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)

más de 3 años hace | 0

Respondida
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)

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 0

| aceptada

Respondida
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.

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 0

| aceptada

Respondida
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';....

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 0

| aceptada

Respondida
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;

más de 3 años hace | 0

| aceptada

Respondida
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...

más de 3 años hace | 0

| aceptada

Respondida
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.

más de 3 años hace | 1

Respondida
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...

más de 3 años hace | 1

Respondida
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 ...

más de 3 años hace | 0

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

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 1

| aceptada

Respondida
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...

más de 3 años hace | 0

Respondida
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]) ...

más de 3 años hace | 1

Respondida
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)) -...

más de 3 años hace | 1

| aceptada

Respondida
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...

más de 3 años hace | 0

| aceptada

Respondida
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...

más de 3 años hace | 0

| aceptada

Cargar más