Beantwortet
what is different between the codes?
In both cases, you want to solve one equation in three symbolic variables (x,K,M). In your first code, MATLAB is able to determ...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
How can I fix this problem?
You call "fsolve" with a vector of initial values of length 4, but within your function fonk1, you expect a vector x of length 5...

mehr als 2 Jahre vor | 0

Beantwortet
how i could let the graph be at zero and then start at a specific point like this ? (yellow heighlight)
P1 = [-2;0]; P2 = [-0.5;0]; P3 = [0.5;0]; P4 = [2;0]; t = -0.5:0.001:0.5; ft = sin(t*22*pi); plot([P1(1),P2(1),t,P3(1),P4(...

mehr als 2 Jahre vor | 0

Beantwortet
Standard deviation error bars for each interpolated value of temperature
You mean the graphics if you add the line errorbar(xq,average_vq_10,err_10,"blue") at the end of your code from above ?

mehr als 2 Jahre vor | 0

Beantwortet
numerical solution for heat equation
I think your discretization should be done using the FV-method. Here, the volumes and areas of the bricks - expressed with dx, d...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Precision of intersecting a ray with a cylinder without symbolic expressions
w_c = 0.15; %width of the cylinder h_c = 0.15; %height of the cylinder P_0 = [0;0;h_c]; %starting point of the ray for i = ...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
How can I illustrate the objective function and their constraints in function file?
I'm sure you can use a loop to define the constraints, and I'm sure you will find out how. C = 5; S = 3; N = 6; prob = optim...

mehr als 2 Jahre vor | 0

Beantwortet
In an assignment A(:) = B, the number of elements in A and B must be the same. Error in Skeleton_Code_Problem_11 (line 152) y(n+1) = y(n) + dt*(-y(n) - ACE + (PE1 + PE2
Use %Calculating ACE ACE = B*(((w1(n)-ws) + (w2(n)-ws) + (w3(n)-ws))/3); instead of %Calculating ACE ...

mehr als 2 Jahre vor | 0

Beantwortet
Need help to make a ode function asign a value
A,,B,C,D,E,rho and n are undefined. And you must supply V to your ode-function using [tn,xn] = ode45(@(t,x)tempo_SysEDO_NL(t,x...

mehr als 2 Jahre vor | 0

Beantwortet
2D Interpolation/Extrapolation on Irregular shaped grid
In order to use "interp2", you must specify a rectangular region where values of your function are given on a regular grid. Thus...

mehr als 2 Jahre vor | 0

Beantwortet
Is there anyway to increase the calculation speed of this sqrt integral2 without loosing accuracy?
The solution of the 2d-integral via an ode problem is adaptive and fast. It's somehow like applying iterated "trapz", but adapt...

mehr als 2 Jahre vor | 0

Beantwortet
why does the following code give error?
Use xo(1,k)=xo(1,k)+1*exp(1i*((-pi/2)*sin(u(P+i))*(k-1)+(pi/(16*u(i)))*cos(u(P+i))^2*(k-1)^2)); xe(1,k)=xe(1,k)+1*exp(1i*((k...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Ode15s , Plotting issue.
Choose less output times from the solver, e.g. by setting tspan = linspace(tcut(i), tcut(i+1),(tcut(i+1)-tcut(i))/10) inst...

mehr als 2 Jahre vor | 0

Beantwortet
CasADi Integrator setup for transport equation
With a velocity of 100 and a length of 4 for the region of integration, it takes at most 4/100 sec until "rho" gets constant and...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
求救TT HELP WITH THE PDE error (too many input arguments)
If you transfer inputs to the pdepe functions by c = pdepe(0,@slowsorpde,@slowsorpic,@slowsorpbc,x,t,options,... D,v,theta...

mehr als 2 Jahre vor | 0

Beantwortet
How to fit the parameters of a custom curve that includes integration and series summation
The solver will supply trial values for the unknown parameters. So you "only" need to write a function that - given hw and value...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
How do I avoid the mistake?
x in your code is a scalar, not a vector. Thus something like x(k) does not exist. You could work with xold and x where xold wo...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
Calculate a numerical value for the Conditional Tail Expectation (TVaR) at probability level 0.9 for the inverse Gamma distribution with parameters α = 3, and θ = 50, 000
syms x alpha = 3; beta = 50000; f = beta^alpha/gamma(alpha) * (1/x)^(alpha+1) * exp(-beta/x); F = igamma(alpha,beta/x)/gamm...

mehr als 2 Jahre vor | 0

Beantwortet
Coordinate Conversion Equation Solution Issue
Here is a partial solution, but note that equation1_transformed and equation2_transformed are not satisfied for all values of t ...

mehr als 2 Jahre vor | 1

Beantwortet
Data fitting using implicit functions and infinite series
Depending on the number of series terms you want to use in the evaluation of J, determine the roots of the nonlinear equation ta...

mehr als 2 Jahre vor | 1

Beantwortet
Index exceeds the number of array elements, must not exceed 1, in a nested for loop
Use clear clc % givens for the air ma = 15; %kg/s Tai = 1200; % deg-C cpa = 1.207; % kJ/kg-K @ 1200C ODa = 0.05; % m ID...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
finding maximum power using a single-objective optimization algorithm
You want to minimize -f. Thus instead of % Store best fitness of the generation fitnessHistory(generation) = max(fitness); yo...

mehr als 2 Jahre vor | 1

Beantwortet
How to solve a system of exponential equations?
Simply define your equations as function handles, not as symbolic expressions: f = @(a,b,c) [-1*((11.5*exp(0))+(11.3*exp(b*5))+...

mehr als 2 Jahre vor | 2

| akzeptiert

Beantwortet
Solving the system of ODEs and algebraic Equation
As you can see, your algebraic equation does not seem to have a zero for your initial vector for the other variables. Further t...

mehr als 2 Jahre vor | 0

Beantwortet
Plotting is not quie correct
Maybe for i = 1:lengthT for j = 1:length_L term1(i,j) = C2./(lambda(j)*T(i)); E(i,j)= C1./((lambda(j)^5)...

mehr als 2 Jahre vor | 0

Beantwortet
keep getting an error message
x is a 2x4 matrix. So as soon as node1 or node2 in the lines % Calculate the cosine and sine of the element angle dx = x(node...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
How to plot the graph for the given RK 4th order step method
f=@(t,x)(13950-x)/18.75; x0=560; t0=0; t=15; h=1; X(1) = x0; T(1) = t0; for c=1:15 k1=h*f(t0,x0); k2=h*f(t0+(h/2),x0+...

mehr als 2 Jahre vor | 0

Beantwortet
How can obtain the probability density function for a random discreate set of data and fit a custom distribution function ??
Use "histogram" to plot the empirical probability density function for your data and use "mle" to estimate n. https://uk.mathwo...

mehr als 2 Jahre vor | 1

Beantwortet
How to create vector with elements which are matrices?
A cell array might help: M{1} = [3 5;9 12]; M{2} = [2 -9;0.6 -3.7]; M

mehr als 2 Jahre vor | 0

Beantwortet
how to incorporate boundary conditions as constraints in fmincon optimization?
I think with the mixture of numerical, symbolic and optimization variables it is easier to set up the problem directly. x0 = [ ...

mehr als 2 Jahre vor | 0

| akzeptiert

Mehr laden