Answered
How to calculate gradient from semilogy plot graph?
In the left part, your functional equation is approximately f(x) = 10^(-3.2*x+70) I don't know from your question whether you ...

4 years ago | 0

| accepted

Answered
System of 4 non-linear equations yields Empty sym: 0-by-1
%parameters I_sc = 0.473; V_oc = 2.6; V_m = 2.32; I_m = 0.455; R_s = 0.001; T = 313.5; k = 1.38e-23; e = 1.6e-19; c = 1...

4 years ago | 0

Answered
radial diffusion pde boundary conditions
Here is an example for the 1d spherical diffusion equation dT/dt = 1/r^2 * d/dr (r^2*D*dT/dr) with boundary conditions dT/dr ...

4 years ago | 1

| accepted

Answered
Getting NaN while using the ratio of power and factorial
exp(400)*200 is quite large ... format long l=0; lp=2; d=200; a2= ((-sqrt(d))^lp); a3 =((-sqrt(d))^l); a1 = 1.0; sum1 = ...

4 years ago | 1

Answered
Solving system of PDES using Method of Lines
Try this code. At least, it gives a result. clear all; clc; close all; L=500; ...

4 years ago | 0

| accepted

Answered
Need help on program
h = 0:50:50000; for i = 1:length(h) if h(i)<11000 Te(i) = 15.04-0.00649.*h(i); pe(i) = 101.29.*((Te(i)+2...

4 years ago | 0

| accepted

Answered
how find the perimeter of irregular shape
tf=2*pi; phi=0:0.01:tf; m=4; n1=9/16; n2=6; n3=2; u=1; v=1; r=(((abs((1/u).*cos((m*phi)/4))).^n2)+((abs((1/v).*sin((m*ph...

4 years ago | 1

| accepted

Answered
Error using odearguments?
syms t Vol = 900; % Volume for emulsion injected g = 9810; % mm/s^2 - gravity L = 0.5e-6; ...

4 years ago | 1

Answered
Defining Differential Equation in Runge Kutta 4th order
Ta = 300; g = 9.81; V=12; %Volt I=10; %Ampere delta = 1; %switch r=0.01; %[m] l=0.2; %[m] Aw = pi*r^2; Al = l*2*r; m=6...

4 years ago | 1

| accepted

Answered
code to solve second order coupled PDE
It's not a system of PDEs, but of ODEs. Convert the two second-order ODEs to a first-order system of 4 ODEs. Then use ODE45 to ...

4 years ago | 0

Answered
Why does my function abc give error with optimtool
The product r*k in the line A = exp(-1j*r*k);% Steering matrix is not defined. k is (3x3), r is (Nx3) where N = 10. Setting ...

4 years ago | 0

| accepted

Answered
Please help me code this
c = integral(@(x)integral(@(y)sqrt(x.^2+y.^2),0,sqrt(2*x-x.^2)),0,2,'ArrayValued',true) syms x y c = int(int(sqrt(x^2+y^2),y,0...

4 years ago | 0

Answered
Too many input arguments.
emu has 9 input parameters, but you call it with 10. 9 inputs: function f = emu(t, x, nd, alpha, mu, D0, Vol, g, D) ...

4 years ago | 1

| accepted

Answered
4th order ODE, 4 boundary conditions
%solinit = bvpinit(linspace(0,0.05,1), [1, 0]); solinit = bvpinit(0:0.05:1, [1, 0,0,0]); sol = bvp4c(@ab, @bc4,solinit); %x =...

4 years ago | 0

Answered
How to plot implicit function with conditions?
Doesn't look that nice ... fimplicit3(@fun,[-5 5 -5 5 -5 5]) function values = fun(x,y,z) [theta,r] = cart2pol(x,y); ...

4 years ago | 0

Answered
Final Point Equals Initial Point when trying to optimize
Here is a code where A does not equal A0: A0=1e-3*[1.5*(10^7),1*(10^6),1*(10^6)] sum(fit(A0).^2) options = optimset('TolFun',...

4 years ago | 0

| accepted

Answered
ode45 and rungekutta yield different result
Both results look the same for me. C_p=3.026700000000000e-10; kp=392400000; theta_p = 0.231516000000000; R_s=20*1.8e6; % ohm...

4 years ago | 1

| accepted

Answered
exponential curve fitting in MATLAB for any type of x and Y data with equation y=ae^bx to calculate a and b coefficients
Instead of your code (in which you linearize f giving biassed parameter estimates) use the following: fun = @(p)p(1)*exp(p(2)*x...

4 years ago | 0

Answered
How to plot implicit function with conditions?
Use "fimplicit" or "fimplicit3" and select ranges for the variables: https://de.mathworks.com/help/matlab/ref/fimplicit.html h...

4 years ago | 0

Answered
Find vector that minimize the matrix equation
x = A\b is a vector that minimizes norm(A*x-b).

4 years ago | 1

Answered
How do I multiply a matrix and a column vector of variables ?
Try a combination of str2sym and cell2sym (I don't know the class of "ans" from your description) to convert ans to a symbolic c...

4 years ago | 1

| accepted

Answered
How to multiply a 3d array with a 2d matrix?
Just the other way round: mtx_c = zeros(size(mtx_a,1),size(mtx_a,2),size(mtx_b,2)); for i = 1:size(mtx_a,1) M = squeeze(m...

4 years ago | 1

| accepted

Answered
Using ode45 to solve system of ODEs with some initial conditions and some terminal conditions
This is a boundary-value problem. Use BVP4C or BVP5C instead of ODE45.

4 years ago | 0

| accepted

Answered
Plot closed convex set in 2D
If f is only one function and not a vector of functions, use "fimplicit". fimplicit(@(x,y) x.^2+y.^2-1);

4 years ago | 1

Answered
Please find the mistake in this code.
alpha = -0.1; sigma = 0.1; eps = -0.1; e = 0.2; M = 10; a = 2; %figure psi_list = [10, 20, 30, 40, 50]; lambda = 0:0.2:4...

4 years ago | 0

| accepted

Answered
optimization and estimate parameters of ODE model to fit experimental data, with not enough experimental data
Check whether your temperature T in the Arrhenius terms really equals the integration time. I doubt it. A0=[1.3*(10^8),2*(10^8...

4 years ago | 0

| accepted

Answered
Solving equation with two variables, and giving the result for one as a function of the other
Alpha0 = 2.0; Ze_grad = 3.0; Alpha = fsolve(@(x)fun(x,Ze_grad),Alpha0) fun(Alpha,Ze_grad) function res = fun(Alpha,Ze_grad...

4 years ago | 0

| accepted

Answered
Integral in matlab func
You get this error because you didn't assign a value to the variable "time" when you called "meas" or a value >= 0.01. If you g...

4 years ago | 0

Answered
How can I speed up vpasolve when solving 2 equations, 2 variables?
ymin = 65; ymax = 75; ysteps = ymax - ymin + 1; %the FOC of the problem in the second period (derivative wrt s2) s0 = [1 5];...

4 years ago | 0

| accepted

Answered
How can I solve a second degree DAE ?
Write your equations as dx/dt = x2 dx2/dt = 1/m * (- f2(x-x1, x2 - dx1/dt)) 0 = f2(x-x1, x2 - dx1/dt) - f1(x1,dx1/dt) Are yo...

4 years ago | 0

| accepted

Load more