Beantwortet
How can I solve the problem in integral code?
Loop over the values of the sigma-vector - thus call "vpaintegral" for each sigma value separately. Or alternatively make your ...

11 Monate vor | 1

| akzeptiert

Beantwortet
Warning: Error updating FunctionLine in using fplot
In R2024b, I get the warning (see above): Warning: Function behaves unexpectedly on array inputs. To improve performance, pro...

11 Monate vor | 0

Beantwortet
find sequence in a matrix
I = [0 1 0 1 1 1 0 0 0 1 1 1 0 0 1 0 1 0]; k = 3; saved = k + find(diff(I(k:end))==-1,1) If I is a matrix, you will have to t...

11 Monate vor | 0

| akzeptiert

Beantwortet
Pass Additional Arguments into Guess Function for BVP
lambda = 15; additional_parameters = 22; solinit = bvpinit(linspace(0,pi,10),@(x)mat4init(x,additional_parameters),lambda); s...

11 Monate vor | 0

| akzeptiert

Beantwortet
Solve BVP with Arrays as Coefficients
If you have functions depending on x for a, b and f, you are done. If not, you can try the following: Use "interp1" to interpo...

11 Monate vor | 0

| akzeptiert

Beantwortet
Why the integration can not be calculated out correctly?
That's the best you can get, I guess: V = 0.46:0.01:1; for i = 1:numel(V) v = V(i); lower_x = 9.578251022212591 - v; ...

11 Monate vor | 0

| akzeptiert

Beantwortet
Not exactly the exact answer using Symbolic Math Toolbox
syms t f = sin(t); frms = sqrt(1/(2*sym(pi))*int(f^2,t,[0 2*sym(pi)])) % rms value from definition

11 Monate vor | 1

| akzeptiert

