Answered
integral2 with arrayvalued
function main r1 = 0.0185; r2 = 0.0172; sig1 = 0.2222; sig2 = 0.1450; sigF = 0.1013; rhot = -0.5112; rho ...

9 years ago | 0

| accepted

Answered
How do I solve differential equation in while/for loop using ODE45?
function yprime = cycfun(t,y,K) a = 0.18; b = 0.2; c = 5.7; n = 12; i = 1; f = []; while i < n f = [f;-...

9 years ago | 0

| accepted

Answered
Solving a nonlinear equation with numerical integration
First method: 1. Fit functions B1(lambda), B2(lambda), e1(lambda) and e2(lambda) to your data in the different ranges (500 to...

9 years ago | 0

Answered
I am having trouble multiplying my main ode function with an external function NS which is supposed to be multiplied on the RHS. Thanks for the great help.
zr = [2 3 5 7 10 15 20]; r = [3.5 3.7 4 6 7.2 8 9]; y0 = [0 ; 0.01]; zsol = []; y1sol = []; y2sol = []; for ...

9 years ago | 0

| accepted

Answered
Solving rate equations by using ode45.
Use "dsolve" instead of "ode45". Your complete system has a simple analytical solution. Best wishes Torsten.

9 years ago | 0

Answered
Analytical solution of constrained linear least-squares problems with bounds x ≤ ub
First case: d>0: If there exists an index j with c_j < 0, choose x_j = d/c_j and x_i = 0 for all other indices i<>j. If al...

9 years ago | 0

Answered
Problems solving cupled 2nd Order ODE with od45
M=@(t,y)[y(2);-R*y(2)+((mag1(1)-y(1))/(sqrt((mag1(1)-y(1))^2+(mag1(2)-y(3))^2+(mag1(3))^2)^3)+(mag2(1)-y(1))/(sqrt((mag2(1)-y(...

9 years ago | 0

Answered
fsolve with 3 variable name
At the beginning of the function that "fsolve" calls, set eb(2)=X(1); eb(3)=X(2); eb(4)=X(3); q(2)=X(4); q(3)=X...

9 years ago | 0

| accepted

Answered
How to solve a linear system of equation A
In case A is singular (as A=[2 3; 4 6]), use "pinv" instead of "inv". Look up https://de.mathworks.com/help/matlab/math/sy...

9 years ago | 0

Answered
Can Matlab ODE solver solve this problem
Given p(lambda_i) and q(eta_i), you can determine p(lambda_i+delta_lambda) and q(eta_i+delta_eta) by solving the system of equat...

9 years ago | 0

Answered
Solving non-linear SECOND ORDER ODE BY MATLAB
Use "bvp4c" with its option for "Multipoint Boundary Value problems": https://de.mathworks.com/help/matlab/ref/bvp4c.html#b...

9 years ago | 0

Answered
Solving non-linear PDE
Rewrite the equation as [(5+c)^2/{(5+c)^2+5}]^(-1) * dC/dt = d^2C/dx^2 and use MATLAB's "pdepe". Best wishes Torst...

9 years ago | 0

Answered
how to solve for y, all other variables are known. Qave - (1/n).*((y.*(b+2.*y)).^(5/3)/(b+2.*y.*sqrt(1+m.^2)).^(2/3)).*sqrt(S0)= 0
You will have to define y as syms, not as zeros(1,1000). But my guess is that your equation has no analytical solution. Thus ...

9 years ago | 0

Answered
How can I solve a non homogeneous diff equation numerically?
k=23; m=9.1093821545*1e-31; w=sqrt(k/m); hb=(6.6260695729*1e-34)/(2*pi); E0=hb*w*.5; M=@(x,y)[y(2);(hb*w*.5-....

9 years ago | 0

| accepted

Answered
I am using fsolve and receiving errors
Add disp(F) at the end of solar5d. I suspect that the array F contains Inf, NaN or something similar. Take care ...

9 years ago | 0

Answered
Hello! Is it possible to solve a system of differential equations in matlab without using symbolic functions?
https://de.mathworks.com/help/matlab/ref/ode15s.html https://de.mathworks.com/help/matlab/ref/ode45.html Best wishes To...

9 years ago | 0

| accepted

Answered
Solve 1-D interfacial mass transfer using pdepe
First of all one error in your actual code: qr=1 instead of qr=D. If you set qr=D, your boundary condition reads h*(Cp...

9 years ago | 0

| accepted

Answered
there are something wrong with solving DAEs by using ode15s
Differentiating your constraint you get Differentiating once: 2*x*x'+2*y*y'-2*((z-ZB)*(XA-XB)/(ZA-ZB)+XB)*(XA-XB)/(ZA-ZB...

9 years ago | 0

| accepted

Answered
Solving Boundary Value Problem in 2D
Interpret x as time(t) and y as length(x) and use MATLAB's "pdepe". Best wishes Torsten.

9 years ago | 0

| accepted

Answered
function handle how to apply to dsolve???
Use function handles if you want to integrate numerically, use symbolic expressions if you want to integrate symbolically. Be...

9 years ago | 0

Answered
The use of shooting algorithm to solve the second-order differential equations
The implementation of this problem in MATLAB is much more difficult than you did above. Here is a guideline: https://www2....

9 years ago | 0

Answered
How to find next number divisible by n
b = a + (n - rem(a,n)) Best wishes Torsten.

9 years ago | 0

| accepted

Answered
Results for eig function
Use format longE Best wishes Torsten.

9 years ago | 0

| accepted

Answered
Error in nested integration
fun1= @(y) y+ integral(@(x)fun(x,y), 0,1,'ArrayValued',true); Note that fun is undefined at y=0. Thus c1 should come out as...

9 years ago | 0

| accepted

Answered
How to solve a system of parabolic partial differential equations in time and 1 D space
One mistake in your settings: f = [k*DuDx(1) ; kG*DuDx(2)]; s = [(u(2)-u(1))*alph-cv*mdot/A*DuDx(1);(u(1)-u(2))*alph...

9 years ago | 1

| accepted

Answered
I want a code for solving a coupled 3rd order and 2nd order ode using shooting method and RK-4 numerical technique , please if anyone could help
Try function main global Pr k1 M lambda Pr=0.7; k1=0.1; M=1; lambda=0.1; rlow=0; rhigh=10; N=1000; op...

9 years ago | 0

| accepted

Answered
Probability airport question code.
function boarding %100 passengers %We assume that Frank's seat is seat 99, your seat is seat 100. %Further assume tha...

9 years ago | 0

Answered
sum calculation in matlab
If you define Z, S, T as numerical arrays, you can determine a and b as A = [-sum(S.*S) sum(S.*T);-sum(S.*T) sum(T.*T)]; ...

9 years ago | 0

Answered
Converting Matlab ode45 into C with complex output
*"the output data must be real when enforcing non-negativity...".* But you seem to use the non-negativity option of ODE45 whi...

9 years ago | 0

Answered
second order differential equation
function van = vandp(x,y) u = 0.1; %x(1) = 2; %y(1) = 1.5; van=-u*(x^2-1)*y-x; Best wishes Torste...

9 years ago | 1

Load more