Beantwortet
How to calculate first and second derivative for concentration?
It seems the concentrations are solutions of differential equations, thus something like dy/dt = f(y,t). So you can see that af...

mehr als 2 Jahre vor | 0

Beantwortet
How can I get a loop within a loop to return a value as a matrix?
Maybe you mean B = -0.388; C = -0.026; P = 1.2; T = 305:5:550; R = 8.314; V9 = mvolume9(B,C,P,T,R); disp(V9) function ...

mehr als 2 Jahre vor | 0

Beantwortet
Need Help With Function Creation and Integration
I'll assume that all variables except y0 are scalars and defined somewhere before in your code. In this case, use ua = integra...

mehr als 2 Jahre vor | 0

Beantwortet
Solving a second order nonlinear differential equation with this boundary condition: y'(0) = 0, y(1) =1
The shooting method can be used for any combination of boundary conditions at x=0 and x=1. In your case, you have to estimate y...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
1D Heat equation in Matlab with variable heat Flux at one side
You are doing numerics here. The maximum difference is 1e-13, I think this is acceptable: pdepeSolverTest() function pdepeSo...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Why am i getting blank plots
The solution for all four solution variables is NaN (see above) - most probably caused by the use of "log" in "theta_lm1" and "t...

mehr als 2 Jahre vor | 0

Beantwortet
quadgk problems “Output of the function must be the same size as the input.”
Your functions cannot be vectorized for the below setup because they will be called with vectors for r, r_hat and theta of diffe...

mehr als 2 Jahre vor | 0

Beantwortet
How do i fix my newtons method code?
fx and df are not function handles in your code. So you must use "subs" to evaluate them at a certain x-value. And setting x0 =...

mehr als 2 Jahre vor | 2

Beantwortet
Symbolic function Gaussian Beam
w0 and z0 are function handles. You can't use them like variables in your definitions. Further, E is a complex-valued function....

mehr als 2 Jahre vor | 0

Beantwortet
How to extrapolate the first 5 points
p = load("points.mat"); px = p.points(:,1); py = p.points(:,2); [~,idx] = sort(px); px = px(idx); py = py(idx); plot(px,py...

mehr als 2 Jahre vor | 0

Beantwortet
How to perform recursive integration
syms a b x t positive syms F0 f(x) = b/a*(x/a)^(b-1)*exp(-(x/a)^b); F0(t) = 1; F1(t) = int(f(x)*F0(t-x),x,0,t) F2(t,x) = f(...

mehr als 2 Jahre vor | 0

Beantwortet
Quadratic Objective with two Quadratic Constraints
What about function [y,yeq,grady,gradyeq] = quadconstr(x,B,C) y = []; yeq(1) = x.'*B*x - 1; yeq(2) = x.'*C*x - 1; i...

mehr als 2 Jahre vor | 1

Beantwortet
Using Optimizing Nonlinear Functions to find mutiple variations
xdata=[125 127 129 131 133 135 137 139 141 143 145]; ydata=[0.002 0.003 0.009 0.025 0.053 0.089 0.104 0.09 0.07 0.041 0.017]; ...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
matlab code for 2nd order differential equation with boundary conditions
You have a boundary value problem, not an initial value problem. ode45 is not suited in this case. Use bvp4c or bvp5c instead. ...

mehr als 2 Jahre vor | 0

Beantwortet
Matlab code: deflection of simply supported beam using ode45
Hi, my code keeps returning a function for a cantilever beam rather than a simply supported. How do I fix this?? By using bvp4c...

mehr als 2 Jahre vor | 0

Beantwortet
Solving a system of ordinary differential equations
It's just the starting phase where you observe a linear profile (see below). tspan = [0 60000]; %timespan y0 = [0.0675 0.0075...

mehr als 2 Jahre vor | 0

Beantwortet
nonlinear constraint game theory
By the way: What do you mean by "nonlinear constraint game theory" ? Your constraints are all linear. % Define the objective fu...

mehr als 2 Jahre vor | 1

Beantwortet
Solution of nonlinear ordinary differential equation of second order
I suggest you integrate the equation y" = A (x^4) twice with respect to x and adjust the two free constants from the integrati...

mehr als 2 Jahre vor | 1

Beantwortet
The output of solve(eqn, x) is still an equation instead of number
Use G2 = double(solve(subs(equation1))) instead of G2=solve(equation1,G2)

mehr als 2 Jahre vor | 1

Beantwortet
Finding column index for matching values in a matrix
poschannel = [1 3 -5;0 3 4;-1 1 9]; rows_with_1 = arrayfun(@(i)any(poschannel(i,:)==1),1:size(poschannel,1)) or shorter rows_...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Help with fmincon Optimization for a Function Involving Matrices in MATLAB
y = 3; if y > 1 & y < 5 obj = @(p)0.5*p(1)*p(2)+0.34*p(3); nonlcon = @(p) deal([],p(4)-p(1)*p(2)*p(3)); A = [0 0...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Energy method with Hermite cubic function (2 essential condition)
m and nv are inputs to the function "ex_enerHermite". Where do you set these values and where do you call the function ?

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Conversion from ellipsoidal to geocentric cartesian
I don't think that you need iteration. The 5 steps for conversion are given in the section "Algorithm" under https://uk.mathwor...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Extract columns and rows from matrix
first = rand(5) second = rand(5) second(5,:) = first(:,1).'

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Need some change in the present Analytical solution code which I'm unable
syms x F1(x) G1(x) H1(x) n fw h Nt = 0.5; Nb = 0.5; Pr = 1; Le = 2; DF = diff(F1,x); eq1 = diff(F1,x,3) + diff(F1,x,2) == 0; ...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Please help with fzero function . Thanks
Convert dh_CO2 and dh_H2O from symbolic functions into function handles by using "matlabFunction". After this, they can be use...

mehr als 2 Jahre vor | 1

Beantwortet
Don't know how to put set of numbers in equation
Replace N = a / (sqrt(1-e2 * sin(fi)^2))^3/2 by N = a ./ (sqrt(1-e2 * sin(fi).^2)).^3/2 For an explanation, I suggest readin...

mehr als 2 Jahre vor | 0

Beantwortet
Index exceeds the number of array elements error
y(i-N:i-1) is a vector of length N z(i-N:i-N+M) is a vector of length M+1 y(i) is a single value of length 1 How do you imagi...

mehr als 2 Jahre vor | 0

Beantwortet
Fsolve 19 state variables with matching dimensions
Rename F in this assignment: F = Fin + Fr F is reserved for the 19-element function vector that you return to fsolve.

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Please help, I have no idea how to do this integral in matlab
The integral seems to exist for those values of theta0 with cos(theta0) ~= 0, thus theta0 ~= (2*k+1)*pi/2 for k in Z. In this c...

mehr als 2 Jahre vor | 1

| akzeptiert

Mehr laden