Answered
DAE Error using mupadengine/feval_internal Expecting as many equations as variables.
The result of the following analysis of your differential-algebraic system is: You must prescribe one of the six algebraic func...

2 years ago | 0

| accepted

Answered
Help for solving linear system that involves Bessel and Hankel Functions
What kind of functions are the P_m^n and Q_m^n ? Fix a finite upper bound N for the loops instead of Inf. Then you have a linea...

2 years ago | 0

Answered
Plotting Fourier Series (first 5, 15, 25 partial sums, (3 Plots))
You should be able to add the missing plots. x = 0:0.01:2*pi; n = 25; Fn = fourier(n,x); plot(x,Fn) function Fn = fourier(n...

2 years ago | 1

Answered
Why do I receive Jacobian singular error while solving second order differential equation with boundary conditions?
You need two boundary conditions, not three to fix a solution for a second-order ODE. Anyhow: in each of your cases, you will ...

2 years ago | 0

| accepted

Answered
PDE Toolbox Coefficient Specification
As I already answered, f has to be referenced as a function or a function handle in your case. It cannot be given in the GUI - ...

2 years ago | 0

Answered
Matlab doesn't like my function, why?
Use elementwise division (./) and multiplication (.*) in the computation of An and B: https://uk.mathworks.com/help/matlab/mat...

2 years ago | 1

| accepted

Answered
How to evaluate a symbolic expression having `max` and `diff`?
Use max(x,0) = 0.5*(abs(x)+x) for real x. syms x1 f1 = max([0, (7*sin(4*pi*x1))/10], [], 2, 'omitnan', ~in(x1, 'real')) ...

2 years ago | 0

Answered
Curve fitting of a portion of a plot and linear equilibrium of both plots
How do I curve fit of after equilbrium points in electron temperature profile so that they both equilibriate in a single line ?...

2 years ago | 1

| accepted

Answered
How to make a local function that returns a vector
% parameters N=100; div=0.1; p=sqrt(3); q=0.5; r=2; % Initial values astart=5; bstart=0.1; % function [a,b]=fcn2(N...

2 years ago | 1

| accepted

Answered
I cannot get fplot to plot my piecewise function past an x-axis value of 5
syms t %declare a symbol voltage_values = piecewise(0<=t<=3,25,3<t<=6,0,6<t<=7,-75); fplot(t,voltage_values,[0 7]) %xlim([0 7...

2 years ago | 0

| accepted

Answered
Trying to Solve quadratic inequalities
Don't expect that MATLAB succeeds for complicated systems of quadratic inequalities. But for this simple one, it returns a solut...

2 years ago | 0

| accepted

Answered
Multivariable Integration w.r.t to 1 variable: 2nd variable is a function of 1st
If y is a function of x, your integrand equals F(y(x~))*y'(x~) dx~. Thus your integral equals integral_{x~=f_lower(x)}^{x~=f_...

2 years ago | 1

| accepted

Answered
Solving a matrix equation with fixed point iteration method
main() function main clear; clc; format long % parameters of equations: E = 1; n = 0.1; u = 0.2; % parameters of this ...

2 years ago | 1

| accepted

Answered
newton raphson methon and symbolic functions
Better differentiate your function with respect to h in advance and pass the result to "dvolume" so that you only need to substi...

2 years ago | 0

| accepted

Answered
Specify boundary conditions for each node - Thermal problem
Supply your array or matrix "Data" as an additional input to "mygfun" and "myqfun" and use interpolation to supply the values fo...

2 years ago | 0

Answered
Subs Error while using solve function
You will have to find criteria to sort out the solution you want. E.g. for real solutions only you could use syms R P = 10; e...

2 years ago | 0

Answered
I estimate my desired vector with the given code but can't when.....
As you can see, the difference between xo and the noise-added xo is quite large. Thus you can expect that the difference in the ...

2 years ago | 0

| accepted

Answered
Optimization problem with array input
You might want to try "intlinprog" with x being a binary vector with x(i) = 1 meaning: ball i is picked and x(i)= 0 meaning: bal...

2 years ago | 1

| accepted

Answered
Creating a for loop based on a condition
i = 0; tolerance = 1e-4; imax = 100; output = 1; value = ...; while abs(output-value) > tolerance && i < imax i = i + ...

2 years ago | 0

Answered
Failure in initial nonlinear constraint function evaluation. FMINCON cannot continue.
You forgot to include "RCbeamdata.xls". And you know that you fix x(2) to x0(2) if you set lb(2) = ub(2) = x0(2) ? And you mus...

2 years ago | 0

Answered
error updating function line
This code plots O(i): k=3500; m=5; c=270; a=0.75; T=1.5; w=2*pi/T; g=9.81; syms t a1=2734; a2=-6718; a3=5682; a4=-1...

2 years ago | 0

Answered
Convection-Diffusion-Reaction Equation ( 2D) with a given Constrained Optimal Control Problem
What do you want to control with which constraints and how ? Optimal control problems together with ordinary or partial differe...

2 years ago | 0

Answered
finding fit parameters between two functions
Make a function that - given tau and the parameters you want to fit - returns I_m(tau). Then look at the examples for "lsqcurve...

2 years ago | 2

| accepted

Answered
Syntax for optimization with integer and continuous variables, nonlinear equalities and inequalities?
Concerning your attempt with "ga": See the Note below from the documentation of "ga": x = ga(fun,nvars,A,b,Aeq,beq,lb,ub,nonl...

2 years ago | 1

Answered
issue with simple nested integration of several variables
The problem with integral/integral2/integral3 is always that they call your function not with scalar arguments for the independe...

2 years ago | 0

| accepted

Answered
How to use Cartesian coordinates to create Grid Surface?
If the CAD file describes the surface of the body in question, there should be a value for the elevation associated with each (x...

2 years ago | 0

Answered
Solving an integral within a partial derivative
You have to solve a second ordinary differential equation for y: dy/dt = 2*Ste * theta_f*(1-Ste/3 * theta_f + 7/45*Ste^2*theta_...

2 years ago | 0

Answered
How to use a user defined function inside the curve fitting function?
Use "lsqcurvefit". There are lots of examples under https://uk.mathworks.com/help/optim/ug/lsqcurvefit.html that show how to ...

2 years ago | 0

Answered
Why does the vectorized function give wrong result?
Compare Fun1 and Fun2. In Fun1, xo is computed using u while in Fun2, both xo and xe are computed using b. Further, the sorting ...

2 years ago | 0

| accepted

Answered
what happens behind "/"
If x = [2 3 4 5 6] and y = [3 4 5 6 7], then x/y determines the number "a" for which the error when approximating x by a*y is mi...

2 years ago | 2

| accepted

Load more