Beantwortet
How to implement time dependent heat generation
I leave the rest to you: %% Create thermal model PDE thermalmodel = createpde(1); %% Create Geometry R2= [3,4,-1.5,1.5,1...

11 Monate vor | 0

| akzeptiert

Beantwortet
2 eqns in 2D with different BCs applied to each variable on the same edge? On E1, u1=0 and du2/dn=0, on E2 u2=1 and =du1/dn=0. The solution is all zeros. Example code is below
I think applyBoundaryCondition (model, "mixed", Edge=1, u=0, EquationIndex=1,q=[0 0;0 0],g=[0;0]); applyBoundaryCondition (mod...

11 Monate vor | 0

| akzeptiert

Beantwortet
Error msg: Undefined function or variable 'optimproblem'. Error in optimize_plant_operation (line 6) prob = optimproblem('ObjectiveSense', 'maximize');
"optimproblem" was introduced in R2017b: https://uk.mathworks.com/help/optim/ug/optimproblem.html at the bottom of the page un...

11 Monate vor | 0

Beantwortet
Computing velocity with Forward Euler method
@Riccardo Are you sure you can leave temperature fixed with a pressure difference of 12 bar ? And did you try plotting your re...

11 Monate vor | 0

Beantwortet
model non-autonomous system with neural ode
You can easily convert your non-autonomous system into an autonomous one by defining an additional ODE y2 as dy/dt = y2, y(0...

11 Monate vor | 0

| akzeptiert

Beantwortet
Orthotropic Conductivity on Face
I found orthoK = [0.75*kappa; 0.85*kappa]; in the documentation - thus a column instead of a row vector.

11 Monate vor | 0

| akzeptiert

Beantwortet
Using fprintf in a for loop to display the output as a set of coordinate points
syms x y real y=x*(4-x)^3;dy=diff(y); x_roots=solve(dy,x); y_x_roots=subs(y,x_roots); for j=1 disp('The critical point(...

11 Monate vor | 0

| akzeptiert

Beantwortet
Average Flux Across Edge
Should be averageFlux = 1/(Nodes_Xa(end)-Nodes_Xa(1))*trapz(Nodes_Xa,flux_Xa)

11 Monate vor | 0

| akzeptiert

Beantwortet
What do you think of my numerical Jacobian, using the central-difference method?
It cannot be correct because F1,...,F6 are scalars, not functions. And if F1,...,F6 were functions, the 2*h expression must be...

11 Monate vor | 0

Beantwortet
How should I compute the Jacobian for my equations of motion?
According to your description, at some stage of your procedure, the right-hand side of your ODE system is available as a symboli...

12 Monate vor | 0

| akzeptiert

Beantwortet
Trouble animating a double pendulum
theta_1 = 19*pi/180; theta_2 = 30*pi/180; l_1 = 1; l_2 = 1; g = 9.8; m_1 = 1; m_2 = 1; M = m_1 + m_2; dt = .00...

12 Monate vor | 0

Beantwortet
Numerical Methods for Singular systems
The loop index i does not equal time t. So expressions like d_1=floor(1.5+sin(0.5*i*h)); x1(:,i-d_1-1) x2(:,i-d_1-1) x3(:,i...

12 Monate vor | 1

| akzeptiert

Beantwortet
Does anyone know how to use an IF statement with ODE's? I am trying to create an IF statement sigma > 0 , tau > 0 if dx(3,1) > 0, dx(1,1) > 0 and sigma = 0 , tau = 0 otherwise
You mean % linear ODEs dx(1,1) = alpha * y - beta * r * y; dx(3,1) = - theta * w + lambda * y * w - mu * w * w; if dx(1,...

12 Monate vor | 2

Beantwortet
Integral Recurrence Formula Implementation
This seems to work: xl = 0; xu = 4; q = 12; C1 = 2; vl = (xl*sqrt(xl^2+C1^2)+C1^2*log(xl+sqrt(xl^2+C1^2)))/2; vu = (xu*sqr...

12 Monate vor | 0

| akzeptiert

Beantwortet
How to solve a thermal model? NEED HELP!!
Params = load('Params.mat'); S_matrix = load('S_matrix.mat'); MC = Params.MC; Q = Params.Q; S = S_matrix.S; T0 = 298.15; T...

12 Monate vor | 1

| akzeptiert

Beantwortet
Apply Dirichlet BC on Vertex
Is there a way to use a function and logic (example below) to have the code use Neumann on edges 1 & 4 but when x=xmax and y=ymi...

12 Monate vor | 0

| akzeptiert

Beantwortet
I have a problem with 2D heat conduction develop a computer code to solve the 2D heat conduction equation:∂2T /∂x2 + ∂2T/ ∂y2 = 0, gradient don't change when iterations increase, please help me
The maximum gradient is always in the left and right upper corner point with value (1-0)/(1/40) = 40. So it won't change in the ...

12 Monate vor | 1

| akzeptiert

Beantwortet
How to solve a thermal model? NEED HELP!!
I get these curves with your equations and your data. T0 = 298.15; T_air = 293.15; G_air = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 22...

12 Monate vor | 0

Beantwortet
quadgk AbsTol/RelTol parameters combinations
umin = 1e-16; f = @(t,u) exp(-t*u.^2)./(u.*(besselj(0,u).^2+bessely(0,u).^2)); g = @(u) pi/2 * atan((2*double(eulergamma)-log(...

12 Monate vor | 0

Beantwortet
Solve not returning values after first iteration?
You overwrite omega3 and omega4 as symbolic variables with numerical values. Replace % Solve the system sol = solve([eq1, eq2...

12 Monate vor | 0

Beantwortet
BVP unknown parameter 2 column vector
You forgot to include "C_L_aoa" as global variable in the script part of your code. clear all clc close all %%%%%%%%%%%%%%%%...

12 Monate vor | 1

| akzeptiert

Beantwortet
Nonlinear Curve fitting with integrals
This code works for your supplied data: Delta = 0.075; delta = 0.002; D = 0.098E-9; gamma = 2.675E8; Rmin = 0.01e-6; Rmax ...

12 Monate vor | 0

| akzeptiert

Beantwortet
How to graph coupled differential equations
% Parameters m1 = 4.0; m2 = 6.0; L = 1.5; k = 100.0; % Added missing parameter g = 9.81; F0 = 100; tF = 1; % Initial st...

12 Monate vor | 0

Mehr laden